diff options
Diffstat (limited to 'auth-skey.c')
-rw-r--r-- | auth-skey.c | 9 |
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 | ||