summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/dsa.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2000-05-08 17:42:24 +0000
committermarkus <markus@openbsd.org>2000-05-08 17:42:24 +0000
commit08a66c2e0dd4295c8a02698c6314acb13a4ae4ad (patch)
tree465aa7efd7e6a0e7ea2f9f717bc990d13e410644 /usr.bin/ssh/dsa.c
parentOne last nit fix. (markus approved) (diff)
downloadwireguard-openbsd-08a66c2e0dd4295c8a02698c6314acb13a4ae4ad.tar.xz
wireguard-openbsd-08a66c2e0dd4295c8a02698c6314acb13a4ae4ad.zip
bug compat w/ ssh-2.0.13 x11, split out bugs
Diffstat (limited to 'usr.bin/ssh/dsa.c')
-rw-r--r--usr.bin/ssh/dsa.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/usr.bin/ssh/dsa.c b/usr.bin/ssh/dsa.c
index 58059080939..51d7ff28524 100644
--- a/usr.bin/ssh/dsa.c
+++ b/usr.bin/ssh/dsa.c
@@ -28,7 +28,7 @@
*/
#include "includes.h"
-RCSID("$Id: dsa.c,v 1.6 2000/05/04 22:37:59 markus Exp $");
+RCSID("$Id: dsa.c,v 1.7 2000/05/08 17:42:24 markus Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -162,7 +162,7 @@ dsa_sign(
BN_bn2bin(sig->s, sigblob+ SIGBLOB_LEN - slen);
DSA_SIG_free(sig);
- if (datafellows) {
+ if (datafellows & SSH_BUG_SIGBLOB) {
debug("datafellows");
ret = xmalloc(SIGBLOB_LEN);
memcpy(ret, sigblob, SIGBLOB_LEN);
@@ -209,15 +209,20 @@ dsa_verify(
return -1;
}
- if (datafellows && signaturelen != SIGBLOB_LEN) {
- log("heh? datafellows ssh2 complies with ietf-drafts????");
- datafellows = 0;
+ if (!(datafellows & SSH_BUG_SIGBLOB) &&
+ signaturelen == SIGBLOB_LEN) {
+ datafellows |= ~SSH_BUG_SIGBLOB;
+ log("autodetect SSH_BUG_SIGBLOB");
+ } else if ((datafellows & SSH_BUG_SIGBLOB) &&
+ signaturelen != SIGBLOB_LEN) {
+ log("autoremove SSH_BUG_SIGBLOB");
+ datafellows &= ~SSH_BUG_SIGBLOB;
}
debug("len %d datafellows %d", signaturelen, datafellows);
/* fetch signature */
- if (datafellows) {
+ if (datafellows & SSH_BUG_SIGBLOB) {
sigblob = signature;
len = signaturelen;
} else {
@@ -242,7 +247,8 @@ dsa_verify(
sig->s = BN_new();
BN_bin2bn(sigblob, INTBLOB_LEN, sig->r);
BN_bin2bn(sigblob+ INTBLOB_LEN, INTBLOB_LEN, sig->s);
- if (!datafellows) {
+
+ if (!(datafellows & SSH_BUG_SIGBLOB)) {
memset(sigblob, 0, len);
xfree(sigblob);
}