diff options
Diffstat (limited to 'ssh-rsa.c')
-rw-r--r-- | ssh-rsa.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: ssh-rsa.c,v 1.7 2001/03/27 10:34:08 markus Exp $"); | 26 | RCSID("$OpenBSD: ssh-rsa.c,v 1.8 2001/03/27 10:57:00 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/evp.h> | 28 | #include <openssl/evp.h> |
29 | #include <openssl/err.h> | 29 | #include <openssl/err.h> |
@@ -34,6 +34,7 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.7 2001/03/27 10:34:08 markus Exp $"); | |||
34 | #include "bufaux.h" | 34 | #include "bufaux.h" |
35 | #include "key.h" | 35 | #include "key.h" |
36 | #include "ssh-rsa.h" | 36 | #include "ssh-rsa.h" |
37 | #include "compat.h" | ||
37 | 38 | ||
38 | /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */ | 39 | /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */ |
39 | int | 40 | int |
@@ -53,7 +54,7 @@ ssh_rsa_sign( | |||
53 | error("ssh_rsa_sign: no RSA key"); | 54 | error("ssh_rsa_sign: no RSA key"); |
54 | return -1; | 55 | return -1; |
55 | } | 56 | } |
56 | nid = NID_sha1; | 57 | nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1; |
57 | if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { | 58 | if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { |
58 | error("ssh_rsa_sign: EVP_get_digestbynid %d failed", nid); | 59 | error("ssh_rsa_sign: EVP_get_digestbynid %d failed", nid); |
59 | return -1; | 60 | return -1; |
@@ -147,7 +148,7 @@ ssh_rsa_verify( | |||
147 | error("ssh_rsa_verify: remaining bytes in signature %d", rlen); | 148 | error("ssh_rsa_verify: remaining bytes in signature %d", rlen); |
148 | return -1; | 149 | return -1; |
149 | } | 150 | } |
150 | nid = NID_sha1; | 151 | nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1; |
151 | if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { | 152 | if ((evp_md = EVP_get_digestbynid(nid)) == NULL) { |
152 | xfree(sigblob); | 153 | xfree(sigblob); |
153 | error("ssh_rsa_verify: EVP_get_digestbynid %d failed", nid); | 154 | error("ssh_rsa_verify: EVP_get_digestbynid %d failed", nid); |