In addition it will offer a SHA hash depending on the key size for
RSA public keys.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
ret = 0;
break;
- case GNUTLS_PK_RSA:
case GNUTLS_PK_RSA_PSS:
+ if (mand && key->params.spki.rsa_pss_dig)
+ *mand = 1;
+
+ if (hash) {
+ if (key->params.spki.rsa_pss_dig) {
+ *hash = key->params.spki.rsa_pss_dig;
+ } else {
+ *hash = _gnutls_pk_bits_to_sha_hash(pubkey_to_bits(&key->params));
+ }
+ }
+ ret = 0;
+ break;
+ case GNUTLS_PK_RSA:
if (hash)
- *hash = GNUTLS_DIG_SHA256;
+ *hash = _gnutls_pk_bits_to_sha_hash(pubkey_to_bits(&key->params));
ret = 0;
break;