@@ -6,7 +6,7 @@ use der::{asn1::ObjectIdentifier, oid::AssociatedOid, Any, AnyRef};
6
6
use rsa:: {
7
7
pkcs1:: { self , RsaPssParams } ,
8
8
pkcs8:: { self } ,
9
- pss:: { Signature , VerifyingKey } ,
9
+ pss:: { get_default_pss_signature_algo_id , Signature , VerifyingKey } ,
10
10
} ;
11
11
use signature:: digest:: Digest ;
12
12
use spki:: {
@@ -22,7 +22,6 @@ pub struct Signer<D: DigestSigning, S: SessionLike> {
22
22
session : S ,
23
23
private_key : ObjectHandle ,
24
24
verifying_key : VerifyingKey < D > ,
25
- salt_len : usize ,
26
25
}
27
26
28
27
impl < D : DigestSigning , S : SessionLike > Signer < D , S > {
@@ -64,13 +63,11 @@ impl<D: DigestSigning, S: SessionLike> Signer<D, S> {
64
63
let public_key = read_key ( & session, template) ?;
65
64
66
65
let verifying_key = VerifyingKey :: new ( public_key) ;
67
- let salt_len = <D as Digest >:: output_size ( ) ;
68
66
69
67
Ok ( Self {
70
68
session,
71
69
private_key,
72
70
verifying_key,
73
- salt_len,
74
71
} )
75
72
}
76
73
@@ -109,20 +106,6 @@ impl<D: DigestSigning, S: SessionLike> signature::Signer<Signature> for Signer<D
109
106
110
107
impl < D : DigestSigning , S : SessionLike > DynSignatureAlgorithmIdentifier for Signer < D , S > {
111
108
fn signature_algorithm_identifier ( & self ) -> pkcs8:: spki:: Result < AlgorithmIdentifierOwned > {
112
- get_pss_signature_algo_id :: < D > ( self . salt_len as u8 )
109
+ get_default_pss_signature_algo_id :: < D > ( )
113
110
}
114
111
}
115
-
116
- fn get_pss_signature_algo_id < D > ( salt_len : u8 ) -> pkcs8:: spki:: Result < AlgorithmIdentifierOwned >
117
- where
118
- D : Digest + AssociatedOid ,
119
- {
120
- const ID_RSASSA_PSS : ObjectIdentifier = ObjectIdentifier :: new_unwrap ( "1.2.840.113549.1.1.10" ) ;
121
-
122
- let pss_params = RsaPssParams :: new :: < D > ( salt_len) ;
123
-
124
- Ok ( AlgorithmIdentifierOwned {
125
- oid : ID_RSASSA_PSS ,
126
- parameters : Some ( Any :: encode_from ( & pss_params) ?) ,
127
- } )
128
- }
0 commit comments