diff options
author | tb <> | 2019-01-19 01:07:00 +0000 |
---|---|---|
committer | tb <> | 2019-01-19 01:07:00 +0000 |
commit | dc38b357c3a6e0db4a7172af29148961b86b0724 (patch) | |
tree | f28042e7a3c924e4bf846d6cded984e02699177d /src/lib/libcrypto/ec/ec.h | |
parent | f11f1c0f8ad579cfb88a2559e3efe0e0367cec85 (diff) | |
download | openbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.tar.gz openbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.tar.bz2 openbsd-dc38b357c3a6e0db4a7172af29148961b86b0724.zip |
Partial port of EC_KEY_METHOD from OpenSSL 1.1.
This commit adds init/free, support for signing, setting and
getting the method, engine support as well as extra data.
from markus
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r-- | src/lib/libcrypto/ec/ec.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h index d9df48603a..1173459dae 100644 --- a/src/lib/libcrypto/ec/ec.h +++ b/src/lib/libcrypto/ec/ec.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec.h,v 1.13 2018/05/19 10:37:02 tb Exp $ */ | 1 | /* $OpenBSD: ec.h,v 1.14 2019/01/19 01:07:00 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -705,6 +705,7 @@ int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off); | |||
705 | /********************************************************************/ | 705 | /********************************************************************/ |
706 | 706 | ||
707 | typedef struct ec_key_st EC_KEY; | 707 | typedef struct ec_key_st EC_KEY; |
708 | typedef struct ec_key_method_st EC_KEY_METHOD; | ||
708 | 709 | ||
709 | /* some values for the encoding_flag */ | 710 | /* some values for the encoding_flag */ |
710 | #define EC_PKEY_NO_PARAMETERS 0x001 | 711 | #define EC_PKEY_NO_PARAMETERS 0x001 |
@@ -945,6 +946,34 @@ int ECParameters_print_fp(FILE *fp, const EC_KEY *key); | |||
945 | */ | 946 | */ |
946 | int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); | 947 | int EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off); |
947 | 948 | ||
949 | #define EC_KEY_get_ex_new_index(l, p, newf, dupf, freef) \ | ||
950 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_EC_KEY, l, p, newf, dupf, freef) | ||
951 | int EC_KEY_set_ex_data(EC_KEY *key, int idx, void *arg); | ||
952 | void *EC_KEY_get_ex_data(const EC_KEY *key, int idx); | ||
953 | |||
954 | const EC_KEY_METHOD *EC_KEY_OpenSSL(void); | ||
955 | const EC_KEY_METHOD *EC_KEY_get_default_method(void); | ||
956 | void EC_KEY_set_default_method(const EC_KEY_METHOD *meth); | ||
957 | const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key); | ||
958 | int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth); | ||
959 | EC_KEY *EC_KEY_new_method(ENGINE *engine); | ||
960 | EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth); | ||
961 | void EC_KEY_METHOD_free(EC_KEY_METHOD *meth); | ||
962 | void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth, | ||
963 | int (*init)(EC_KEY *key), | ||
964 | void (*finish)(EC_KEY *key), | ||
965 | int (*copy)(EC_KEY *dest, const EC_KEY *src), | ||
966 | int (*set_group)(EC_KEY *key, const EC_GROUP *grp), | ||
967 | int (*set_private)(EC_KEY *key, const BIGNUM *priv_key), | ||
968 | int (*set_public)(EC_KEY *key, const EC_POINT *pub_key)); | ||
969 | void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, | ||
970 | int (**pinit)(EC_KEY *key), | ||
971 | void (**pfinish)(EC_KEY *key), | ||
972 | int (**pcopy)(EC_KEY *dest, const EC_KEY *src), | ||
973 | int (**pset_group)(EC_KEY *key, const EC_GROUP *grp), | ||
974 | int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key), | ||
975 | int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); | ||
976 | |||
948 | EC_KEY *ECParameters_dup(EC_KEY *key); | 977 | EC_KEY *ECParameters_dup(EC_KEY *key); |
949 | 978 | ||
950 | #ifndef __cplusplus | 979 | #ifndef __cplusplus |