diff options
Diffstat (limited to 'src/lib/libcrypto/evp/evp.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index 9de7c3f9ef..6c1bf6c7cd 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp.h,v 1.39 2014/07/11 15:28:27 tedu Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.40 2014/11/09 19:17:13 miod Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -107,8 +107,12 @@ | |||
107 | #define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 | 107 | #define EVP_PKEY_DSA4 NID_dsaWithSHA1_2 |
108 | #define EVP_PKEY_DH NID_dhKeyAgreement | 108 | #define EVP_PKEY_DH NID_dhKeyAgreement |
109 | #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey | 109 | #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey |
110 | #define EVP_PKEY_GOSTR01 NID_id_GostR3410_2001 | ||
111 | #define EVP_PKEY_GOSTIMIT NID_id_Gost28147_89_MAC | ||
110 | #define EVP_PKEY_HMAC NID_hmac | 112 | #define EVP_PKEY_HMAC NID_hmac |
111 | #define EVP_PKEY_CMAC NID_cmac | 113 | #define EVP_PKEY_CMAC NID_cmac |
114 | #define EVP_PKEY_GOSTR12_256 NID_id_tc26_gost3410_2012_256 | ||
115 | #define EVP_PKEY_GOSTR12_512 NID_id_tc26_gost3410_2012_512 | ||
112 | 116 | ||
113 | #ifdef __cplusplus | 117 | #ifdef __cplusplus |
114 | extern "C" { | 118 | extern "C" { |
@@ -137,6 +141,9 @@ struct evp_pkey_st { | |||
137 | #ifndef OPENSSL_NO_EC | 141 | #ifndef OPENSSL_NO_EC |
138 | struct ec_key_st *ec; /* ECC */ | 142 | struct ec_key_st *ec; /* ECC */ |
139 | #endif | 143 | #endif |
144 | #ifndef OPENSSL_NO_GOST | ||
145 | struct gost_key_st *gost; /* GOST */ | ||
146 | #endif | ||
140 | } pkey; | 147 | } pkey; |
141 | int save_parameters; | 148 | int save_parameters; |
142 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ | 149 | STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ |
@@ -213,6 +220,8 @@ typedef int evp_verify_method(int type, const unsigned char *m, | |||
213 | 220 | ||
214 | #define EVP_MD_CTRL_DIGALGID 0x1 | 221 | #define EVP_MD_CTRL_DIGALGID 0x1 |
215 | #define EVP_MD_CTRL_MICALG 0x2 | 222 | #define EVP_MD_CTRL_MICALG 0x2 |
223 | #define EVP_MD_CTRL_SET_KEY 0x3 | ||
224 | #define EVP_MD_CTRL_GOST_SET_SBOX 0x4 | ||
216 | 225 | ||
217 | /* Minimum Algorithm specific ctrl value */ | 226 | /* Minimum Algorithm specific ctrl value */ |
218 | 227 | ||
@@ -381,6 +390,8 @@ struct evp_cipher_st { | |||
381 | #define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 | 390 | #define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 |
382 | /* Set the GCM invocation field, decrypt only */ | 391 | /* Set the GCM invocation field, decrypt only */ |
383 | #define EVP_CTRL_GCM_SET_IV_INV 0x18 | 392 | #define EVP_CTRL_GCM_SET_IV_INV 0x18 |
393 | /* Set the S-BOX NID for GOST ciphers */ | ||
394 | #define EVP_CTRL_GOST_SET_SBOX 0x19 | ||
384 | 395 | ||
385 | /* GCM TLS constants */ | 396 | /* GCM TLS constants */ |
386 | /* Length of fixed part of IV derived from PRF */ | 397 | /* Length of fixed part of IV derived from PRF */ |
@@ -451,6 +462,11 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, | |||
451 | (char *)(eckey)) | 462 | (char *)(eckey)) |
452 | #endif | 463 | #endif |
453 | 464 | ||
465 | #ifndef OPENSSL_NO_GOST | ||
466 | #define EVP_PKEY_assign_GOST(pkey,gostkey) EVP_PKEY_assign((pkey),EVP_PKEY_GOSTR01,\ | ||
467 | (char *)(gostkey)) | ||
468 | #endif | ||
469 | |||
454 | /* Add some extra combinations */ | 470 | /* Add some extra combinations */ |
455 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) | 471 | #define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a)) |
456 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) | 472 | #define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a)) |
@@ -530,6 +546,7 @@ void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); | |||
530 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); | 546 | int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); |
531 | void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); | 547 | void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags); |
532 | void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); | 548 | void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags); |
549 | int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr); | ||
533 | int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); | 550 | int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags); |
534 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); | 551 | int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); |
535 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); | 552 | int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); |
@@ -665,6 +682,12 @@ const EVP_MD *EVP_ripemd160(void); | |||
665 | #ifndef OPENSSL_NO_WHIRLPOOL | 682 | #ifndef OPENSSL_NO_WHIRLPOOL |
666 | const EVP_MD *EVP_whirlpool(void); | 683 | const EVP_MD *EVP_whirlpool(void); |
667 | #endif | 684 | #endif |
685 | #ifndef OPENSSL_NO_GOST | ||
686 | const EVP_MD *EVP_gostr341194(void); | ||
687 | const EVP_MD *EVP_gost2814789imit(void); | ||
688 | const EVP_MD *EVP_streebog256(void); | ||
689 | const EVP_MD *EVP_streebog512(void); | ||
690 | #endif | ||
668 | const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ | 691 | const EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */ |
669 | #ifndef OPENSSL_NO_DES | 692 | #ifndef OPENSSL_NO_DES |
670 | const EVP_CIPHER *EVP_des_ecb(void); | 693 | const EVP_CIPHER *EVP_des_ecb(void); |
@@ -804,6 +827,12 @@ const EVP_CIPHER *EVP_camellia_256_ofb(void); | |||
804 | const EVP_CIPHER *EVP_chacha20(void); | 827 | const EVP_CIPHER *EVP_chacha20(void); |
805 | #endif | 828 | #endif |
806 | 829 | ||
830 | #ifndef OPENSSL_NO_GOST | ||
831 | const EVP_CIPHER *EVP_gost2814789_ecb(void); | ||
832 | const EVP_CIPHER *EVP_gost2814789_cfb64(void); | ||
833 | const EVP_CIPHER *EVP_gost2814789_cnt(void); | ||
834 | #endif | ||
835 | |||
807 | void OPENSSL_add_all_algorithms_noconf(void); | 836 | void OPENSSL_add_all_algorithms_noconf(void); |
808 | void OPENSSL_add_all_algorithms_conf(void); | 837 | void OPENSSL_add_all_algorithms_conf(void); |
809 | 838 | ||
@@ -871,6 +900,9 @@ struct ec_key_st; | |||
871 | int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); | 900 | int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key); |
872 | struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); | 901 | struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); |
873 | #endif | 902 | #endif |
903 | #ifndef OPENSSL_NO_GOST | ||
904 | struct gost_key_st; | ||
905 | #endif | ||
874 | 906 | ||
875 | EVP_PKEY *EVP_PKEY_new(void); | 907 | EVP_PKEY *EVP_PKEY_new(void); |
876 | void EVP_PKEY_free(EVP_PKEY *pkey); | 908 | void EVP_PKEY_free(EVP_PKEY *pkey); |
@@ -1337,6 +1369,7 @@ void ERR_load_EVP_strings(void); | |||
1337 | #define EVP_F_EVP_DIGESTINIT_EX 128 | 1369 | #define EVP_F_EVP_DIGESTINIT_EX 128 |
1338 | #define EVP_F_EVP_ENCRYPTFINAL_EX 127 | 1370 | #define EVP_F_EVP_ENCRYPTFINAL_EX 127 |
1339 | #define EVP_F_EVP_MD_CTX_COPY_EX 110 | 1371 | #define EVP_F_EVP_MD_CTX_COPY_EX 110 |
1372 | #define EVP_F_EVP_MD_CTX_CTRL 195 | ||
1340 | #define EVP_F_EVP_MD_SIZE 162 | 1373 | #define EVP_F_EVP_MD_SIZE 162 |
1341 | #define EVP_F_EVP_OPENINIT 102 | 1374 | #define EVP_F_EVP_OPENINIT 102 |
1342 | #define EVP_F_EVP_PBE_ALG_ADD 115 | 1375 | #define EVP_F_EVP_PBE_ALG_ADD 115 |