diff options
author | Damien Miller <djm@mindrot.org> | 2000-04-12 20:17:38 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-04-12 20:17:38 +1000 |
commit | 78928793fb23a3a4c80ae62eca6a7826b2987690 (patch) | |
tree | add8a953ac4cf06877b91624fe7f647b17e6cf6f /dsa.c | |
parent | efb4afe0265333ce554f699c2a19ae249dd8d1b5 (diff) |
- OpenBSD CVS updates:
- [channels.c]
repair x11-fwd
- [sshconnect.c]
fix passwd prompt for ssh2, less debugging output.
- [clientloop.c compat.c dsa.c kex.c sshd.c]
less debugging output
- [kex.c kex.h sshconnect.c sshd.c]
check for reasonable public DH values
- [README.openssh2 cipher.c cipher.h compat.c compat.h readconf.c]
[readconf.h servconf.c servconf.h ssh.c ssh.h sshconnect.c sshd.c]
add Cipher and Protocol options to ssh/sshd, e.g.:
ssh -o 'Protocol 1,2' if you prefer proto 1, ssh -o 'Ciphers
arcfour,3des-cbc'
- [sshd.c]
print 1.99 only if server supports both
Diffstat (limited to 'dsa.c')
-rw-r--r-- | dsa.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "includes.h" | 30 | #include "includes.h" |
31 | RCSID("$Id: dsa.c,v 1.1 2000/04/04 04:39:01 damien Exp $"); | 31 | RCSID("$Id: dsa.c,v 1.2 2000/04/12 06:37:02 markus Exp $"); |
32 | 32 | ||
33 | #include "ssh.h" | 33 | #include "ssh.h" |
34 | #include "xmalloc.h" | 34 | #include "xmalloc.h" |
@@ -80,7 +80,7 @@ dsa_serverkey_from_blob( | |||
80 | buffer_append(&b, serverhostkey, serverhostkeylen); | 80 | buffer_append(&b, serverhostkey, serverhostkeylen); |
81 | ktype = buffer_get_string(&b, NULL); | 81 | ktype = buffer_get_string(&b, NULL); |
82 | if (strcmp(KEX_DSS, ktype) != 0) { | 82 | if (strcmp(KEX_DSS, ktype) != 0) { |
83 | log("dsa_serverkey_from_blob: cannot handle type %s", ktype); | 83 | error("dsa_serverkey_from_blob: cannot handle type %s", ktype); |
84 | key_free(key); | 84 | key_free(key); |
85 | return NULL; | 85 | return NULL; |
86 | } | 86 | } |
@@ -90,10 +90,10 @@ dsa_serverkey_from_blob( | |||
90 | buffer_get_bignum2(&b, dsa->pub_key); | 90 | buffer_get_bignum2(&b, dsa->pub_key); |
91 | rlen = buffer_len(&b); | 91 | rlen = buffer_len(&b); |
92 | if(rlen != 0) | 92 | if(rlen != 0) |
93 | log("dsa_serverkey_from_blob: remaining bytes in serverhostkey %d", rlen); | 93 | error("dsa_serverkey_from_blob: remaining bytes in serverhostkey %d", rlen); |
94 | buffer_free(&b); | 94 | buffer_free(&b); |
95 | 95 | ||
96 | log("keytype %s", ktype); | 96 | debug("keytype %s", ktype); |
97 | #ifdef DEBUG_DSS | 97 | #ifdef DEBUG_DSS |
98 | DSA_print_fp(stderr, dsa, 8); | 98 | DSA_print_fp(stderr, dsa, 8); |
99 | #endif | 99 | #endif |
@@ -172,7 +172,7 @@ dsa_sign( | |||
172 | Buffer b; | 172 | Buffer b; |
173 | 173 | ||
174 | if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) { | 174 | if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) { |
175 | log("dsa_sign: no DSA key"); | 175 | error("dsa_sign: no DSA key"); |
176 | return -1; | 176 | return -1; |
177 | } | 177 | } |
178 | digest = xmalloc(evp_md->md_size); | 178 | digest = xmalloc(evp_md->md_size); |
@@ -185,11 +185,11 @@ dsa_sign( | |||
185 | rlen = BN_num_bytes(sig->r); | 185 | rlen = BN_num_bytes(sig->r); |
186 | slen = BN_num_bytes(sig->s); | 186 | slen = BN_num_bytes(sig->s); |
187 | if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) { | 187 | if (rlen > INTBLOB_LEN || slen > INTBLOB_LEN) { |
188 | log("bad sig size %d %d", rlen, slen); | 188 | error("bad sig size %d %d", rlen, slen); |
189 | DSA_SIG_free(sig); | 189 | DSA_SIG_free(sig); |
190 | return -1; | 190 | return -1; |
191 | } | 191 | } |
192 | log("sig size %d %d", rlen, slen); | 192 | debug("sig size %d %d", rlen, slen); |
193 | 193 | ||
194 | memset(sigblob, 0, SIGBLOB_LEN); | 194 | memset(sigblob, 0, SIGBLOB_LEN); |
195 | BN_bn2bin(sig->r, sigblob+ SIGBLOB_LEN - INTBLOB_LEN - rlen); | 195 | BN_bn2bin(sig->r, sigblob+ SIGBLOB_LEN - INTBLOB_LEN - rlen); |
@@ -197,7 +197,7 @@ dsa_sign( | |||
197 | DSA_SIG_free(sig); | 197 | DSA_SIG_free(sig); |
198 | 198 | ||
199 | if (datafellows) { | 199 | if (datafellows) { |
200 | log("datafellows"); | 200 | debug("datafellows"); |
201 | ret = xmalloc(SIGBLOB_LEN); | 201 | ret = xmalloc(SIGBLOB_LEN); |
202 | memcpy(ret, sigblob, SIGBLOB_LEN); | 202 | memcpy(ret, sigblob, SIGBLOB_LEN); |
203 | if (lenp != NULL) | 203 | if (lenp != NULL) |
@@ -239,7 +239,7 @@ dsa_verify( | |||
239 | int ret; | 239 | int ret; |
240 | 240 | ||
241 | if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) { | 241 | if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) { |
242 | log("dsa_verify: no DSA key"); | 242 | error("dsa_verify: no DSA key"); |
243 | return -1; | 243 | return -1; |
244 | } | 244 | } |
245 | 245 | ||
@@ -248,7 +248,7 @@ dsa_verify( | |||
248 | datafellows = 0; | 248 | datafellows = 0; |
249 | } | 249 | } |
250 | 250 | ||
251 | log("len %d datafellows %d", signaturelen, datafellows); | 251 | debug("len %d datafellows %d", signaturelen, datafellows); |
252 | 252 | ||
253 | /* fetch signature */ | 253 | /* fetch signature */ |
254 | if (datafellows) { | 254 | if (datafellows) { |
@@ -262,7 +262,7 @@ dsa_verify( | |||
262 | sigblob = (unsigned char *)buffer_get_string(&b, &len); | 262 | sigblob = (unsigned char *)buffer_get_string(&b, &len); |
263 | rlen = buffer_len(&b); | 263 | rlen = buffer_len(&b); |
264 | if(rlen != 0) | 264 | if(rlen != 0) |
265 | log("remaining bytes in signature %d", rlen); | 265 | error("remaining bytes in signature %d", rlen); |
266 | buffer_free(&b); | 266 | buffer_free(&b); |
267 | } | 267 | } |
268 | 268 | ||
@@ -305,6 +305,6 @@ dsa_verify( | |||
305 | txt = "error"; | 305 | txt = "error"; |
306 | break; | 306 | break; |
307 | } | 307 | } |
308 | log("dsa_verify: signature %s", txt); | 308 | debug("dsa_verify: signature %s", txt); |
309 | return ret; | 309 | return ret; |
310 | } | 310 | } |