summaryrefslogtreecommitdiff
path: root/ssh-ed25519.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-ed25519.c')
-rw-r--r--ssh-ed25519.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ssh-ed25519.c b/ssh-ed25519.c
index cb87d4790..b159ff5ee 100644
--- a/ssh-ed25519.c
+++ b/ssh-ed25519.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-ed25519.c,v 1.4 2014/06/24 01:13:21 djm Exp $ */ 1/* $OpenBSD: ssh-ed25519.c,v 1.6 2015/01/15 21:38:50 markus Exp $ */
2/* 2/*
3 * Copyright (c) 2013 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2013 Markus Friedl <markus@openbsd.org>
4 * 4 *
@@ -25,9 +25,8 @@
25#include <string.h> 25#include <string.h>
26#include <stdarg.h> 26#include <stdarg.h>
27 27
28#include "xmalloc.h"
29#include "log.h" 28#include "log.h"
30#include "buffer.h" 29#include "sshbuf.h"
31#define SSHKEY_INTERNAL 30#define SSHKEY_INTERNAL
32#include "sshkey.h" 31#include "sshkey.h"
33#include "ssherr.h" 32#include "ssherr.h"
@@ -128,11 +127,13 @@ ssh_ed25519_verify(const struct sshkey *key,
128 r = SSH_ERR_INVALID_FORMAT; 127 r = SSH_ERR_INVALID_FORMAT;
129 goto out; 128 goto out;
130 } 129 }
131 if (datalen >= SIZE_MAX - len) 130 if (datalen >= SIZE_MAX - len) {
132 return SSH_ERR_INVALID_ARGUMENT; 131 r = SSH_ERR_INVALID_ARGUMENT;
132 goto out;
133 }
133 smlen = len + datalen; 134 smlen = len + datalen;
134 mlen = smlen; 135 mlen = smlen;
135 if ((sm = malloc(smlen)) == NULL || (m = xmalloc(mlen)) == NULL) { 136 if ((sm = malloc(smlen)) == NULL || (m = malloc(mlen)) == NULL) {
136 r = SSH_ERR_ALLOC_FAIL; 137 r = SSH_ERR_ALLOC_FAIL;
137 goto out; 138 goto out;
138 } 139 }
@@ -163,4 +164,3 @@ ssh_ed25519_verify(const struct sshkey *key,
163 free(ktype); 164 free(ktype);
164 return r; 165 return r;
165} 166}
166