Index: auth2-jpake.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/auth2-jpake.c,v
retrieving revision 1.3
diff -N -u -p -p auth2-jpake.c
--- auth2-jpake.c 5 Mar 2009 07:18:19 -0000 1.3
+++ auth2-jpake.c 1 Oct 2009 11:18:07 -0000
@@ -58,6 +58,8 @@
#include "schnorr.h"
#include "jpake.h"
+extern const EVP_MD *evp_ssh_sha256(void);
+
/*
* XXX options->permit_empty_passwd (at the moment, they will be refused
* anyway because they will mismatch on fake salt.
@@ -165,7 +167,7 @@ derive_rawsalt(const char *username, u_char *rawsalt,
default:
fatal("%s: unknown key type %d", __func__, k->type);
}
- if (hash_buffer(buffer_ptr(&b), buffer_len(&b), EVP_sha256(),
+ if (hash_buffer(buffer_ptr(&b), buffer_len(&b), evp_ssh_sha256(),
&digest, &digest_len) != 0)
fatal("%s: hash_buffer", __func__);
buffer_free(&b);
@@ -344,7 +346,7 @@ auth2_jpake_get_pwdata(Authctxt *authctxt, BIGNUM **s,
fake_salt_and_scheme(authctxt, salt, hash_scheme);
if (hash_buffer(authctxt->pw->pw_passwd,
- strlen(authctxt->pw->pw_passwd), EVP_sha256(),
+ strlen(authctxt->pw->pw_passwd), evp_ssh_sha256(),
&secret, &secret_len) != 0)
fatal("%s: hash_buffer", __func__);
if ((*s = BN_bin2bn(secret, secret_len, NULL)) == NULL)
Index: jpake.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/jpake.c,v
retrieving revision 1.2
diff -N -u -p -p jpake.c
--- jpake.c 5 Mar 2009 07:18:19 -0000 1.2
+++ jpake.c 1 Oct 2009 11:18:07 -0000
@@ -49,6 +49,8 @@
#ifdef JPAKE
+extern const EVP_MD *evp_ssh_sha256(void);
+
/* RFC3526 group 5, 1536 bits */
#define JPAKE_GROUP_G "2"
#define JPAKE_GROUP_P \
@@ -331,7 +333,7 @@ jpake_confirm_hash(const BIGNUM *k,
buffer_put_bignum2(&b, k);
buffer_put_string(&b, endpoint_id, endpoint_id_len);
buffer_put_string(&b, sess_id, sess_id_len);
- if (hash_buffer(buffer_ptr(&b), buffer_len(&b), EVP_sha256(),
+ if (hash_buffer(buffer_ptr(&b), buffer_len(&b), evp_ssh_sha256(),
confirm_hash, confirm_hash_len) != 0)
fatal("%s: hash_buffer", __func__);
buffer_free(&b);
Index: kex.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/kex.c,v
retrieving revision 1.81
diff -N -u -p -p kex.c
--- kex.c 27 May 2009 06:34:36 -0000 1.81
+++ kex.c 1 Oct 2009 11:18:08 -0000
@@ -49,6 +49,7 @@
/* prototype */
static void kex_kexinit_finish(Kex *);
static void kex_choose_conf(Kex *);
+extern const EVP_MD *evp_ssh_sha256(void);
/* put algorithm proposal into buffer */
static void
@@ -311,7 +312,7 @@ choose_kex(Kex *k, char *client, char *server)
k->evp_md = EVP_sha1();
} else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) {
k->kex_type = KEX_DH_GEX_SHA256;
- k->evp_md = EVP_sha256();
+ k->evp_md = evp_ssh_sha256();
} else
fatal("bad kex alg %s", k->name);
}
? md-sha256.c
Index: schnorr.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/schnorr.c,v
retrieving revision 1.3
diff -N -u -p -p schnorr.c
--- schnorr.c 5 Mar 2009 07:18:19 -0000 1.3
+++ schnorr.c 1 Oct 2009 11:18:08 -0000
@@ -51,6 +51,8 @@
# define SCHNORR_DEBUG_BUF(a) debug3_buf a
#endif /* SCHNORR_DEBUG */
+extern const EVP_MD *evp_ssh_sha256(void);
+
/*
* Calculate hash component of Schnorr signature H(g || g^v || g^x || id)
* using the hash function defined by "evp_md". Returns signature as
@@ -215,7 +217,7 @@ schnorr_sign_buf(const BIGNUM *grp_p, const BIGNUM *gr
Buffer b;
BIGNUM *r, *e;
- if (schnorr_sign(grp_p, grp_q, grp_g, EVP_sha256(),
+ if (schnorr_sign(grp_p, grp_q, grp_g, evp_ssh_sha256(),
x, g_x, id, idlen, &r, &e) != 0)
return -1;
@@ -355,7 +357,7 @@ schnorr_verify_buf(const BIGNUM *grp_p, const BIGNUM *
goto out;
}
- ret = schnorr_verify(grp_p, grp_q, grp_g, EVP_sha256(),
+ ret = schnorr_verify(grp_p, grp_q, grp_g, evp_ssh_sha256(),
g_x, id, idlen, r, e);
out:
BN_clear_free(e);
Index: sshconnect2.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/sshconnect2.c,v
retrieving revision 1.171
diff -N -u -p -p sshconnect2.c
--- sshconnect2.c 5 Mar 2009 07:18:19 -0000 1.171
+++ sshconnect2.c 1 Oct 2009 11:18:08 -0000
@@ -73,6 +73,7 @@
extern char *client_version_string;
extern char *server_version_string;
extern Options options;
+extern const EVP_MD *evp_ssh_sha256(void);
/*
* SSH2 key exchange
@@ -912,7 +913,7 @@ jpake_password_to_secret(Authctxt *authctxt, const cha
debug3("%s: crypted = %s", __func__, crypted);
#endif
- if (hash_buffer(crypted, strlen(crypted), EVP_sha256(),
+ if (hash_buffer(crypted, strlen(crypted), evp_ssh_sha256(),
&secret, &secret_len) != 0)
fatal("%s: hash_buffer", __func__);
Index: lib/Makefile
===================================================================
RCS file: /cvs/src/usr.bin/ssh/lib/Makefile,v
retrieving revision 1.58
diff -N -u -p -p lib/Makefile
--- lib/Makefile 4 Nov 2008 08:22:13 -0000 1.58
+++ lib/Makefile 1 Oct 2009 11:18:08 -0000
@@ -12,7 +12,7 @@ SRCS= authfd.c authfile.c bufaux.c bufbn.c buffer.c ca
key.c dispatch.c kex.c mac.c uidswap.c uuencode.c misc.c \
ssh-dss.c ssh-rsa.c dh.c kexdh.c kexgex.c \
kexdhc.c kexgexc.c scard.c msg.c progressmeter.c dns.c \
- monitor_fdpass.c umac.c addrmatch.c schnorr.c jpake.c
+ monitor_fdpass.c umac.c addrmatch.c schnorr.c jpake.c md-sha256.c
DEBUGLIBS= no
NOPROFILE= yes