summaryrefslogtreecommitdiffstats
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 c1c37bce..5ce7abf7 100644
--- a/dsa.c
+++ b/dsa.c
@@ -28,7 +28,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: dsa.c,v 1.9 2000/06/20 01:39:41 markus Exp $");
+RCSID("$OpenBSD: dsa.c,v 1.10 2000/07/20 00:33:12 markus Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -53,8 +53,7 @@ RCSID("$OpenBSD: dsa.c,v 1.9 2000/06/20 01:39:41 markus Exp $");
#define SIGBLOB_LEN (2*INTBLOB_LEN)
Key *
-dsa_key_from_blob(
- char *blob, int blen)
+dsa_key_from_blob(char *blob, int blen)
{
Buffer b;
char *ktype;
@@ -66,16 +65,17 @@ dsa_key_from_blob(
dump_base64(stderr, blob, blen);
#endif
/* fetch & parse DSA/DSS pubkey */
- key = key_new(KEY_DSA);
- dsa = key->dsa;
buffer_init(&b);
buffer_append(&b, blob, blen);
ktype = buffer_get_string(&b, NULL);
if (strcmp(KEX_DSS, ktype) != 0) {
error("dsa_key_from_blob: cannot handle type %s", ktype);
- key_free(key);
+ buffer_free(&b);
+ xfree(ktype);
return NULL;
}
+ key = key_new(KEY_DSA);
+ dsa = key->dsa;
buffer_get_bignum2(&b, dsa->p);
buffer_get_bignum2(&b, dsa->q);
buffer_get_bignum2(&b, dsa->g);
@@ -84,8 +84,8 @@ dsa_key_from_blob(
if(rlen != 0)
error("dsa_key_from_blob: remaining bytes in key blob %d", rlen);
buffer_free(&b);
+ xfree(ktype);
- debug("keytype %s", ktype);
#ifdef DEBUG_DSS
DSA_print_fp(stderr, dsa, 8);
#endif