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 f9b48792ce..62d95354ef 100644
--- a/src/lib/libssl/src/crypto/evp/evp.h
+++ b/src/lib/libssl/src/crypto/evp/evp.h
@@ -75,6 +75,10 @@
75#include <openssl/bio.h> 75#include <openssl/bio.h>
76#endif 76#endif
77 77
78#ifdef OPENSSL_FIPS
79#include <openssl/fips.h>
80#endif
81
78/* 82/*
79#define EVP_RC2_KEY_SIZE 16 83#define EVP_RC2_KEY_SIZE 16
80#define EVP_RC4_KEY_SIZE 16 84#define EVP_RC4_KEY_SIZE 16
@@ -236,6 +240,7 @@ struct env_md_st
236 240
237#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single 241#define EVP_MD_FLAG_ONESHOT 0x0001 /* digest can only handle a single
238 * block */ 242 * block */
243#define EVP_MD_FLAG_FIPS 0x0400 /* Note if suitable for use in FIPS mode */
239 244
240#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0} 245#define EVP_PKEY_NULL_method NULL,NULL,{0,0,0,0}
241 246
@@ -278,6 +283,9 @@ struct env_md_ctx_st
278#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data 283#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
279 * in EVP_MD_CTX_cleanup */ 284 * in EVP_MD_CTX_cleanup */
280 285
286#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
287 * in FIPS mode */
288
281struct evp_cipher_st 289struct evp_cipher_st
282 { 290 {
283 int nid; 291 int nid;
@@ -319,6 +327,10 @@ struct evp_cipher_st
319#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80 327#define EVP_CIPH_CUSTOM_KEY_LENGTH 0x80
320/* Don't use standard block padding */ 328/* Don't use standard block padding */
321#define EVP_CIPH_NO_PADDING 0x100 329#define EVP_CIPH_NO_PADDING 0x100
330/* Note if suitable for use in FIPS mode */
331#define EVP_CIPH_FLAG_FIPS 0x400
332/* Allow non FIPS cipher in FIPS mode */
333#define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0x800
322 334
323/* ctrl() values */ 335/* ctrl() values */
324 336
@@ -425,6 +437,9 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
425#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d)) 437#define EVP_CIPHER_CTX_set_app_data(e,d) ((e)->app_data=(char *)(d))
426#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) 438#define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))
427#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags) 439#define EVP_CIPHER_CTX_flags(e) ((e)->cipher->flags)
440#define EVP_CIPHER_CTX_set_flags(ctx,flgs) ((ctx)->flags|=(flgs))
441#define EVP_CIPHER_CTX_clear_flags(ctx,flgs) ((ctx)->flags&=~(flgs))
442#define EVP_CIPHER_CTX_test_flags(ctx,flgs) ((ctx)->flags&(flgs))
428#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE) 443#define EVP_CIPHER_CTX_mode(e) ((e)->cipher->flags & EVP_CIPH_MODE)
429 444
430#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80) 445#define EVP_ENCODE_LENGTH(l) (((l+2)/3*4)+(l/48+1)*2+80)
@@ -446,6 +461,7 @@ void BIO_set_md(BIO *,const EVP_MD *md);
446#endif 461#endif
447#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp) 462#define BIO_get_md(b,mdp) BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)
448#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp) 463#define BIO_get_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)
464#define BIO_set_md_ctx(b,mdcp) BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)
449#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) 465#define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)
450#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) 466#define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)
451 467
@@ -587,9 +603,20 @@ const EVP_CIPHER *EVP_des_ede(void);
587const EVP_CIPHER *EVP_des_ede3(void); 603const EVP_CIPHER *EVP_des_ede3(void);
588const EVP_CIPHER *EVP_des_ede_ecb(void); 604const EVP_CIPHER *EVP_des_ede_ecb(void);
589const EVP_CIPHER *EVP_des_ede3_ecb(void); 605const EVP_CIPHER *EVP_des_ede3_ecb(void);
590const EVP_CIPHER *EVP_des_cfb(void); 606const EVP_CIPHER *EVP_des_cfb64(void);
591const EVP_CIPHER *EVP_des_ede_cfb(void); 607# define EVP_des_cfb EVP_des_cfb64
592const EVP_CIPHER *EVP_des_ede3_cfb(void); 608const EVP_CIPHER *EVP_des_cfb1(void);
609const EVP_CIPHER *EVP_des_cfb8(void);
610const EVP_CIPHER *EVP_des_ede_cfb64(void);
611# define EVP_des_ede_cfb EVP_des_ede_cfb64
612#if 0
613const EVP_CIPHER *EVP_des_ede_cfb1(void);
614const EVP_CIPHER *EVP_des_ede_cfb8(void);
615#endif
616const EVP_CIPHER *EVP_des_ede3_cfb64(void);
617# define EVP_des_ede3_cfb EVP_des_ede3_cfb64
618const EVP_CIPHER *EVP_des_ede3_cfb1(void);
619const EVP_CIPHER *EVP_des_ede3_cfb8(void);
593const EVP_CIPHER *EVP_des_ofb(void); 620const EVP_CIPHER *EVP_des_ofb(void);
594const EVP_CIPHER *EVP_des_ede_ofb(void); 621const EVP_CIPHER *EVP_des_ede_ofb(void);
595const EVP_CIPHER *EVP_des_ede3_ofb(void); 622const EVP_CIPHER *EVP_des_ede3_ofb(void);
@@ -613,7 +640,8 @@ const EVP_CIPHER *EVP_rc4_40(void);
613#endif 640#endif
614#ifndef OPENSSL_NO_IDEA 641#ifndef OPENSSL_NO_IDEA
615const EVP_CIPHER *EVP_idea_ecb(void); 642const EVP_CIPHER *EVP_idea_ecb(void);
616const EVP_CIPHER *EVP_idea_cfb(void); 643const EVP_CIPHER *EVP_idea_cfb64(void);
644# define EVP_idea_cfb EVP_idea_cfb64
617const EVP_CIPHER *EVP_idea_ofb(void); 645const EVP_CIPHER *EVP_idea_ofb(void);
618const EVP_CIPHER *EVP_idea_cbc(void); 646const EVP_CIPHER *EVP_idea_cbc(void);
619#endif 647#endif
@@ -622,45 +650,58 @@ const EVP_CIPHER *EVP_rc2_ecb(void);
622const EVP_CIPHER *EVP_rc2_cbc(void); 650const EVP_CIPHER *EVP_rc2_cbc(void);
623const EVP_CIPHER *EVP_rc2_40_cbc(void); 651const EVP_CIPHER *EVP_rc2_40_cbc(void);
624const EVP_CIPHER *EVP_rc2_64_cbc(void); 652const EVP_CIPHER *EVP_rc2_64_cbc(void);
625const EVP_CIPHER *EVP_rc2_cfb(void); 653const EVP_CIPHER *EVP_rc2_cfb64(void);
654# define EVP_rc2_cfb EVP_rc2_cfb64
626const EVP_CIPHER *EVP_rc2_ofb(void); 655const EVP_CIPHER *EVP_rc2_ofb(void);
627#endif 656#endif
628#ifndef OPENSSL_NO_BF 657#ifndef OPENSSL_NO_BF
629const EVP_CIPHER *EVP_bf_ecb(void); 658const EVP_CIPHER *EVP_bf_ecb(void);
630const EVP_CIPHER *EVP_bf_cbc(void); 659const EVP_CIPHER *EVP_bf_cbc(void);
631const EVP_CIPHER *EVP_bf_cfb(void); 660const EVP_CIPHER *EVP_bf_cfb64(void);
661# define EVP_bf_cfb EVP_bf_cfb64
632const EVP_CIPHER *EVP_bf_ofb(void); 662const EVP_CIPHER *EVP_bf_ofb(void);
633#endif 663#endif
634#ifndef OPENSSL_NO_CAST 664#ifndef OPENSSL_NO_CAST
635const EVP_CIPHER *EVP_cast5_ecb(void); 665const EVP_CIPHER *EVP_cast5_ecb(void);
636const EVP_CIPHER *EVP_cast5_cbc(void); 666const EVP_CIPHER *EVP_cast5_cbc(void);
637const EVP_CIPHER *EVP_cast5_cfb(void); 667const EVP_CIPHER *EVP_cast5_cfb64(void);
668# define EVP_cast5_cfb EVP_cast5_cfb64
638const EVP_CIPHER *EVP_cast5_ofb(void); 669const EVP_CIPHER *EVP_cast5_ofb(void);
639#endif 670#endif
640#ifndef OPENSSL_NO_RC5 671#ifndef OPENSSL_NO_RC5
641const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); 672const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);
642const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); 673const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);
643const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); 674const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);
675# define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64
644const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); 676const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);
645#endif 677#endif
646#ifndef OPENSSL_NO_AES 678#ifndef OPENSSL_NO_AES
647const EVP_CIPHER *EVP_aes_128_ecb(void); 679const EVP_CIPHER *EVP_aes_128_ecb(void);
648const EVP_CIPHER *EVP_aes_128_cbc(void); 680const EVP_CIPHER *EVP_aes_128_cbc(void);
649const EVP_CIPHER *EVP_aes_128_cfb(void); 681const EVP_CIPHER *EVP_aes_128_cfb1(void);
682const EVP_CIPHER *EVP_aes_128_cfb8(void);
683const EVP_CIPHER *EVP_aes_128_cfb128(void);
684# define EVP_aes_128_cfb EVP_aes_128_cfb128
650const EVP_CIPHER *EVP_aes_128_ofb(void); 685const EVP_CIPHER *EVP_aes_128_ofb(void);
651#if 0 686#if 0
652const EVP_CIPHER *EVP_aes_128_ctr(void); 687const EVP_CIPHER *EVP_aes_128_ctr(void);
653#endif 688#endif
654const EVP_CIPHER *EVP_aes_192_ecb(void); 689const EVP_CIPHER *EVP_aes_192_ecb(void);
655const EVP_CIPHER *EVP_aes_192_cbc(void); 690const EVP_CIPHER *EVP_aes_192_cbc(void);
656const EVP_CIPHER *EVP_aes_192_cfb(void); 691const EVP_CIPHER *EVP_aes_192_cfb1(void);
692const EVP_CIPHER *EVP_aes_192_cfb8(void);
693const EVP_CIPHER *EVP_aes_192_cfb128(void);
694# define EVP_aes_192_cfb EVP_aes_192_cfb128
657const EVP_CIPHER *EVP_aes_192_ofb(void); 695const EVP_CIPHER *EVP_aes_192_ofb(void);
658#if 0 696#if 0
659const EVP_CIPHER *EVP_aes_192_ctr(void); 697const EVP_CIPHER *EVP_aes_192_ctr(void);
660#endif 698#endif
661const EVP_CIPHER *EVP_aes_256_ecb(void); 699const EVP_CIPHER *EVP_aes_256_ecb(void);
662const EVP_CIPHER *EVP_aes_256_cbc(void); 700const EVP_CIPHER *EVP_aes_256_cbc(void);
663const EVP_CIPHER *EVP_aes_256_cfb(void); 701const EVP_CIPHER *EVP_aes_256_cfb1(void);
702const EVP_CIPHER *EVP_aes_256_cfb8(void);
703const EVP_CIPHER *EVP_aes_256_cfb128(void);
704# define EVP_aes_256_cfb EVP_aes_256_cfb128
664const EVP_CIPHER *EVP_aes_256_ofb(void); 705const EVP_CIPHER *EVP_aes_256_ofb(void);
665#if 0 706#if 0
666const EVP_CIPHER *EVP_aes_256_ctr(void); 707const EVP_CIPHER *EVP_aes_256_ctr(void);
@@ -775,13 +816,18 @@ void ERR_load_EVP_strings(void);
775/* Error codes for the EVP functions. */ 816/* Error codes for the EVP functions. */
776 817
777/* Function codes. */ 818/* Function codes. */
819#define EVP_F_AES_INIT_KEY 129
778#define EVP_F_D2I_PKEY 100 820#define EVP_F_D2I_PKEY 100
821#define EVP_F_EVP_ADD_CIPHER 130
822#define EVP_F_EVP_ADD_DIGEST 131
779#define EVP_F_EVP_CIPHERINIT 123 823#define EVP_F_EVP_CIPHERINIT 123
780#define EVP_F_EVP_CIPHER_CTX_CTRL 124 824#define EVP_F_EVP_CIPHER_CTX_CTRL 124
781#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122 825#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
782#define EVP_F_EVP_DECRYPTFINAL 101 826#define EVP_F_EVP_DECRYPTFINAL 101
783#define EVP_F_EVP_DIGESTINIT 128 827#define EVP_F_EVP_DIGESTINIT 128
784#define EVP_F_EVP_ENCRYPTFINAL 127 828#define EVP_F_EVP_ENCRYPTFINAL 127
829#define EVP_F_EVP_GET_CIPHERBYNAME 132
830#define EVP_F_EVP_GET_DIGESTBYNAME 133
785#define EVP_F_EVP_MD_CTX_COPY 110 831#define EVP_F_EVP_MD_CTX_COPY 110
786#define EVP_F_EVP_OPENINIT 102 832#define EVP_F_EVP_OPENINIT 102
787#define EVP_F_EVP_PBE_ALG_ADD 115 833#define EVP_F_EVP_PBE_ALG_ADD 115
@@ -805,6 +851,7 @@ void ERR_load_EVP_strings(void);
805#define EVP_F_RC5_CTRL 125 851#define EVP_F_RC5_CTRL 125
806 852
807/* Reason codes. */ 853/* Reason codes. */
854#define EVP_R_AES_KEY_SETUP_FAILED 140
808#define EVP_R_BAD_BLOCK_LENGTH 136 855#define EVP_R_BAD_BLOCK_LENGTH 136
809#define EVP_R_BAD_DECRYPT 100 856#define EVP_R_BAD_DECRYPT 100
810#define EVP_R_BAD_KEY_LENGTH 137 857#define EVP_R_BAD_KEY_LENGTH 137
@@ -816,6 +863,7 @@ void ERR_load_EVP_strings(void);
816#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138 863#define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 138
817#define EVP_R_DECODE_ERROR 114 864#define EVP_R_DECODE_ERROR 114
818#define EVP_R_DIFFERENT_KEY_TYPES 101 865#define EVP_R_DIFFERENT_KEY_TYPES 101
866#define EVP_R_DISABLED_FOR_FIPS 141
819#define EVP_R_ENCODE_ERROR 115 867#define EVP_R_ENCODE_ERROR 115
820#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119 868#define EVP_R_EVP_PBE_CIPHERINIT_ERROR 119
821#define EVP_R_EXPECTING_AN_RSA_KEY 127 869#define EVP_R_EXPECTING_AN_RSA_KEY 127