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/ec/ec_pmeth.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/ec/ec_pmeth.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec_pmeth.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c index a52bff1f2f..08172fe0c6 100644 --- a/src/lib/libcrypto/ec/ec_pmeth.c +++ b/src/lib/libcrypto/ec/ec_pmeth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_pmeth.c,v 1.9 2015/06/20 14:19:39 jsing Exp $ */ | 1 | /* $OpenBSD: ec_pmeth.c,v 1.10 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 | */ |
@@ -132,7 +132,7 @@ pkey_ec_sign(EVP_PKEY_CTX * ctx, unsigned char *sig, size_t * siglen, | |||
132 | *siglen = ECDSA_size(ec); | 132 | *siglen = ECDSA_size(ec); |
133 | return 1; | 133 | return 1; |
134 | } else if (*siglen < (size_t) ECDSA_size(ec)) { | 134 | } else if (*siglen < (size_t) ECDSA_size(ec)) { |
135 | ECerr(EC_F_PKEY_EC_SIGN, EC_R_BUFFER_TOO_SMALL); | 135 | ECerror(EC_R_BUFFER_TOO_SMALL); |
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | if (dctx->md) | 138 | if (dctx->md) |
@@ -175,7 +175,7 @@ pkey_ec_derive(EVP_PKEY_CTX * ctx, unsigned char *key, size_t * keylen) | |||
175 | size_t outlen; | 175 | size_t outlen; |
176 | const EC_POINT *pubkey = NULL; | 176 | const EC_POINT *pubkey = NULL; |
177 | if (!ctx->pkey || !ctx->peerkey) { | 177 | if (!ctx->pkey || !ctx->peerkey) { |
178 | ECerr(EC_F_PKEY_EC_DERIVE, EC_R_KEYS_NOT_SET); | 178 | ECerror(EC_R_KEYS_NOT_SET); |
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | if (!key) { | 181 | if (!key) { |
@@ -209,7 +209,7 @@ pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2) | |||
209 | case EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID: | 209 | case EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID: |
210 | group = EC_GROUP_new_by_curve_name(p1); | 210 | group = EC_GROUP_new_by_curve_name(p1); |
211 | if (group == NULL) { | 211 | if (group == NULL) { |
212 | ECerr(EC_F_PKEY_EC_CTRL, EC_R_INVALID_CURVE); | 212 | ECerror(EC_R_INVALID_CURVE); |
213 | return 0; | 213 | return 0; |
214 | } | 214 | } |
215 | EC_GROUP_free(dctx->gen_group); | 215 | EC_GROUP_free(dctx->gen_group); |
@@ -223,7 +223,7 @@ pkey_ec_ctrl(EVP_PKEY_CTX * ctx, int type, int p1, void *p2) | |||
223 | EVP_MD_type((const EVP_MD *) p2) != NID_sha256 && | 223 | EVP_MD_type((const EVP_MD *) p2) != NID_sha256 && |
224 | EVP_MD_type((const EVP_MD *) p2) != NID_sha384 && | 224 | EVP_MD_type((const EVP_MD *) p2) != NID_sha384 && |
225 | EVP_MD_type((const EVP_MD *) p2) != NID_sha512) { | 225 | EVP_MD_type((const EVP_MD *) p2) != NID_sha512) { |
226 | ECerr(EC_F_PKEY_EC_CTRL, EC_R_INVALID_DIGEST_TYPE); | 226 | ECerror(EC_R_INVALID_DIGEST_TYPE); |
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | dctx->md = p2; | 229 | dctx->md = p2; |
@@ -254,7 +254,7 @@ pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx, | |||
254 | if (nid == NID_undef) | 254 | if (nid == NID_undef) |
255 | nid = OBJ_ln2nid(value); | 255 | nid = OBJ_ln2nid(value); |
256 | if (nid == NID_undef) { | 256 | if (nid == NID_undef) { |
257 | ECerr(EC_F_PKEY_EC_CTRL_STR, EC_R_INVALID_CURVE); | 257 | ECerror(EC_R_INVALID_CURVE); |
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid); | 260 | return EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid); |
@@ -269,7 +269,7 @@ pkey_ec_paramgen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey) | |||
269 | EC_PKEY_CTX *dctx = ctx->data; | 269 | EC_PKEY_CTX *dctx = ctx->data; |
270 | int ret = 0; | 270 | int ret = 0; |
271 | if (dctx->gen_group == NULL) { | 271 | if (dctx->gen_group == NULL) { |
272 | ECerr(EC_F_PKEY_EC_PARAMGEN, EC_R_NO_PARAMETERS_SET); | 272 | ECerror(EC_R_NO_PARAMETERS_SET); |
273 | return 0; | 273 | return 0; |
274 | } | 274 | } |
275 | ec = EC_KEY_new(); | 275 | ec = EC_KEY_new(); |
@@ -288,7 +288,7 @@ pkey_ec_keygen(EVP_PKEY_CTX * ctx, EVP_PKEY * pkey) | |||
288 | { | 288 | { |
289 | EC_KEY *ec = NULL; | 289 | EC_KEY *ec = NULL; |
290 | if (ctx->pkey == NULL) { | 290 | if (ctx->pkey == NULL) { |
291 | ECerr(EC_F_PKEY_EC_KEYGEN, EC_R_NO_PARAMETERS_SET); | 291 | ECerror(EC_R_NO_PARAMETERS_SET); |
292 | return 0; | 292 | return 0; |
293 | } | 293 | } |
294 | ec = EC_KEY_new(); | 294 | ec = EC_KEY_new(); |