diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ec/ec.h | 28 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ec_lib.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_mont.c | 1 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ectest.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/ecdh/Makefile | 17 |
5 files changed, 30 insertions, 28 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h index 9d01325af3..dfe8710d33 100644 --- a/src/lib/libcrypto/ec/ec.h +++ b/src/lib/libcrypto/ec/ec.h | |||
| @@ -274,10 +274,10 @@ int EC_GROUP_get_curve_name(const EC_GROUP *group); | |||
| 274 | void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); | 274 | void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); |
| 275 | int EC_GROUP_get_asn1_flag(const EC_GROUP *group); | 275 | int EC_GROUP_get_asn1_flag(const EC_GROUP *group); |
| 276 | 276 | ||
| 277 | void EC_GROUP_set_point_conversion_form(EC_GROUP *, point_conversion_form_t); | 277 | void EC_GROUP_set_point_conversion_form(EC_GROUP *group, point_conversion_form_t form); |
| 278 | point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); | 278 | point_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *); |
| 279 | 279 | ||
| 280 | unsigned char *EC_GROUP_get0_seed(const EC_GROUP *); | 280 | unsigned char *EC_GROUP_get0_seed(const EC_GROUP *x); |
| 281 | size_t EC_GROUP_get_seed_len(const EC_GROUP *); | 281 | size_t EC_GROUP_get_seed_len(const EC_GROUP *); |
| 282 | size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); | 282 | size_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len); |
| 283 | 283 | ||
| @@ -626,8 +626,8 @@ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *c | |||
| 626 | */ | 626 | */ |
| 627 | int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); | 627 | int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); |
| 628 | 628 | ||
| 629 | int EC_POINT_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); | 629 | int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx); |
| 630 | int EC_POINTs_make_affine(const EC_GROUP *, size_t num, EC_POINT *[], BN_CTX *); | 630 | int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx); |
| 631 | 631 | ||
| 632 | /** Computes r = generator * n sum_{i=0}^num p[i] * m[i] | 632 | /** Computes r = generator * n sum_{i=0}^num p[i] * m[i] |
| 633 | * \param group underlying EC_GROUP object | 633 | * \param group underlying EC_GROUP object |
| @@ -800,16 +800,24 @@ const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key); | |||
| 800 | int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); | 800 | int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); |
| 801 | 801 | ||
| 802 | unsigned EC_KEY_get_enc_flags(const EC_KEY *key); | 802 | unsigned EC_KEY_get_enc_flags(const EC_KEY *key); |
| 803 | void EC_KEY_set_enc_flags(EC_KEY *, unsigned int); | 803 | void EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags); |
| 804 | point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *); | 804 | point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); |
| 805 | void EC_KEY_set_conv_form(EC_KEY *, point_conversion_form_t); | 805 | void EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform); |
| 806 | /* functions to set/get method specific data */ | 806 | /* functions to set/get method specific data */ |
| 807 | void *EC_KEY_get_key_method_data(EC_KEY *, | 807 | void *EC_KEY_get_key_method_data(EC_KEY *key, |
| 808 | void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); | 808 | void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); |
| 809 | void EC_KEY_insert_key_method_data(EC_KEY *, void *data, | 809 | /** Sets the key method data of an EC_KEY object, if none has yet been set. |
| 810 | * \param key EC_KEY object | ||
| 811 | * \param data opaque data to install. | ||
| 812 | * \param dup_func a function that duplicates |data|. | ||
| 813 | * \param free_func a function that frees |data|. | ||
| 814 | * \param clear_free_func a function that wipes and frees |data|. | ||
| 815 | * \return the previously set data pointer, or NULL if |data| was inserted. | ||
| 816 | */ | ||
| 817 | void *EC_KEY_insert_key_method_data(EC_KEY *key, void *data, | ||
| 810 | void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); | 818 | void *(*dup_func)(void *), void (*free_func)(void *), void (*clear_free_func)(void *)); |
| 811 | /* wrapper functions for the underlying EC_GROUP object */ | 819 | /* wrapper functions for the underlying EC_GROUP object */ |
| 812 | void EC_KEY_set_asn1_flag(EC_KEY *, int); | 820 | void EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag); |
| 813 | 821 | ||
| 814 | /** Creates a table of pre-computed multiples of the generator to | 822 | /** Creates a table of pre-computed multiples of the generator to |
| 815 | * accelerate further EC_KEY operations. | 823 | * accelerate further EC_KEY operations. |
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 25247b5803..de9a0cc2b3 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c | |||
| @@ -480,10 +480,10 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx) | |||
| 480 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) != | 480 | if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) != |
| 481 | EC_METHOD_get_field_type(EC_GROUP_method_of(b))) | 481 | EC_METHOD_get_field_type(EC_GROUP_method_of(b))) |
| 482 | return 1; | 482 | return 1; |
| 483 | /* compare the curve name (if present) */ | 483 | /* compare the curve name (if present in both) */ |
| 484 | if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) && | 484 | if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) && |
| 485 | EC_GROUP_get_curve_name(a) == EC_GROUP_get_curve_name(b)) | 485 | EC_GROUP_get_curve_name(a) != EC_GROUP_get_curve_name(b)) |
| 486 | return 0; | 486 | return 1; |
| 487 | 487 | ||
| 488 | if (!ctx) | 488 | if (!ctx) |
| 489 | ctx_new = ctx = BN_CTX_new(); | 489 | ctx_new = ctx = BN_CTX_new(); |
| @@ -993,12 +993,12 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN | |||
| 993 | if (group->meth->point_cmp == 0) | 993 | if (group->meth->point_cmp == 0) |
| 994 | { | 994 | { |
| 995 | ECerr(EC_F_EC_POINT_CMP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | 995 | ECerr(EC_F_EC_POINT_CMP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); |
| 996 | return 0; | 996 | return -1; |
| 997 | } | 997 | } |
| 998 | if ((group->meth != a->meth) || (a->meth != b->meth)) | 998 | if ((group->meth != a->meth) || (a->meth != b->meth)) |
| 999 | { | 999 | { |
| 1000 | ECerr(EC_F_EC_POINT_CMP, EC_R_INCOMPATIBLE_OBJECTS); | 1000 | ECerr(EC_F_EC_POINT_CMP, EC_R_INCOMPATIBLE_OBJECTS); |
| 1001 | return 0; | 1001 | return -1; |
| 1002 | } | 1002 | } |
| 1003 | return group->meth->point_cmp(group, a, b, ctx); | 1003 | return group->meth->point_cmp(group, a, b, ctx); |
| 1004 | } | 1004 | } |
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c index 079e47431b..f04f132c7a 100644 --- a/src/lib/libcrypto/ec/ecp_mont.c +++ b/src/lib/libcrypto/ec/ecp_mont.c | |||
| @@ -114,7 +114,6 @@ const EC_METHOD *EC_GFp_mont_method(void) | |||
| 114 | ec_GFp_mont_field_decode, | 114 | ec_GFp_mont_field_decode, |
| 115 | ec_GFp_mont_field_set_to_one }; | 115 | ec_GFp_mont_field_set_to_one }; |
| 116 | 116 | ||
| 117 | |||
| 118 | return &ret; | 117 | return &ret; |
| 119 | #endif | 118 | #endif |
| 120 | } | 119 | } |
diff --git a/src/lib/libcrypto/ec/ectest.c b/src/lib/libcrypto/ec/ectest.c index f107782de0..102eaa9b23 100644 --- a/src/lib/libcrypto/ec/ectest.c +++ b/src/lib/libcrypto/ec/ectest.c | |||
| @@ -236,7 +236,7 @@ static void group_order_tests(EC_GROUP *group) | |||
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | static void prime_field_tests(void) | 238 | static void prime_field_tests(void) |
| 239 | { | 239 | { |
| 240 | BN_CTX *ctx = NULL; | 240 | BN_CTX *ctx = NULL; |
| 241 | BIGNUM *p, *a, *b; | 241 | BIGNUM *p, *a, *b; |
| 242 | EC_GROUP *group; | 242 | EC_GROUP *group; |
diff --git a/src/lib/libcrypto/ecdh/Makefile b/src/lib/libcrypto/ecdh/Makefile index 65d8904ee8..ba05fea05c 100644 --- a/src/lib/libcrypto/ecdh/Makefile +++ b/src/lib/libcrypto/ecdh/Makefile | |||
| @@ -84,17 +84,12 @@ ech_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h | |||
| 84 | ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h | 84 | ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 85 | ech_err.o: ech_err.c | 85 | ech_err.o: ech_err.c |
| 86 | ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 86 | ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 87 | ech_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 87 | ech_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h |
| 88 | ech_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 88 | ech_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h |
| 89 | ech_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h | 89 | ech_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h |
| 90 | ech_key.o: ../../include/openssl/engine.h ../../include/openssl/evp.h | 90 | ech_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h |
| 91 | ech_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h | 91 | ech_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h |
| 92 | ech_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h | 92 | ech_key.o: ech_key.c ech_locl.h |
| 93 | ech_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h | ||
| 94 | ech_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h | ||
| 95 | ech_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h | ||
| 96 | ech_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h | ||
| 97 | ech_key.o: ../../include/openssl/x509_vfy.h ech_key.c ech_locl.h | ||
| 98 | ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h | 93 | ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h |
| 99 | ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h | 94 | ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h |
| 100 | ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h | 95 | ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h |
