@@ -19,7 +19,7 @@ fn encode_general_subtrees<'a>(
19
19
ka_bytes : & ' a cryptography_keepalive:: KeepAlive < pyo3:: pybacked:: PyBackedBytes > ,
20
20
ka_str : & ' a cryptography_keepalive:: KeepAlive < pyo3:: pybacked:: PyBackedStr > ,
21
21
subtrees : & pyo3:: Bound < ' a , pyo3:: PyAny > ,
22
- ) -> Result < Option < extensions:: SequenceOfSubtrees < ' a > > , CryptographyError > {
22
+ ) -> Result < Option < extensions:: SequenceOfSubtrees < ' a , Asn1Write > > , CryptographyError > {
23
23
if subtrees. is_none ( ) {
24
24
Ok ( None )
25
25
} else {
@@ -32,9 +32,7 @@ fn encode_general_subtrees<'a>(
32
32
maximum : None ,
33
33
} ) ;
34
34
}
35
- Ok ( Some ( common:: Asn1ReadableOrWritable :: new_write (
36
- asn1:: SequenceOfWriter :: new ( subtree_seq) ,
37
- ) ) )
35
+ Ok ( Some ( asn1:: SequenceOfWriter :: new ( subtree_seq) ) )
38
36
}
39
37
}
40
38
@@ -55,9 +53,7 @@ pub(crate) fn encode_authority_key_identifier<'a>(
55
53
let authority_cert_issuer = if let Some ( authority_cert_issuer) = aki. authority_cert_issuer {
56
54
let gns =
57
55
x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & authority_cert_issuer) ?;
58
- Some ( common:: Asn1ReadableOrWritable :: new_write (
59
- asn1:: SequenceOfWriter :: new ( gns) ,
60
- ) )
56
+ Some ( asn1:: SequenceOfWriter :: new ( gns) )
61
57
} else {
62
58
None
63
59
} ;
@@ -69,7 +65,9 @@ pub(crate) fn encode_authority_key_identifier<'a>(
69
65
} else {
70
66
None
71
67
} ;
72
- Ok ( asn1:: write_single ( & extensions:: AuthorityKeyIdentifier {
68
+ Ok ( asn1:: write_single ( & extensions:: AuthorityKeyIdentifier :: <
69
+ Asn1Write ,
70
+ > {
73
71
authority_cert_issuer,
74
72
authority_cert_serial_number,
75
73
key_identifier : aki. key_identifier . as_deref ( ) ,
@@ -96,16 +94,14 @@ pub(crate) fn encode_distribution_points<'p>(
96
94
97
95
let crl_issuer = if let Some ( py_crl_issuer) = py_dp. crl_issuer {
98
96
let gns = x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & py_crl_issuer) ?;
99
- Some ( common:: Asn1ReadableOrWritable :: new_write (
100
- asn1:: SequenceOfWriter :: new ( gns) ,
101
- ) )
97
+ Some ( asn1:: SequenceOfWriter :: new ( gns) )
102
98
} else {
103
99
None
104
100
} ;
105
101
let distribution_point = if let Some ( py_full_name) = py_dp. full_name {
106
102
let gns = x509:: common:: encode_general_names ( py, & ka_bytes, & ka_str, & py_full_name) ?;
107
103
Some ( extensions:: DistributionPointName :: FullName (
108
- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SequenceOfWriter :: new ( gns) ) ,
104
+ asn1:: SequenceOfWriter :: new ( gns) ,
109
105
) )
110
106
} else if let Some ( py_relative_name) = py_dp. relative_name {
111
107
let mut name_entries = vec ! [ ] ;
@@ -114,7 +110,7 @@ pub(crate) fn encode_distribution_points<'p>(
114
110
name_entries. push ( ne) ;
115
111
}
116
112
Some ( extensions:: DistributionPointName :: NameRelativeToCRLIssuer (
117
- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SetOfWriter :: new ( name_entries) ) ,
113
+ asn1:: SetOfWriter :: new ( name_entries) ,
118
114
) )
119
115
} else {
120
116
None
@@ -338,7 +334,7 @@ fn encode_issuing_distribution_point(
338
334
let py_full_name = ext. getattr ( pyo3:: intern!( py, "full_name" ) ) ?;
339
335
let gns = x509:: common:: encode_general_names ( ext. py ( ) , & ka_bytes, & ka_str, & py_full_name) ?;
340
336
Some ( extensions:: DistributionPointName :: FullName (
341
- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SequenceOfWriter :: new ( gns) ) ,
337
+ asn1:: SequenceOfWriter :: new ( gns) ,
342
338
) )
343
339
} else if ext
344
340
. getattr ( pyo3:: intern!( py, "relative_name" ) ) ?
@@ -353,7 +349,7 @@ fn encode_issuing_distribution_point(
353
349
name_entries. push ( name_entry) ;
354
350
}
355
351
Some ( extensions:: DistributionPointName :: NameRelativeToCRLIssuer (
356
- common :: Asn1ReadableOrWritable :: new_write ( asn1:: SetOfWriter :: new ( name_entries) ) ,
352
+ asn1:: SetOfWriter :: new ( name_entries) ,
357
353
) )
358
354
} else {
359
355
None
@@ -610,7 +606,7 @@ pub(crate) fn encode_extension(
610
606
611
607
let permitted = ext. getattr ( pyo3:: intern!( py, "permitted_subtrees" ) ) ?;
612
608
let excluded = ext. getattr ( pyo3:: intern!( py, "excluded_subtrees" ) ) ?;
613
- let nc = extensions:: NameConstraints {
609
+ let nc = extensions:: NameConstraints :: < Asn1Write > {
614
610
permitted_subtrees : encode_general_subtrees (
615
611
ext. py ( ) ,
616
612
& ka_bytes,
0 commit comments