Displaying 1 result from an estimated 1 matches for "rsa_sign_alg".
2024 Apr 11
0
[PATCH] sshsig: check hashalg before selecting the RSA signature algorithm
...hsig.c b/sshsig.c
index 470b286a3..033b43353 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -190,8 +190,14 @@ sshsig_wrap_sign(struct sshkey *key, const char *hashalg,
}
/* If using RSA keys then default to a good signature algorithm */
- if (sshkey_type_plain(key->type) == KEY_RSA)
- sign_alg = RSA_SIGN_ALG;
+ if (sshkey_type_plain(key->type) == KEY_RSA){
+ if (hashalg == NULL)
+ sign_alg = RSA_SIGN_ALG;
+ else if (strcmp(hashalg, "sha256") == 0)
+ sign_alg = "rsa-sha2-256";
+ else if (strcmp(hashalg, "sha512") == 0)
+ sign_alg = "rsa-sha2-512";
+ }...