diff options
author | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:38:40 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:38:40 +0000 |
commit | 1b816ea846aca3ee89e7995373ace609e9518424 (patch) | |
tree | b41cdc8495cae7fa9c2e0f98a5f2e71656b61f9a /ssh-rsa.c | |
parent | fa585019a79ebcb4e0202b1c33f87ff1c5c9ce1c (diff) | |
parent | 086ea76990b1e6287c24b6db74adffd4605eb3b0 (diff) |
import openssh-4.6p1-gsskex-20070312.patch
Diffstat (limited to 'ssh-rsa.c')
-rw-r--r-- | ssh-rsa.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-rsa.c,v 1.39 2006/08/03 03:34:42 deraadt Exp $ */ | ||
1 | /* | 2 | /* |
2 | * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> | 3 | * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> |
3 | * | 4 | * |
@@ -13,16 +14,20 @@ | |||
13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
15 | */ | 16 | */ |
17 | |||
16 | #include "includes.h" | 18 | #include "includes.h" |
17 | RCSID("$OpenBSD: ssh-rsa.c,v 1.32 2005/06/17 02:44:33 djm Exp $"); | 19 | |
20 | #include <sys/types.h> | ||
18 | 21 | ||
19 | #include <openssl/evp.h> | 22 | #include <openssl/evp.h> |
20 | #include <openssl/err.h> | 23 | #include <openssl/err.h> |
21 | 24 | ||
25 | #include <stdarg.h> | ||
26 | #include <string.h> | ||
27 | |||
22 | #include "xmalloc.h" | 28 | #include "xmalloc.h" |
23 | #include "log.h" | 29 | #include "log.h" |
24 | #include "buffer.h" | 30 | #include "buffer.h" |
25 | #include "bufaux.h" | ||
26 | #include "key.h" | 31 | #include "key.h" |
27 | #include "compat.h" | 32 | #include "compat.h" |
28 | #include "ssh.h" | 33 | #include "ssh.h" |
@@ -62,6 +67,7 @@ ssh_rsa_sign(const Key *key, u_char **sigp, u_int *lenp, | |||
62 | 67 | ||
63 | if (ok != 1) { | 68 | if (ok != 1) { |
64 | int ecode = ERR_get_error(); | 69 | int ecode = ERR_get_error(); |
70 | |||
65 | error("ssh_rsa_sign: RSA_sign failed: %s", | 71 | error("ssh_rsa_sign: RSA_sign failed: %s", |
66 | ERR_error_string(ecode, NULL)); | 72 | ERR_error_string(ecode, NULL)); |
67 | xfree(sig); | 73 | xfree(sig); |
@@ -144,7 +150,7 @@ ssh_rsa_verify(const Key *key, const u_char *signature, u_int signaturelen, | |||
144 | u_int diff = modlen - len; | 150 | u_int diff = modlen - len; |
145 | debug("ssh_rsa_verify: add padding: modlen %u > len %u", | 151 | debug("ssh_rsa_verify: add padding: modlen %u > len %u", |
146 | modlen, len); | 152 | modlen, len); |
147 | sigblob = xrealloc(sigblob, modlen); | 153 | sigblob = xrealloc(sigblob, 1, modlen); |
148 | memmove(sigblob + diff, sigblob, len); | 154 | memmove(sigblob + diff, sigblob, len); |
149 | memset(sigblob, 0, diff); | 155 | memset(sigblob, 0, diff); |
150 | len = modlen; | 156 | len = modlen; |
@@ -220,7 +226,6 @@ openssh_RSA_verify(int type, u_char *hash, u_int hashlen, | |||
220 | break; | 226 | break; |
221 | default: | 227 | default: |
222 | goto done; | 228 | goto done; |
223 | break; | ||
224 | } | 229 | } |
225 | if (hashlen != hlen) { | 230 | if (hashlen != hlen) { |
226 | error("bad hashlen"); | 231 | error("bad hashlen"); |