summaryrefslogtreecommitdiff
path: root/auth-skey.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-07-02 19:13:56 +1000
committerDamien Miller <djm@mindrot.org>2000-07-02 19:13:56 +1000
commit484118ea0f6871c2429c45f0736ba07b8289561d (patch)
tree8e0434ce196d095be196d54f7741871a9c54e777 /auth-skey.c
parentc708843e6a209b1c1f1a6d3e60b29be56d1d8894 (diff)
- (djm) Use standard OpenSSL functions in auth-skey.c. Patch from
Chris, the Young One <cky@pobox.com>
Diffstat (limited to 'auth-skey.c')
-rw-r--r--auth-skey.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/auth-skey.c b/auth-skey.c
index d66d84e7..208d380b 100644
--- a/auth-skey.c
+++ b/auth-skey.c
@@ -4,7 +4,7 @@ RCSID("$OpenBSD: auth-skey.c,v 1.7 2000/06/20 01:39:38 markus Exp $");
#include "ssh.h"
#include "packet.h"
-#include <sha1.h>
+#include <openssl/sha.h>
/* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */
@@ -74,7 +74,6 @@ skey_fake_keyinfo(char *username)
size_t secretlen = 0;
SHA_CTX ctx;
char *p, *u;
- char md[SHA_DIGEST_LENGTH];
/*
* Base first 4 chars of seed on hostname.
@@ -99,7 +98,7 @@ skey_fake_keyinfo(char *username)
SHA1_Init(&ctx);
SHA1_Update(&ctx, username, strlen(username));
- SHA1_End(&ctx, up);
+ SHA1_Final(up, &ctx);
/* Collapse the hash */
ptr = hash_collapse(up);
@@ -133,7 +132,7 @@ skey_fake_keyinfo(char *username)
SHA1_Init(&ctx);
SHA1_Update(&ctx, secret, secretlen);
SHA1_Update(&ctx, username, strlen(username));
- SHA1_End(&ctx, up);
+ SHA1_Final(up, &ctx);
/* Zero out */
memset(secret, 0, secretlen);
@@ -141,7 +140,7 @@ skey_fake_keyinfo(char *username)
/* Now hash the hash */
SHA1_Init(&ctx);
SHA1_Update(&ctx, up, strlen(up));
- SHA1_End(&ctx, up);
+ SHA1_Final(up, &ctx);
ptr = hash_collapse(up + 4);