From aa878281db9e6f92e4687a5c1abe693bcc5fd346 Mon Sep 17 00:00:00 2001 From: Cyril Soler Date: Sat, 26 Oct 2024 21:02:51 +0200 Subject: [PATCH] using SHA256 by default in certificate self-signature. --- src/pgp/openpgpsdkhandler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pgp/openpgpsdkhandler.cc b/src/pgp/openpgpsdkhandler.cc index 2f9bf0d7d..1e18a9011 100644 --- a/src/pgp/openpgpsdkhandler.cc +++ b/src/pgp/openpgpsdkhandler.cc @@ -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) ; @@ -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 ;