summaryrefslogtreecommitdiff
path: root/ssh-rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-rsa.c')
-rw-r--r--ssh-rsa.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/ssh-rsa.c b/ssh-rsa.c
index eb422d07e..0e16ff85f 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -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"
17RCSID("$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");