diff options
author | beck <> | 2017-01-29 17:49:23 +0000 |
---|---|---|
committer | beck <> | 2017-01-29 17:49:23 +0000 |
commit | 957b11334a7afb14537322f0e4795b2e368b3f59 (patch) | |
tree | 1a54abba678898ee5270ae4f3404a50ee9a92eea /src/lib/libcrypto/evp/pmeth_gn.c | |
parent | df96e020e729c6c37a8c7fe311fdd1fe6a8718c5 (diff) | |
download | openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.gz openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.tar.bz2 openbsd-957b11334a7afb14537322f0e4795b2e368b3f59.zip |
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@
Diffstat (limited to 'src/lib/libcrypto/evp/pmeth_gn.c')
-rw-r--r-- | src/lib/libcrypto/evp/pmeth_gn.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lib/libcrypto/evp/pmeth_gn.c b/src/lib/libcrypto/evp/pmeth_gn.c index 29f533625a..d1cbdc409f 100644 --- a/src/lib/libcrypto/evp/pmeth_gn.c +++ b/src/lib/libcrypto/evp/pmeth_gn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pmeth_gn.c,v 1.5 2014/07/12 16:03:37 miod Exp $ */ | 1 | /* $OpenBSD: pmeth_gn.c,v 1.6 2017/01/29 17:49:23 beck Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -72,8 +72,7 @@ EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) | |||
72 | int ret; | 72 | int ret; |
73 | 73 | ||
74 | if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { | 74 | if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { |
75 | EVPerr(EVP_F_EVP_PKEY_PARAMGEN_INIT, | 75 | EVPerror(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
76 | EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | ||
77 | return -2; | 76 | return -2; |
78 | } | 77 | } |
79 | ctx->operation = EVP_PKEY_OP_PARAMGEN; | 78 | ctx->operation = EVP_PKEY_OP_PARAMGEN; |
@@ -91,13 +90,12 @@ EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) | |||
91 | int ret; | 90 | int ret; |
92 | 91 | ||
93 | if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { | 92 | if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { |
94 | EVPerr(EVP_F_EVP_PKEY_PARAMGEN, | 93 | EVPerror(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
95 | EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | ||
96 | return -2; | 94 | return -2; |
97 | } | 95 | } |
98 | 96 | ||
99 | if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { | 97 | if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { |
100 | EVPerr(EVP_F_EVP_PKEY_PARAMGEN, EVP_R_OPERATON_NOT_INITIALIZED); | 98 | EVPerror(EVP_R_OPERATON_NOT_INITIALIZED); |
101 | return -1; | 99 | return -1; |
102 | } | 100 | } |
103 | 101 | ||
@@ -121,8 +119,7 @@ EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) | |||
121 | int ret; | 119 | int ret; |
122 | 120 | ||
123 | if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { | 121 | if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { |
124 | EVPerr(EVP_F_EVP_PKEY_KEYGEN_INIT, | 122 | EVPerror(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
125 | EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | ||
126 | return -2; | 123 | return -2; |
127 | } | 124 | } |
128 | ctx->operation = EVP_PKEY_OP_KEYGEN; | 125 | ctx->operation = EVP_PKEY_OP_KEYGEN; |
@@ -140,12 +137,11 @@ EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) | |||
140 | int ret; | 137 | int ret; |
141 | 138 | ||
142 | if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { | 139 | if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { |
143 | EVPerr(EVP_F_EVP_PKEY_KEYGEN, | 140 | EVPerror(EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); |
144 | EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); | ||
145 | return -2; | 141 | return -2; |
146 | } | 142 | } |
147 | if (ctx->operation != EVP_PKEY_OP_KEYGEN) { | 143 | if (ctx->operation != EVP_PKEY_OP_KEYGEN) { |
148 | EVPerr(EVP_F_EVP_PKEY_KEYGEN, EVP_R_OPERATON_NOT_INITIALIZED); | 144 | EVPerror(EVP_R_OPERATON_NOT_INITIALIZED); |
149 | return -1; | 145 | return -1; |
150 | } | 146 | } |
151 | 147 | ||