@@ -182,7 +182,7 @@ impl SignatureConfig {
182
182
}
183
183
184
184
self . hash_data_to_sign ( & mut * hasher, data) ?;
185
- let len = self . hash_signature_data ( & mut * hasher) ?;
185
+ let len = self . hash_signature_data ( & mut hasher) ?;
186
186
hasher. update ( & self . trailer ( len) ?) ;
187
187
188
188
let hash = & hasher. finish ( ) [ ..] ;
@@ -272,7 +272,7 @@ impl SignatureConfig {
272
272
// the packet content
273
273
hasher. update ( & packet_buf) ;
274
274
275
- let len = self . hash_signature_data ( & mut * hasher) ?;
275
+ let len = self . hash_signature_data ( & mut hasher) ?;
276
276
hasher. update ( & self . trailer ( len) ?) ;
277
277
278
278
let hash = & hasher. finish ( ) [ ..] ;
@@ -318,7 +318,7 @@ impl SignatureConfig {
318
318
// Key being bound
319
319
key. serialize_for_hashing ( & mut hasher) ?;
320
320
321
- let len = self . hash_signature_data ( & mut * hasher) ?;
321
+ let len = self . hash_signature_data ( & mut hasher) ?;
322
322
hasher. update ( & self . trailer ( len) ?) ;
323
323
324
324
let hash = & hasher. finish ( ) [ ..] ;
@@ -356,7 +356,7 @@ impl SignatureConfig {
356
356
357
357
key. serialize_for_hashing ( & mut hasher) ?;
358
358
359
- let len = self . hash_signature_data ( & mut * hasher) ?;
359
+ let len = self . hash_signature_data ( & mut hasher) ?;
360
360
hasher. update ( & self . trailer ( len) ?) ;
361
361
362
362
let hash = & hasher. finish ( ) [ ..] ;
@@ -372,7 +372,7 @@ impl SignatureConfig {
372
372
}
373
373
374
374
/// Calculate the serialized version of this packet, but only the part relevant for hashing.
375
- pub fn hash_signature_data ( & self , hasher : & mut dyn Hasher ) -> Result < usize > {
375
+ pub fn hash_signature_data ( & self , hasher : & mut dyn std :: io :: Write ) -> Result < usize > {
376
376
match self . version ( ) {
377
377
SignatureVersion :: V2 | SignatureVersion :: V3 => {
378
378
let created = {
@@ -389,7 +389,7 @@ impl SignatureConfig {
389
389
buf[ 0 ] = self . typ . into ( ) ;
390
390
BigEndian :: write_u32 ( & mut buf[ 1 ..] , created. timestamp ( ) . try_into ( ) ?) ;
391
391
392
- hasher. update ( & buf) ;
392
+ hasher. write_all ( & buf) ? ;
393
393
394
394
// no trailer
395
395
Ok ( 0 )
@@ -424,7 +424,7 @@ impl SignatureConfig {
424
424
425
425
res. extend ( hashed_subpackets) ;
426
426
427
- hasher. update ( & res) ;
427
+ hasher. write_all ( & res) ? ;
428
428
429
429
Ok ( res. len ( ) )
430
430
}
0 commit comments