diff options
author | 2014-01-27 19:18:54 +0000 | |
---|---|---|
committer | 2014-01-27 19:18:54 +0000 | |
commit | 26b909bc6b335bc525b69f2ea4e4e4c3495c46cd (patch) | |
tree | 7a5da5fdd33172c2415f54df63f26f5cccc00217 /usr.bin/ssh/cipher.c | |
parent | replace openssl HMAC with an implementation based on our ssh_digest_* (diff) | |
download | wireguard-openbsd-26b909bc6b335bc525b69f2ea4e4e4c3495c46cd.tar.xz wireguard-openbsd-26b909bc6b335bc525b69f2ea4e4e4c3495c46cd.zip |
replace openssl MD5 with our ssh_digest_*; ok djm@
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r-- | usr.bin/ssh/cipher.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index 838b2a14963..4655623764b 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher.c,v 1.94 2014/01/25 10:12:50 dtucker Exp $ */ +/* $OpenBSD: cipher.c,v 1.95 2014/01/27 19:18:54 markus Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -37,8 +37,6 @@ #include <sys/types.h> -#include <openssl/md5.h> - #include <string.h> #include <stdarg.h> #include <stdio.h> @@ -47,6 +45,8 @@ #include "log.h" #include "misc.h" #include "cipher.h" +#include "buffer.h" +#include "digest.h" extern const EVP_CIPHER *evp_ssh1_bf(void); extern const EVP_CIPHER *evp_ssh1_3des(void); @@ -416,17 +416,15 @@ void cipher_set_key_string(CipherContext *cc, const Cipher *cipher, const char *passphrase, int do_encrypt) { - MD5_CTX md; u_char digest[16]; - MD5_Init(&md); - MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase)); - MD5_Final(digest, &md); + if (ssh_digest_memory(SSH_DIGEST_MD5, passphrase, strlen(passphrase), + digest, sizeof(digest)) < 0) + fatal("%s: md5 failed", __func__); cipher_init(cc, cipher, digest, 16, NULL, 0, do_encrypt); memset(digest, 0, sizeof(digest)); - memset(&md, 0, sizeof(md)); } /* |