@@ -128,9 +128,9 @@ fn test_botan_rsa_given() {
128128
129129#[ test]
130130fn test_botan_separate_ca ( ) {
131- let ( mut params , ca_key) = default_params ( ) ;
132- params . is_ca = IsCa :: Ca ( BasicConstraints :: Unconstrained ) ;
133- let ca_cert = params . self_signed ( & ca_key) . unwrap ( ) ;
131+ let ( mut ca_params , ca_key) = default_params ( ) ;
132+ ca_params . is_ca = IsCa :: Ca ( BasicConstraints :: Unconstrained ) ;
133+ let ca_cert = ca_params . self_signed ( & ca_key) . unwrap ( ) ;
134134
135135 let mut params = CertificateParams :: new ( vec ! [ "crabs.crabs" . to_string( ) ] ) . unwrap ( ) ;
136136 params
@@ -143,7 +143,7 @@ fn test_botan_separate_ca() {
143143 params. not_after = rcgen:: date_time_ymd ( 3016 , 1 , 1 ) ;
144144
145145 let key_pair = KeyPair :: generate ( ) . unwrap ( ) ;
146- let cert = params. signed_by ( & key_pair, & ca_cert , & ca_key) . unwrap ( ) ;
146+ let cert = params. signed_by ( & key_pair, & ca_params , & ca_key) . unwrap ( ) ;
147147 check_cert_ca ( cert. der ( ) , & cert, ca_cert. der ( ) ) ;
148148}
149149
@@ -157,7 +157,6 @@ fn test_botan_imported_ca() {
157157 let ca_cert_der = ca_cert. der ( ) ;
158158
159159 let imported_ca_cert_params = CertificateParams :: from_ca_cert_der ( ca_cert_der) . unwrap ( ) ;
160- let imported_ca_cert = imported_ca_cert_params. self_signed ( & ca_key) . unwrap ( ) ;
161160
162161 let mut params = CertificateParams :: new ( vec ! [ "crabs.crabs" . to_string( ) ] ) . unwrap ( ) ;
163162 params
@@ -171,7 +170,7 @@ fn test_botan_imported_ca() {
171170
172171 let key_pair = KeyPair :: generate ( ) . unwrap ( ) ;
173172 let cert = params
174- . signed_by ( & key_pair, & imported_ca_cert , & ca_key)
173+ . signed_by ( & key_pair, & imported_ca_cert_params , & ca_key)
175174 . unwrap ( ) ;
176175 check_cert_ca ( cert. der ( ) , & cert, ca_cert_der) ;
177176}
@@ -190,9 +189,6 @@ fn test_botan_imported_ca_with_printable_string() {
190189 let ca_cert_der = ca_cert. der ( ) ;
191190
192191 let imported_ca_cert_params = CertificateParams :: from_ca_cert_der ( ca_cert_der) . unwrap ( ) ;
193- let imported_ca_cert = imported_ca_cert_params
194- . self_signed ( & imported_ca_key)
195- . unwrap ( ) ;
196192
197193 let mut params = CertificateParams :: new ( vec ! [ "crabs.crabs" . to_string( ) ] ) . unwrap ( ) ;
198194 params
@@ -205,7 +201,7 @@ fn test_botan_imported_ca_with_printable_string() {
205201 params. not_after = rcgen:: date_time_ymd ( 3016 , 1 , 1 ) ;
206202 let key_pair = KeyPair :: generate ( ) . unwrap ( ) ;
207203 let cert = params
208- . signed_by ( & key_pair, & imported_ca_cert , & imported_ca_key)
204+ . signed_by ( & key_pair, & imported_ca_cert_params , & imported_ca_key)
209205 . unwrap ( ) ;
210206
211207 check_cert_ca ( cert. der ( ) , & cert, ca_cert_der) ;
@@ -223,7 +219,6 @@ fn test_botan_crl_parse() {
223219 KeyUsagePurpose :: CrlSign ,
224220 ] ;
225221 let issuer_key = KeyPair :: generate_for ( alg) . unwrap ( ) ;
226- let issuer = issuer. self_signed ( & issuer_key) . unwrap ( ) ;
227222
228223 // Create an end entity cert issued by the issuer.
229224 let ( mut ee, _) = util:: default_params ( ) ;
@@ -232,8 +227,8 @@ fn test_botan_crl_parse() {
232227 // Botan has a sanity check that enforces a maximum expiration date
233228 ee. not_after = rcgen:: date_time_ymd ( 3016 , 1 , 1 ) ;
234229 let ee_key = KeyPair :: generate_for ( alg) . unwrap ( ) ;
235- let ee = ee. signed_by ( & ee_key, & issuer, & issuer_key) . unwrap ( ) ;
236- let botan_ee = botan:: Certificate :: load ( ee . der ( ) ) . unwrap ( ) ;
230+ let ee_cert = ee. signed_by ( & ee_key, & issuer, & issuer_key) . unwrap ( ) ;
231+ let botan_ee = botan:: Certificate :: load ( ee_cert . der ( ) ) . unwrap ( ) ;
237232
238233 // Generate a CRL with the issuer that revokes the EE cert.
239234 let now = OffsetDateTime :: now_utc ( ) ;
@@ -243,7 +238,7 @@ fn test_botan_crl_parse() {
243238 crl_number : rcgen:: SerialNumber :: from ( 1234 ) ,
244239 issuing_distribution_point : None ,
245240 revoked_certs : vec ! [ RevokedCertParams {
246- serial_number: ee. params ( ) . serial_number. clone( ) . unwrap( ) ,
241+ serial_number: ee. serial_number. clone( ) . unwrap( ) ,
247242 revocation_time: now,
248243 reason_code: Some ( RevocationReason :: KeyCompromise ) ,
249244 invalidity_date: None ,
0 commit comments