summaryrefslogtreecommitdiff
path: root/dsa.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-07-21 10:19:44 +1000
committerDamien Miller <djm@mindrot.org>2000-07-21 10:19:44 +1000
commit994cf1426d176e2ee9ba310416544c325e04b155 (patch)
tree8e8978bcec4c8a2aa83533936f90e7c3070e9def /dsa.c
parent9dec7762798a4f9268e6033945c6dde44925d853 (diff)
- (djm) OpenBSD CVS updates:
- markus@cvs.openbsd.org 2000/07/16 02:27:22 [authfd.c authfd.h channels.c clientloop.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c] make ssh-add accept dsa keys (the agent does not) - djm@cvs.openbsd.org 2000/07/17 19:25:02 [sshd.c] Another closing of stdin; ok deraadt - markus@cvs.openbsd.org 2000/07/19 18:33:12 [dsa.c] missing free, reorder - markus@cvs.openbsd.org 2000/07/20 16:23:14 [ssh-keygen.1] document input and output files
Diffstat (limited to 'dsa.c')
-rw-r--r--dsa.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dsa.c b/dsa.c
index c1c37bceb..5ce7abf70 100644
--- a/dsa.c
+++ b/dsa.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$OpenBSD: dsa.c,v 1.9 2000/06/20 01:39:41 markus Exp $"); 31RCSID("$OpenBSD: dsa.c,v 1.10 2000/07/20 00:33:12 markus Exp $");
32 32
33#include "ssh.h" 33#include "ssh.h"
34#include "xmalloc.h" 34#include "xmalloc.h"
@@ -53,8 +53,7 @@ RCSID("$OpenBSD: dsa.c,v 1.9 2000/06/20 01:39:41 markus Exp $");
53#define SIGBLOB_LEN (2*INTBLOB_LEN) 53#define SIGBLOB_LEN (2*INTBLOB_LEN)
54 54
55Key * 55Key *
56dsa_key_from_blob( 56dsa_key_from_blob(char *blob, int blen)
57 char *blob, int blen)
58{ 57{
59 Buffer b; 58 Buffer b;
60 char *ktype; 59 char *ktype;
@@ -66,16 +65,17 @@ dsa_key_from_blob(
66 dump_base64(stderr, blob, blen); 65 dump_base64(stderr, blob, blen);
67#endif 66#endif
68 /* fetch & parse DSA/DSS pubkey */ 67 /* fetch & parse DSA/DSS pubkey */
69 key = key_new(KEY_DSA);
70 dsa = key->dsa;
71 buffer_init(&b); 68 buffer_init(&b);
72 buffer_append(&b, blob, blen); 69 buffer_append(&b, blob, blen);
73 ktype = buffer_get_string(&b, NULL); 70 ktype = buffer_get_string(&b, NULL);
74 if (strcmp(KEX_DSS, ktype) != 0) { 71 if (strcmp(KEX_DSS, ktype) != 0) {
75 error("dsa_key_from_blob: cannot handle type %s", ktype); 72 error("dsa_key_from_blob: cannot handle type %s", ktype);
76 key_free(key); 73 buffer_free(&b);
74 xfree(ktype);
77 return NULL; 75 return NULL;
78 } 76 }
77 key = key_new(KEY_DSA);
78 dsa = key->dsa;
79 buffer_get_bignum2(&b, dsa->p); 79 buffer_get_bignum2(&b, dsa->p);
80 buffer_get_bignum2(&b, dsa->q); 80 buffer_get_bignum2(&b, dsa->q);
81 buffer_get_bignum2(&b, dsa->g); 81 buffer_get_bignum2(&b, dsa->g);
@@ -84,8 +84,8 @@ dsa_key_from_blob(
84 if(rlen != 0) 84 if(rlen != 0)
85 error("dsa_key_from_blob: remaining bytes in key blob %d", rlen); 85 error("dsa_key_from_blob: remaining bytes in key blob %d", rlen);
86 buffer_free(&b); 86 buffer_free(&b);
87 xfree(ktype);
87 88
88 debug("keytype %s", ktype);
89#ifdef DEBUG_DSS 89#ifdef DEBUG_DSS
90 DSA_print_fp(stderr, dsa, 8); 90 DSA_print_fp(stderr, dsa, 8);
91#endif 91#endif