summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/crypto/evp/evp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/crypto/evp/evp.h')
-rw-r--r--src/lib/libssl/src/crypto/evp/evp.h70
1 files changed, 59 insertions, 11 deletions
diff --git a/src/lib/libssl/src/crypto/evp/evp.h b/src/lib/libssl/src/crypto/evp/evp.h
index 4801d8eaa3..5cde88ae76 100644
--- a/src/lib/libssl/src/crypto/evp/evp.h
+++ b/src/lib/libssl/src/crypto/evp/evp.h
@@ -117,6 +117,10 @@
117#include <openssl/aes.h> 117#include <openssl/aes.h>
118#endif 118#endif
119 119
120#ifdef OPENSSL_FIPS
121#include <openssl/fips.h>
122#endif
123
120/* 124/*
121#define EVP_RC2_KEY_SIZE 16 125#define EVP_RC2_KEY_SIZE 16
122#define EVP_RC4_KEY_SIZE 16 126#define EVP_RC4_KEY_SIZE 16
@@ -290,6 +294,7 @@ struct env_md_st
290 294
291#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single 295#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
292 * block */ 296 * block */
297#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */
293 298
294#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} 299#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
295 300
@@ -332,6 +337,9 @@ struct env_md_ctx_st
332#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data 337#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
333 * in EVP_MD_CTX_cleanup */ 338 * in EVP_MD_CTX_cleanup */
334 339
340#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
341 * in FIPS mode */
342
335struct evp_cipher_st 343struct evp_cipher_st
336 { 344 {
337 int nid; 345 int nid;
@@ -373,6 +381,10 @@ struct evp_cipher_st
373#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 381#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
374/* Don't use standard block padding */ 382/* Don't use standard block padding */
375#define EVP_CIPH_NO_PADDING 0x100 383#define EVP_CIPH_NO_PADDING 0x100
384/* Note if suitable for use in FIPS mode */
385#define EVP_CIPH_FLAG_FIPS 0x400
386/* Allow non FIPS cipher in FIPS mode */
387#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800
376 388
377/* ctrl() values */ 389/* ctrl() values */
378 390
@@ -478,6 +490,9 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
478#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) 490#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
479#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 491#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
480#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) 492#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
493#define EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
494#define EVP_CIPHER_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs))
495#define EVP_CIPHER_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
481#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE) 496#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
482 497
483#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) 498#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
@@ -499,6 +514,7 @@ void BIO_set_md(BIO *,const EVP_MD *md);
499#endif 514#endif
500#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) 515#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
501#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) 516#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
517#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
502#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) 518#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
503#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) 519#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
504 520
@@ -640,9 +656,20 @@ const EVP_CIPHER *EVP_des_ede(void);
640const EVP_CIPHER *EVP_des_ede3(void); 656const EVP_CIPHER *EVP_des_ede3(void);
641const EVP_CIPHER *EVP_des_ede_ecb(void); 657const EVP_CIPHER *EVP_des_ede_ecb(void);
642const EVP_CIPHER *EVP_des_ede3_ecb(void); 658const EVP_CIPHER *EVP_des_ede3_ecb(void);
643const EVP_CIPHER *EVP_des_cfb(void); 659const EVP_CIPHER *EVP_des_cfb64(void);
644const EVP_CIPHER *EVP_des_ede_cfb(void); 660# define EVP_des_cfb EVP_des_cfb64
645const EVP_CIPHER *EVP_des_ede3_cfb(void); 661const EVP_CIPHER *EVP_des_cfb1(void);
662const EVP_CIPHER *EVP_des_cfb8(void);
663const EVP_CIPHER *EVP_des_ede_cfb64(void);
664# define EVP_des_ede_cfb EVP_des_ede_cfb64
665#if 0
666const EVP_CIPHER *EVP_des_ede_cfb1(void);
667const EVP_CIPHER *EVP_des_ede_cfb8(void);
668#endif
669const EVP_CIPHER *EVP_des_ede3_cfb64(void);
670# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
671const EVP_CIPHER *EVP_des_ede3_cfb1(void);
672const EVP_CIPHER *EVP_des_ede3_cfb8(void);
646const EVP_CIPHER *EVP_des_ofb(void); 673const EVP_CIPHER *EVP_des_ofb(void);
647const EVP_CIPHER *EVP_des_ede_ofb(void); 674const EVP_CIPHER *EVP_des_ede_ofb(void);
648const EVP_CIPHER *EVP_des_ede3_ofb(void); 675const EVP_CIPHER *EVP_des_ede3_ofb(void);
@@ -666,7 +693,8 @@ const EVP_CIPHER *EVP_rc4_40(void);
666#endif 693#endif
667#ifndef OPENSSL_NO_IDEA 694#ifndef OPENSSL_NO_IDEA
668const EVP_CIPHER *EVP_idea_ecb(void); 695const EVP_CIPHER *EVP_idea_ecb(void);
669const EVP_CIPHER *EVP_idea_cfb(void); 696const EVP_CIPHER *EVP_idea_cfb64(void);
697# define EVP_idea_cfb EVP_idea_cfb64
670const EVP_CIPHER *EVP_idea_ofb(void); 698const EVP_CIPHER *EVP_idea_ofb(void);
671const EVP_CIPHER *EVP_idea_cbc(void); 699const EVP_CIPHER *EVP_idea_cbc(void);
672#endif 700#endif
@@ -675,45 +703,58 @@ const EVP_CIPHER *EVP_rc2_ecb(void);
675const EVP_CIPHER *EVP_rc2_cbc(void); 703const EVP_CIPHER *EVP_rc2_cbc(void);
676const EVP_CIPHER *EVP_rc2_40_cbc(void); 704const EVP_CIPHER *EVP_rc2_40_cbc(void);
677const EVP_CIPHER *EVP_rc2_64_cbc(void); 705const EVP_CIPHER *EVP_rc2_64_cbc(void);
678const EVP_CIPHER *EVP_rc2_cfb(void); 706const EVP_CIPHER *EVP_rc2_cfb64(void);
707# define EVP_rc2_cfb EVP_rc2_cfb64
679const EVP_CIPHER *EVP_rc2_ofb(void); 708const EVP_CIPHER *EVP_rc2_ofb(void);
680#endif 709#endif
681#ifndef OPENSSL_NO_BF 710#ifndef OPENSSL_NO_BF
682const EVP_CIPHER *EVP_bf_ecb(void); 711const EVP_CIPHER *EVP_bf_ecb(void);
683const EVP_CIPHER *EVP_bf_cbc(void); 712const EVP_CIPHER *EVP_bf_cbc(void);
684const EVP_CIPHER *EVP_bf_cfb(void); 713const EVP_CIPHER *EVP_bf_cfb64(void);
714# define EVP_bf_cfb EVP_bf_cfb64
685const EVP_CIPHER *EVP_bf_ofb(void); 715const EVP_CIPHER *EVP_bf_ofb(void);
686#endif 716#endif
687#ifndef OPENSSL_NO_CAST 717#ifndef OPENSSL_NO_CAST
688const EVP_CIPHER *EVP_cast5_ecb(void); 718const EVP_CIPHER *EVP_cast5_ecb(void);
689const EVP_CIPHER *EVP_cast5_cbc(void); 719const EVP_CIPHER *EVP_cast5_cbc(void);
690const EVP_CIPHER *EVP_cast5_cfb(void); 720const EVP_CIPHER *EVP_cast5_cfb64(void);
721# define EVP_cast5_cfb EVP_cast5_cfb64
691const EVP_CIPHER *EVP_cast5_ofb(void); 722const EVP_CIPHER *EVP_cast5_ofb(void);
692#endif 723#endif
693#ifndef OPENSSL_NO_RC5 724#ifndef OPENSSL_NO_RC5
694const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); 725const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);
695const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); 726const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);
696const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); 727const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);
728# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
697const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); 729const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);
698#endif 730#endif
699#ifndef OPENSSL_NO_AES 731#ifndef OPENSSL_NO_AES
700const EVP_CIPHER *EVP_aes_128_ecb(void); 732const EVP_CIPHER *EVP_aes_128_ecb(void);
701const EVP_CIPHER *EVP_aes_128_cbc(void); 733const EVP_CIPHER *EVP_aes_128_cbc(void);
702const EVP_CIPHER *EVP_aes_128_cfb(void); 734const EVP_CIPHER *EVP_aes_128_cfb1(void);
735const EVP_CIPHER *EVP_aes_128_cfb8(void);
736const EVP_CIPHER *EVP_aes_128_cfb128(void);
737# define EVP_aes_128_cfb EVP_aes_128_cfb128
703const EVP_CIPHER *EVP_aes_128_ofb(void); 738const EVP_CIPHER *EVP_aes_128_ofb(void);
704#if 0 739#if 0
705const EVP_CIPHER *EVP_aes_128_ctr(void); 740const EVP_CIPHER *EVP_aes_128_ctr(void);
706#endif 741#endif
707const EVP_CIPHER *EVP_aes_192_ecb(void); 742const EVP_CIPHER *EVP_aes_192_ecb(void);
708const EVP_CIPHER *EVP_aes_192_cbc(void); 743const EVP_CIPHER *EVP_aes_192_cbc(void);
709const EVP_CIPHER *EVP_aes_192_cfb(void); 744const EVP_CIPHER *EVP_aes_192_cfb1(void);
745const EVP_CIPHER *EVP_aes_192_cfb8(void);
746const EVP_CIPHER *EVP_aes_192_cfb128(void);
747# define EVP_aes_192_cfb EVP_aes_192_cfb128
710const EVP_CIPHER *EVP_aes_192_ofb(void); 748const EVP_CIPHER *EVP_aes_192_ofb(void);
711#if 0 749#if 0
712const EVP_CIPHER *EVP_aes_192_ctr(void); 750const EVP_CIPHER *EVP_aes_192_ctr(void);
713#endif 751#endif
714const EVP_CIPHER *EVP_aes_256_ecb(void); 752const EVP_CIPHER *EVP_aes_256_ecb(void);
715const EVP_CIPHER *EVP_aes_256_cbc(void); 753const EVP_CIPHER *EVP_aes_256_cbc(void);
716const EVP_CIPHER *EVP_aes_256_cfb(void); 754const EVP_CIPHER *EVP_aes_256_cfb1(void);
755const EVP_CIPHER *EVP_aes_256_cfb8(void);
756const EVP_CIPHER *EVP_aes_256_cfb128(void);
757# define EVP_aes_256_cfb EVP_aes_256_cfb128
717const EVP_CIPHER *EVP_aes_256_ofb(void); 758const EVP_CIPHER *EVP_aes_256_ofb(void);
718#if 0 759#if 0
719const EVP_CIPHER *EVP_aes_256_ctr(void); 760const EVP_CIPHER *EVP_aes_256_ctr(void);
@@ -825,13 +866,18 @@ void ERR_load_EVP_strings(void);
825/* Error codes for the EVP functions. */ 866/* Error codes for the EVP functions. */
826 867
827/* Function codes. */ 868/* Function codes. */
869#define EVP_F_AES_INIT_KEY 129
828#define EVP_F_D2I_PKEY 100 870#define EVP_F_D2I_PKEY 100
871#define EVP_F_EVP_ADD_CIPHER 130
872#define EVP_F_EVP_ADD_DIGEST 131
829#define EVP_F_EVP_CIPHERINIT 123 873#define EVP_F_EVP_CIPHERINIT 123
830#define EVP_F_EVP_CIPHER_CTX_CTRL 124 874#define EVP_F_EVP_CIPHER_CTX_CTRL 124
831#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 875#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
832#define EVP_F_EVP_DECRYPTFINAL 101 876#define EVP_F_EVP_DECRYPTFINAL 101
833#define EVP_F_EVP_DIGESTINIT 128 877#define EVP_F_EVP_DIGESTINIT 128
834#define EVP_F_EVP_ENCRYPTFINAL 127 878#define EVP_F_EVP_ENCRYPTFINAL 127
879#define EVP_F_EVP_GET_CIPHERBYNAME 132
880#define EVP_F_EVP_GET_DIGESTBYNAME 133
835#define EVP_F_EVP_MD_CTX_COPY 110 881#define EVP_F_EVP_MD_CTX_COPY 110
836#define EVP_F_EVP_OPENINIT 102 882#define EVP_F_EVP_OPENINIT 102
837#define EVP_F_EVP_PBE_ALG_ADD 115 883#define EVP_F_EVP_PBE_ALG_ADD 115
@@ -855,6 +901,7 @@ void ERR_load_EVP_strings(void);
855#define EVP_F_RC5_CTRL 125 901#define EVP_F_RC5_CTRL 125
856 902
857/* Reason codes. */ 903/* Reason codes. */
904#define EVP_R_AES_KEY_SETUP_FAILED 140
858#define EVP_R_BAD_BLOCK_LENGTH 136 905#define EVP_R_BAD_BLOCK_LENGTH 136
859#define EVP_R_BAD_DECRYPT 100 906#define EVP_R_BAD_DECRYPT 100
860#define EVP_R_BAD_KEY_LENGTH 137 907#define EVP_R_BAD_KEY_LENGTH 137
@@ -866,6 +913,7 @@ void ERR_load_EVP_strings(void);
866#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 913#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
867#define EVP_R_DECODE_ERROR 114 914#define EVP_R_DECODE_ERROR 114
868#define EVP_R_DIFFERENT_KEY_TYPES 101 915#define EVP_R_DIFFERENT_KEY_TYPES 101
916#define EVP_R_DISABLED_FOR_FIPS 141
869#define EVP_R_ENCODE_ERROR 115 917#define EVP_R_ENCODE_ERROR 115
870#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 918#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
871#define EVP_R_EXPECTING_AN_RSA_KEY 127 919#define EVP_R_EXPECTING_AN_RSA_KEY 127