@@ -922,17 +922,12 @@ impl CertificateParams {
922
922
923
923
// Write custom extensions
924
924
for ext in custom_extensions {
925
- writer. next ( ) . write_sequence ( |writer| {
926
- let oid = ObjectIdentifier :: from_slice ( & ext. oid ) ;
927
- writer. next ( ) . write_oid ( & oid) ;
928
- // If the extension is critical, we should signal this.
929
- // It's false by default so we don't need to write anything
930
- // if the extension is not critical.
931
- if ext. critical {
932
- writer. next ( ) . write_bool ( true ) ;
933
- }
934
- writer. next ( ) . write_bytes ( & ext. content ) ;
935
- } ) ;
925
+ write_x509_extension (
926
+ writer. next ( ) ,
927
+ & ext. oid ,
928
+ ext. critical ,
929
+ |writer| writer. write_der ( ext. content ( ) ) ,
930
+ ) ;
936
931
}
937
932
} ) ;
938
933
} ) ;
@@ -1148,16 +1143,8 @@ impl CertificateParams {
1148
1143
1149
1144
// Write the custom extensions
1150
1145
for ext in & self . custom_extensions {
1151
- writer. next ( ) . write_sequence ( |writer| {
1152
- let oid = ObjectIdentifier :: from_slice ( & ext. oid ) ;
1153
- writer. next ( ) . write_oid ( & oid) ;
1154
- // If the extension is critical, we should signal this.
1155
- // It's false by default so we don't need to write anything
1156
- // if the extension is not critical.
1157
- if ext. critical {
1158
- writer. next ( ) . write_bool ( true ) ;
1159
- }
1160
- writer. next ( ) . write_bytes ( & ext. content ) ;
1146
+ write_x509_extension ( writer. next ( ) , & ext. oid , ext. critical , |writer| {
1147
+ writer. write_der ( ext. content ( ) )
1161
1148
} ) ;
1162
1149
}
1163
1150
} ) ;
0 commit comments