diff options
Diffstat (limited to 'src/lib/libssl/src/crypto/evp/evp.h')
-rw-r--r-- | src/lib/libssl/src/crypto/evp/evp.h | 70 |
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 | |||
335 | struct evp_cipher_st | 343 | struct 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); | |||
640 | const EVP_CIPHER *EVP_des_ede3(void); | 656 | const EVP_CIPHER *EVP_des_ede3(void); |
641 | const EVP_CIPHER *EVP_des_ede_ecb(void); | 657 | const EVP_CIPHER *EVP_des_ede_ecb(void); |
642 | const EVP_CIPHER *EVP_des_ede3_ecb(void); | 658 | const EVP_CIPHER *EVP_des_ede3_ecb(void); |
643 | const EVP_CIPHER *EVP_des_cfb(void); | 659 | const EVP_CIPHER *EVP_des_cfb64(void); |
644 | const EVP_CIPHER *EVP_des_ede_cfb(void); | 660 | # define EVP_des_cfb EVP_des_cfb64 |
645 | const EVP_CIPHER *EVP_des_ede3_cfb(void); | 661 | const EVP_CIPHER *EVP_des_cfb1(void); |
662 | const EVP_CIPHER *EVP_des_cfb8(void); | ||
663 | const EVP_CIPHER *EVP_des_ede_cfb64(void); | ||
664 | # define EVP_des_ede_cfb EVP_des_ede_cfb64 | ||
665 | #if 0 | ||
666 | const EVP_CIPHER *EVP_des_ede_cfb1(void); | ||
667 | const EVP_CIPHER *EVP_des_ede_cfb8(void); | ||
668 | #endif | ||
669 | const EVP_CIPHER *EVP_des_ede3_cfb64(void); | ||
670 | # define EVP_des_ede3_cfb EVP_des_ede3_cfb64 | ||
671 | const EVP_CIPHER *EVP_des_ede3_cfb1(void); | ||
672 | const EVP_CIPHER *EVP_des_ede3_cfb8(void); | ||
646 | const EVP_CIPHER *EVP_des_ofb(void); | 673 | const EVP_CIPHER *EVP_des_ofb(void); |
647 | const EVP_CIPHER *EVP_des_ede_ofb(void); | 674 | const EVP_CIPHER *EVP_des_ede_ofb(void); |
648 | const EVP_CIPHER *EVP_des_ede3_ofb(void); | 675 | const 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 |
668 | const EVP_CIPHER *EVP_idea_ecb(void); | 695 | const EVP_CIPHER *EVP_idea_ecb(void); |
669 | const EVP_CIPHER *EVP_idea_cfb(void); | 696 | const EVP_CIPHER *EVP_idea_cfb64(void); |
697 | # define EVP_idea_cfb EVP_idea_cfb64 | ||
670 | const EVP_CIPHER *EVP_idea_ofb(void); | 698 | const EVP_CIPHER *EVP_idea_ofb(void); |
671 | const EVP_CIPHER *EVP_idea_cbc(void); | 699 | const EVP_CIPHER *EVP_idea_cbc(void); |
672 | #endif | 700 | #endif |
@@ -675,45 +703,58 @@ const EVP_CIPHER *EVP_rc2_ecb(void); | |||
675 | const EVP_CIPHER *EVP_rc2_cbc(void); | 703 | const EVP_CIPHER *EVP_rc2_cbc(void); |
676 | const EVP_CIPHER *EVP_rc2_40_cbc(void); | 704 | const EVP_CIPHER *EVP_rc2_40_cbc(void); |
677 | const EVP_CIPHER *EVP_rc2_64_cbc(void); | 705 | const EVP_CIPHER *EVP_rc2_64_cbc(void); |
678 | const EVP_CIPHER *EVP_rc2_cfb(void); | 706 | const EVP_CIPHER *EVP_rc2_cfb64(void); |
707 | # define EVP_rc2_cfb EVP_rc2_cfb64 | ||
679 | const EVP_CIPHER *EVP_rc2_ofb(void); | 708 | const EVP_CIPHER *EVP_rc2_ofb(void); |
680 | #endif | 709 | #endif |
681 | #ifndef OPENSSL_NO_BF | 710 | #ifndef OPENSSL_NO_BF |
682 | const EVP_CIPHER *EVP_bf_ecb(void); | 711 | const EVP_CIPHER *EVP_bf_ecb(void); |
683 | const EVP_CIPHER *EVP_bf_cbc(void); | 712 | const EVP_CIPHER *EVP_bf_cbc(void); |
684 | const EVP_CIPHER *EVP_bf_cfb(void); | 713 | const EVP_CIPHER *EVP_bf_cfb64(void); |
714 | # define EVP_bf_cfb EVP_bf_cfb64 | ||
685 | const EVP_CIPHER *EVP_bf_ofb(void); | 715 | const EVP_CIPHER *EVP_bf_ofb(void); |
686 | #endif | 716 | #endif |
687 | #ifndef OPENSSL_NO_CAST | 717 | #ifndef OPENSSL_NO_CAST |
688 | const EVP_CIPHER *EVP_cast5_ecb(void); | 718 | const EVP_CIPHER *EVP_cast5_ecb(void); |
689 | const EVP_CIPHER *EVP_cast5_cbc(void); | 719 | const EVP_CIPHER *EVP_cast5_cbc(void); |
690 | const EVP_CIPHER *EVP_cast5_cfb(void); | 720 | const EVP_CIPHER *EVP_cast5_cfb64(void); |
721 | # define EVP_cast5_cfb EVP_cast5_cfb64 | ||
691 | const EVP_CIPHER *EVP_cast5_ofb(void); | 722 | const EVP_CIPHER *EVP_cast5_ofb(void); |
692 | #endif | 723 | #endif |
693 | #ifndef OPENSSL_NO_RC5 | 724 | #ifndef OPENSSL_NO_RC5 |
694 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | 725 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); |
695 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | 726 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); |
696 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | 727 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); |
728 | # define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 | ||
697 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | 729 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); |
698 | #endif | 730 | #endif |
699 | #ifndef OPENSSL_NO_AES | 731 | #ifndef OPENSSL_NO_AES |
700 | const EVP_CIPHER *EVP_aes_128_ecb(void); | 732 | const EVP_CIPHER *EVP_aes_128_ecb(void); |
701 | const EVP_CIPHER *EVP_aes_128_cbc(void); | 733 | const EVP_CIPHER *EVP_aes_128_cbc(void); |
702 | const EVP_CIPHER *EVP_aes_128_cfb(void); | 734 | const EVP_CIPHER *EVP_aes_128_cfb1(void); |
735 | const EVP_CIPHER *EVP_aes_128_cfb8(void); | ||
736 | const EVP_CIPHER *EVP_aes_128_cfb128(void); | ||
737 | # define EVP_aes_128_cfb EVP_aes_128_cfb128 | ||
703 | const EVP_CIPHER *EVP_aes_128_ofb(void); | 738 | const EVP_CIPHER *EVP_aes_128_ofb(void); |
704 | #if 0 | 739 | #if 0 |
705 | const EVP_CIPHER *EVP_aes_128_ctr(void); | 740 | const EVP_CIPHER *EVP_aes_128_ctr(void); |
706 | #endif | 741 | #endif |
707 | const EVP_CIPHER *EVP_aes_192_ecb(void); | 742 | const EVP_CIPHER *EVP_aes_192_ecb(void); |
708 | const EVP_CIPHER *EVP_aes_192_cbc(void); | 743 | const EVP_CIPHER *EVP_aes_192_cbc(void); |
709 | const EVP_CIPHER *EVP_aes_192_cfb(void); | 744 | const EVP_CIPHER *EVP_aes_192_cfb1(void); |
745 | const EVP_CIPHER *EVP_aes_192_cfb8(void); | ||
746 | const EVP_CIPHER *EVP_aes_192_cfb128(void); | ||
747 | # define EVP_aes_192_cfb EVP_aes_192_cfb128 | ||
710 | const EVP_CIPHER *EVP_aes_192_ofb(void); | 748 | const EVP_CIPHER *EVP_aes_192_ofb(void); |
711 | #if 0 | 749 | #if 0 |
712 | const EVP_CIPHER *EVP_aes_192_ctr(void); | 750 | const EVP_CIPHER *EVP_aes_192_ctr(void); |
713 | #endif | 751 | #endif |
714 | const EVP_CIPHER *EVP_aes_256_ecb(void); | 752 | const EVP_CIPHER *EVP_aes_256_ecb(void); |
715 | const EVP_CIPHER *EVP_aes_256_cbc(void); | 753 | const EVP_CIPHER *EVP_aes_256_cbc(void); |
716 | const EVP_CIPHER *EVP_aes_256_cfb(void); | 754 | const EVP_CIPHER *EVP_aes_256_cfb1(void); |
755 | const EVP_CIPHER *EVP_aes_256_cfb8(void); | ||
756 | const EVP_CIPHER *EVP_aes_256_cfb128(void); | ||
757 | # define EVP_aes_256_cfb EVP_aes_256_cfb128 | ||
717 | const EVP_CIPHER *EVP_aes_256_ofb(void); | 758 | const EVP_CIPHER *EVP_aes_256_ofb(void); |
718 | #if 0 | 759 | #if 0 |
719 | const EVP_CIPHER *EVP_aes_256_ctr(void); | 760 | const 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 |