summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2017-03-15 15:42:28 +0800
committerPeter Jones <pjones@redhat.com>2017-03-24 18:28:30 -0400
commitf48505bfb2b479694c01f7c56bd3548dfe243f46 (patch)
tree847f1a623556f73c602628a9e5e8d5d590e9fc99 /Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c
parent832152986545e8fc66f1ed5cf9d8bf518c7df2b3 (diff)
downloadefi-boot-shim-f48505bfb2b479694c01f7c56bd3548dfe243f46.tar.gz
efi-boot-shim-f48505bfb2b479694c01f7c56bd3548dfe243f46.zip
Update to openssl 1.0.2k
Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c b/Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c
index a8b7f2f6..727869e3 100644
--- a/Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c
+++ b/Cryptlib/OpenSSL/crypto/evp/pmeth_fn.c
@@ -65,20 +65,22 @@
#include "evp_locl.h"
#define M_check_autoarg(ctx, arg, arglen, err) \
- if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) \
- { \
- size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \
- if (!arg) \
- { \
- *arglen = pksize; \
- return 1; \
- } \
- else if (*arglen < pksize) \
- { \
- EVPerr(err, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/\
- return 0; \
- } \
- }
+ if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) { \
+ size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \
+ \
+ if (pksize == 0) { \
+ EVPerr(err, EVP_R_INVALID_KEY); /*ckerr_ignore*/ \
+ return 0; \
+ } \
+ if (!arg) { \
+ *arglen = pksize; \
+ return 1; \
+ } \
+ if (*arglen < pksize) { \
+ EVPerr(err, EVP_R_BUFFER_TOO_SMALL); /*ckerr_ignore*/ \
+ return 0; \
+ } \
+ }
int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx)
{