summaryrefslogtreecommitdiff
path: root/ssh-rsa.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-29 00:32:56 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-29 00:32:56 +0000
commit60a4381f1a6ebc2f8eeeb2ba4e005ede91ac9af3 (patch)
treea58d24db658ee1036fc09a1363c27b1d2df386e3 /ssh-rsa.c
parent425fb02f20671c332af7b718d1c0e797ad0699eb (diff)
- markus@cvs.openbsd.org 2001/03/27 10:57:00
[compat.c compat.h ssh-rsa.c] some older systems use NID_md5 instead of NID_sha1 for RSASSA-PKCS1-v1_5 signatures in SSH protocol 2, ok djm@
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 a2153bd1..b502ddb6 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: ssh-rsa.c,v 1.7 2001/03/27 10:34:08 markus Exp $");
+RCSID("$OpenBSD: ssh-rsa.c,v 1.8 2001/03/27 10:57:00 markus Exp $");
#include <openssl/evp.h>
#include <openssl/err.h>
@@ -34,6 +34,7 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.7 2001/03/27 10:34:08 markus Exp $");
#include "bufaux.h"
#include "key.h"
#include "ssh-rsa.h"
+#include "compat.h"
/* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */
int
@@ -53,7 +54,7 @@ ssh_rsa_sign(
error("ssh_rsa_sign: no RSA key");
return -1;
}
- nid = NID_sha1;
+ nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1;
if ((evp_md = EVP_get_digestbynid(nid)) == NULL) {
error("ssh_rsa_sign: EVP_get_digestbynid %d failed", nid);
return -1;
@@ -147,7 +148,7 @@ ssh_rsa_verify(
error("ssh_rsa_verify: remaining bytes in signature %d", rlen);
return -1;
}
- nid = NID_sha1;
+ nid = (datafellows & SSH_BUG_RSASIGMD5) ? NID_md5 : NID_sha1;
if ((evp_md = EVP_get_digestbynid(nid)) == NULL) {
xfree(sigblob);
error("ssh_rsa_verify: EVP_get_digestbynid %d failed", nid);