File tree 1 file changed +11
-2
lines changed
src/libraries/Common/tests/System/Security/Cryptography/X509Certificates 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -517,9 +517,18 @@ singleExtensions [1] EXPLICIT Extensions OPTIONAL }
517
517
}
518
518
else if ( status == CertStatus . Revoked )
519
519
{
520
- // Android does not support all precisions for seconds - just omit fractional seconds for testing on Android
521
520
writer . PushSequence ( s_context1 ) ;
522
- writer . WriteGeneralizedTime ( revokedTime , omitFractionalSeconds : OperatingSystem . IsAndroid ( ) ) ;
521
+
522
+ // Fracational seconds "MUST NOT" be used here. Android and macOS 13+ enforce this and
523
+ // reject GeneralizedTime's with fractional seconds, so omit them.
524
+ // RFC 6960: 4.2.2.1:
525
+ // The format for GeneralizedTime is as specified in Section 4.1.2.5.2 of [RFC5280].
526
+ // RFC 5280 4.1.2.5.2:
527
+ // For the purposes of this profile, GeneralizedTime values MUST be
528
+ // expressed in Greenwich Mean Time (Zulu) and MUST include seconds
529
+ // (i.e., times are YYYYMMDDHHMMSSZ), even where the number of seconds
530
+ // is zero. GeneralizedTime values MUST NOT include fractional seconds.
531
+ writer . WriteGeneralizedTime ( revokedTime , omitFractionalSeconds : true ) ;
523
532
writer . PopSequence ( s_context1 ) ;
524
533
}
525
534
else
You can’t perform that action at this time.
0 commit comments