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 d66d84e7d..208d380bb 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 $");
4 4
5#include "ssh.h" 5#include "ssh.h"
6#include "packet.h" 6#include "packet.h"
7#include <sha1.h> 7#include <openssl/sha.h>
8 8
9/* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */ 9/* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */
10 10
@@ -74,7 +74,6 @@ skey_fake_keyinfo(char *username)
74 size_t secretlen = 0; 74 size_t secretlen = 0;
75 SHA_CTX ctx; 75 SHA_CTX ctx;
76 char *p, *u; 76 char *p, *u;
77 char md[SHA_DIGEST_LENGTH];
78 77
79 /* 78 /*
80 * Base first 4 chars of seed on hostname. 79 * Base first 4 chars of seed on hostname.
@@ -99,7 +98,7 @@ skey_fake_keyinfo(char *username)
99 98
100 SHA1_Init(&ctx); 99 SHA1_Init(&ctx);
101 SHA1_Update(&ctx, username, strlen(username)); 100 SHA1_Update(&ctx, username, strlen(username));
102 SHA1_End(&ctx, up); 101 SHA1_Final(up, &ctx);
103 102
104 /* Collapse the hash */ 103 /* Collapse the hash */
105 ptr = hash_collapse(up); 104 ptr = hash_collapse(up);
@@ -133,7 +132,7 @@ skey_fake_keyinfo(char *username)
133 SHA1_Init(&ctx); 132 SHA1_Init(&ctx);
134 SHA1_Update(&ctx, secret, secretlen); 133 SHA1_Update(&ctx, secret, secretlen);
135 SHA1_Update(&ctx, username, strlen(username)); 134 SHA1_Update(&ctx, username, strlen(username));
136 SHA1_End(&ctx, up); 135 SHA1_Final(up, &ctx);
137 136
138 /* Zero out */ 137 /* Zero out */
139 memset(secret, 0, secretlen); 138 memset(secret, 0, secretlen);
@@ -141,7 +140,7 @@ skey_fake_keyinfo(char *username)
141 /* Now hash the hash */ 140 /* Now hash the hash */
142 SHA1_Init(&ctx); 141 SHA1_Init(&ctx);
143 SHA1_Update(&ctx, up, strlen(up)); 142 SHA1_Update(&ctx, up, strlen(up));
144 SHA1_End(&ctx, up); 143 SHA1_Final(up, &ctx);
145 144
146 ptr = hash_collapse(up + 4); 145 ptr = hash_collapse(up + 4);
147 146