diff options
author | Colin Watson <cjwatson@debian.org> | 2003-09-01 02:05:26 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-09-01 02:05:26 +0000 |
commit | 6d5a72bc1d98a42ba42f082e50a22e911c1d82d3 (patch) | |
tree | 1bf23174bdb6fc71e2846dda0eca195a418484e7 /ssh-dss.c | |
parent | 2ee26b431f98cf1dc0e4fb9809ad1e0c879b8c08 (diff) | |
parent | 58657d96514cd6f16d82add8d6f4adbb36765758 (diff) |
Debian release 3.5p1-1.
Diffstat (limited to 'ssh-dss.c')
-rw-r--r-- | ssh-dss.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | RCSID("$OpenBSD: ssh-dss.c,v 1.15 2002/06/23 03:30:17 deraadt Exp $"); | 26 | RCSID("$OpenBSD: ssh-dss.c,v 1.17 2002/07/04 10:41:47 markus Exp $"); |
27 | 27 | ||
28 | #include <openssl/bn.h> | 28 | #include <openssl/bn.h> |
29 | #include <openssl/evp.h> | 29 | #include <openssl/evp.h> |
@@ -46,7 +46,7 @@ ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp, | |||
46 | DSA_SIG *sig; | 46 | DSA_SIG *sig; |
47 | const EVP_MD *evp_md = EVP_sha1(); | 47 | const EVP_MD *evp_md = EVP_sha1(); |
48 | EVP_MD_CTX md; | 48 | EVP_MD_CTX md; |
49 | u_char *ret, digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN]; | 49 | u_char digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN]; |
50 | u_int rlen, slen, len, dlen; | 50 | u_int rlen, slen, len, dlen; |
51 | Buffer b; | 51 | Buffer b; |
52 | 52 | ||
@@ -79,25 +79,25 @@ ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp, | |||
79 | DSA_SIG_free(sig); | 79 | DSA_SIG_free(sig); |
80 | 80 | ||
81 | if (datafellows & SSH_BUG_SIGBLOB) { | 81 | if (datafellows & SSH_BUG_SIGBLOB) { |
82 | ret = xmalloc(SIGBLOB_LEN); | ||
83 | memcpy(ret, sigblob, SIGBLOB_LEN); | ||
84 | if (lenp != NULL) | 82 | if (lenp != NULL) |
85 | *lenp = SIGBLOB_LEN; | 83 | *lenp = SIGBLOB_LEN; |
86 | if (sigp != NULL) | 84 | if (sigp != NULL) { |
87 | *sigp = ret; | 85 | *sigp = xmalloc(SIGBLOB_LEN); |
86 | memcpy(*sigp, sigblob, SIGBLOB_LEN); | ||
87 | } | ||
88 | } else { | 88 | } else { |
89 | /* ietf-drafts */ | 89 | /* ietf-drafts */ |
90 | buffer_init(&b); | 90 | buffer_init(&b); |
91 | buffer_put_cstring(&b, "ssh-dss"); | 91 | buffer_put_cstring(&b, "ssh-dss"); |
92 | buffer_put_string(&b, sigblob, SIGBLOB_LEN); | 92 | buffer_put_string(&b, sigblob, SIGBLOB_LEN); |
93 | len = buffer_len(&b); | 93 | len = buffer_len(&b); |
94 | ret = xmalloc(len); | ||
95 | memcpy(ret, buffer_ptr(&b), len); | ||
96 | buffer_free(&b); | ||
97 | if (lenp != NULL) | 94 | if (lenp != NULL) |
98 | *lenp = len; | 95 | *lenp = len; |
99 | if (sigp != NULL) | 96 | if (sigp != NULL) { |
100 | *sigp = ret; | 97 | *sigp = xmalloc(len); |
98 | memcpy(*sigp, buffer_ptr(&b), len); | ||
99 | } | ||
100 | buffer_free(&b); | ||
101 | } | 101 | } |
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |