Skip to content

Commit

Permalink
using SHA256 by default in certificate self-signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
csoler committed Oct 26, 2024
1 parent 5e3d142 commit aa87828
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pgp/openpgpsdkhandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ bool OpenPGPSDKHandler::GeneratePGPCertificate(const std::string& name, const st
uid.user_id = (unsigned char *)s ;
unsigned long int e = 65537 ; // some prime number

ops_keydata_t *key = ops_rsa_create_selfsigned_keypair(keynumbits, e, &uid) ;
ops_keydata_t *key = ops_rsa_create_selfsigned_keypair(keynumbits, e, &uid,OPS_HASH_SHA256) ;

free(s) ;

Expand Down Expand Up @@ -1487,7 +1487,7 @@ bool OpenPGPSDKHandler::privateSignCertificate(const RsPgpId& ownId,const RsPgpI

// 2 - then do the signature.

if(!ops_sign_key(key_to_sign,pkey->key_id,secret_key))
if(!ops_sign_key(key_to_sign,pkey->key_id,secret_key,OPS_HASH_SHA256))
{
RsErr() << "Key signature went wrong. Wrong passwd?" ;
return false ;
Expand Down

0 comments on commit aa87828

Please sign in to comment.