summaryrefslogtreecommitdiff
path: root/ssh-rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-rsa.c')
-rw-r--r--ssh-rsa.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ssh-rsa.c b/ssh-rsa.c
index a2153bd1a..b502ddb6e 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: ssh-rsa.c,v 1.7 2001/03/27 10:34:08 markus Exp $"); 26RCSID("$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 */
39int 40int
@@ -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);