Skip to content

Commit

Permalink
Merge pull request #152 from csoler/v0.6-SS_33
Browse files Browse the repository at this point in the history
using SHA256 by default in certificate self-signature.
  • Loading branch information
csoler authored Dec 8, 2024
2 parents 5e3d142 + aa87828 commit ba6bcda
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 ba6bcda

Please sign in to comment.