@@ -31,9 +31,7 @@ use super::constants::{
31
31
} ;
32
32
use crate :: crypto:: certificate_pool:: CertificatePool ;
33
33
use crate :: {
34
- crypto:: {
35
- self , CosignVerificationKey , Signature , SIGSTORE_DEFAULT_SIGNATURE_VERIFICATION_ALGORITHM ,
36
- } ,
34
+ crypto:: { self , CosignVerificationKey , Signature , SigningScheme } ,
37
35
errors:: { Result , SigstoreError } ,
38
36
simple_signing:: SimpleSigning ,
39
37
} ;
@@ -366,10 +364,8 @@ impl CertificateSignature {
366
364
crypto:: certificate:: is_trusted ( & cert, integrated_time) ?;
367
365
368
366
let subject = CertificateSubject :: from_certificate ( & cert) ?;
369
- let verification_key = CosignVerificationKey :: from_der (
370
- cert. public_key ( ) . raw ,
371
- SIGSTORE_DEFAULT_SIGNATURE_VERIFICATION_ALGORITHM ,
372
- ) ?;
367
+ let verification_key =
368
+ CosignVerificationKey :: from_der ( cert. public_key ( ) . raw , & SigningScheme :: default ( ) ) ?;
373
369
374
370
let issuer = get_cert_extension_by_oid ( & cert, SIGSTORE_ISSUER_OID , "Issuer" ) ?;
375
371
@@ -464,7 +460,6 @@ pub(crate) mod tests {
464
460
use std:: convert:: TryFrom ;
465
461
466
462
use crate :: cosign:: tests:: { get_fulcio_cert_pool, get_rekor_public_key} ;
467
- use crate :: crypto:: SignatureDigestAlgorithm ;
468
463
469
464
pub ( crate ) fn build_correct_signature_layer_without_bundle (
470
465
) -> ( SignatureLayer , CosignVerificationKey ) {
@@ -474,11 +469,9 @@ OSWS1X9vPavpiQOoTTGC0xX57OojUadxF1cdQmrsiReWg2Wn4FneJfa8xw==
474
469
-----END PUBLIC KEY-----"# ;
475
470
476
471
let signature = String :: from ( "MEUCIQD6q/COgzOyW0YH1Dk+CCYSt4uAhm3FDHUwvPI55zwnlwIgE0ZK58ZOWpZw8YVmBapJhBqCfdPekIknimuO0xH8Jh8=" ) ;
477
- let verification_key = CosignVerificationKey :: from_pem (
478
- public_key. as_bytes ( ) ,
479
- SignatureDigestAlgorithm :: default ( ) ,
480
- )
481
- . expect ( "Cannot create CosignVerificationKey" ) ;
472
+ let verification_key =
473
+ CosignVerificationKey :: from_pem ( public_key. as_bytes ( ) , & SigningScheme :: default ( ) )
474
+ . expect ( "Cannot create CosignVerificationKey" ) ;
482
475
let ss_value = json ! ( {
483
476
"critical" : {
484
477
"identity" : {
@@ -576,7 +569,7 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETJP9cqpUQsn2ggmJniWGjHdlsHzD
576
569
JsB89BPhZYch0U0hKANx5TY+ncrm0s8bfJxxHoenAEFhwhuXeb4PqIrtoQ==
577
570
-----END PUBLIC KEY-----"#
578
571
. as_bytes ( ) ,
579
- SignatureDigestAlgorithm :: default ( ) ,
572
+ & SigningScheme :: default ( ) ,
580
573
)
581
574
. expect ( "Cannot create CosignVerificationKey" ) ;
582
575
@@ -789,7 +782,7 @@ MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETJP9cqpUQsn2ggmJniWGjHdlsHzD
789
782
JsB89BPhZYch0U0hKANx5TY+ncrm0s8bfJxxHoenAEFhwhuXeb4PqIrtoQ==
790
783
-----END PUBLIC KEY-----"#
791
784
. as_bytes ( ) ,
792
- SignatureDigestAlgorithm :: default ( ) ,
785
+ & SigningScheme :: default ( ) ,
793
786
)
794
787
. expect ( "Cannot create CosignVerificationKey" ) ;
795
788
assert ! ( !sl. is_signed_by_key( & verification_key) ) ;
0 commit comments