diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/evp/evp.h | 70 |
1 files changed, 59 insertions, 11 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index f9b48792ce..62d95354ef 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/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 | |||
| 281 | struct evp_cipher_st | 289 | struct 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); | |||
| 587 | const EVP_CIPHER *EVP_des_ede3(void); | 603 | const EVP_CIPHER *EVP_des_ede3(void); |
| 588 | const EVP_CIPHER *EVP_des_ede_ecb(void); | 604 | const EVP_CIPHER *EVP_des_ede_ecb(void); |
| 589 | const EVP_CIPHER *EVP_des_ede3_ecb(void); | 605 | const EVP_CIPHER *EVP_des_ede3_ecb(void); |
| 590 | const EVP_CIPHER *EVP_des_cfb(void); | 606 | const EVP_CIPHER *EVP_des_cfb64(void); |
| 591 | const EVP_CIPHER *EVP_des_ede_cfb(void); | 607 | # define EVP_des_cfb EVP_des_cfb64 |
| 592 | const EVP_CIPHER *EVP_des_ede3_cfb(void); | 608 | const EVP_CIPHER *EVP_des_cfb1(void); |
| 609 | const EVP_CIPHER *EVP_des_cfb8(void); | ||
| 610 | const EVP_CIPHER *EVP_des_ede_cfb64(void); | ||
| 611 | # define EVP_des_ede_cfb EVP_des_ede_cfb64 | ||
| 612 | #if 0 | ||
| 613 | const EVP_CIPHER *EVP_des_ede_cfb1(void); | ||
| 614 | const EVP_CIPHER *EVP_des_ede_cfb8(void); | ||
| 615 | #endif | ||
| 616 | const EVP_CIPHER *EVP_des_ede3_cfb64(void); | ||
| 617 | # define EVP_des_ede3_cfb EVP_des_ede3_cfb64 | ||
| 618 | const EVP_CIPHER *EVP_des_ede3_cfb1(void); | ||
| 619 | const EVP_CIPHER *EVP_des_ede3_cfb8(void); | ||
| 593 | const EVP_CIPHER *EVP_des_ofb(void); | 620 | const EVP_CIPHER *EVP_des_ofb(void); |
| 594 | const EVP_CIPHER *EVP_des_ede_ofb(void); | 621 | const EVP_CIPHER *EVP_des_ede_ofb(void); |
| 595 | const EVP_CIPHER *EVP_des_ede3_ofb(void); | 622 | const 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 |
| 615 | const EVP_CIPHER *EVP_idea_ecb(void); | 642 | const EVP_CIPHER *EVP_idea_ecb(void); |
| 616 | const EVP_CIPHER *EVP_idea_cfb(void); | 643 | const EVP_CIPHER *EVP_idea_cfb64(void); |
| 644 | # define EVP_idea_cfb EVP_idea_cfb64 | ||
| 617 | const EVP_CIPHER *EVP_idea_ofb(void); | 645 | const EVP_CIPHER *EVP_idea_ofb(void); |
| 618 | const EVP_CIPHER *EVP_idea_cbc(void); | 646 | const EVP_CIPHER *EVP_idea_cbc(void); |
| 619 | #endif | 647 | #endif |
| @@ -622,45 +650,58 @@ const EVP_CIPHER *EVP_rc2_ecb(void); | |||
| 622 | const EVP_CIPHER *EVP_rc2_cbc(void); | 650 | const EVP_CIPHER *EVP_rc2_cbc(void); |
| 623 | const EVP_CIPHER *EVP_rc2_40_cbc(void); | 651 | const EVP_CIPHER *EVP_rc2_40_cbc(void); |
| 624 | const EVP_CIPHER *EVP_rc2_64_cbc(void); | 652 | const EVP_CIPHER *EVP_rc2_64_cbc(void); |
| 625 | const EVP_CIPHER *EVP_rc2_cfb(void); | 653 | const EVP_CIPHER *EVP_rc2_cfb64(void); |
| 654 | # define EVP_rc2_cfb EVP_rc2_cfb64 | ||
| 626 | const EVP_CIPHER *EVP_rc2_ofb(void); | 655 | const EVP_CIPHER *EVP_rc2_ofb(void); |
| 627 | #endif | 656 | #endif |
| 628 | #ifndef OPENSSL_NO_BF | 657 | #ifndef OPENSSL_NO_BF |
| 629 | const EVP_CIPHER *EVP_bf_ecb(void); | 658 | const EVP_CIPHER *EVP_bf_ecb(void); |
| 630 | const EVP_CIPHER *EVP_bf_cbc(void); | 659 | const EVP_CIPHER *EVP_bf_cbc(void); |
| 631 | const EVP_CIPHER *EVP_bf_cfb(void); | 660 | const EVP_CIPHER *EVP_bf_cfb64(void); |
| 661 | # define EVP_bf_cfb EVP_bf_cfb64 | ||
| 632 | const EVP_CIPHER *EVP_bf_ofb(void); | 662 | const EVP_CIPHER *EVP_bf_ofb(void); |
| 633 | #endif | 663 | #endif |
| 634 | #ifndef OPENSSL_NO_CAST | 664 | #ifndef OPENSSL_NO_CAST |
| 635 | const EVP_CIPHER *EVP_cast5_ecb(void); | 665 | const EVP_CIPHER *EVP_cast5_ecb(void); |
| 636 | const EVP_CIPHER *EVP_cast5_cbc(void); | 666 | const EVP_CIPHER *EVP_cast5_cbc(void); |
| 637 | const EVP_CIPHER *EVP_cast5_cfb(void); | 667 | const EVP_CIPHER *EVP_cast5_cfb64(void); |
| 668 | # define EVP_cast5_cfb EVP_cast5_cfb64 | ||
| 638 | const EVP_CIPHER *EVP_cast5_ofb(void); | 669 | const EVP_CIPHER *EVP_cast5_ofb(void); |
| 639 | #endif | 670 | #endif |
| 640 | #ifndef OPENSSL_NO_RC5 | 671 | #ifndef OPENSSL_NO_RC5 |
| 641 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); | 672 | const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); |
| 642 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); | 673 | const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); |
| 643 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); | 674 | const EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void); |
| 675 | # define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64 | ||
| 644 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); | 676 | const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); |
| 645 | #endif | 677 | #endif |
| 646 | #ifndef OPENSSL_NO_AES | 678 | #ifndef OPENSSL_NO_AES |
| 647 | const EVP_CIPHER *EVP_aes_128_ecb(void); | 679 | const EVP_CIPHER *EVP_aes_128_ecb(void); |
| 648 | const EVP_CIPHER *EVP_aes_128_cbc(void); | 680 | const EVP_CIPHER *EVP_aes_128_cbc(void); |
| 649 | const EVP_CIPHER *EVP_aes_128_cfb(void); | 681 | const EVP_CIPHER *EVP_aes_128_cfb1(void); |
| 682 | const EVP_CIPHER *EVP_aes_128_cfb8(void); | ||
| 683 | const EVP_CIPHER *EVP_aes_128_cfb128(void); | ||
| 684 | # define EVP_aes_128_cfb EVP_aes_128_cfb128 | ||
| 650 | const EVP_CIPHER *EVP_aes_128_ofb(void); | 685 | const EVP_CIPHER *EVP_aes_128_ofb(void); |
| 651 | #if 0 | 686 | #if 0 |
| 652 | const EVP_CIPHER *EVP_aes_128_ctr(void); | 687 | const EVP_CIPHER *EVP_aes_128_ctr(void); |
| 653 | #endif | 688 | #endif |
| 654 | const EVP_CIPHER *EVP_aes_192_ecb(void); | 689 | const EVP_CIPHER *EVP_aes_192_ecb(void); |
| 655 | const EVP_CIPHER *EVP_aes_192_cbc(void); | 690 | const EVP_CIPHER *EVP_aes_192_cbc(void); |
| 656 | const EVP_CIPHER *EVP_aes_192_cfb(void); | 691 | const EVP_CIPHER *EVP_aes_192_cfb1(void); |
| 692 | const EVP_CIPHER *EVP_aes_192_cfb8(void); | ||
| 693 | const EVP_CIPHER *EVP_aes_192_cfb128(void); | ||
| 694 | # define EVP_aes_192_cfb EVP_aes_192_cfb128 | ||
| 657 | const EVP_CIPHER *EVP_aes_192_ofb(void); | 695 | const EVP_CIPHER *EVP_aes_192_ofb(void); |
| 658 | #if 0 | 696 | #if 0 |
| 659 | const EVP_CIPHER *EVP_aes_192_ctr(void); | 697 | const EVP_CIPHER *EVP_aes_192_ctr(void); |
| 660 | #endif | 698 | #endif |
| 661 | const EVP_CIPHER *EVP_aes_256_ecb(void); | 699 | const EVP_CIPHER *EVP_aes_256_ecb(void); |
| 662 | const EVP_CIPHER *EVP_aes_256_cbc(void); | 700 | const EVP_CIPHER *EVP_aes_256_cbc(void); |
| 663 | const EVP_CIPHER *EVP_aes_256_cfb(void); | 701 | const EVP_CIPHER *EVP_aes_256_cfb1(void); |
| 702 | const EVP_CIPHER *EVP_aes_256_cfb8(void); | ||
| 703 | const EVP_CIPHER *EVP_aes_256_cfb128(void); | ||
| 704 | # define EVP_aes_256_cfb EVP_aes_256_cfb128 | ||
| 664 | const EVP_CIPHER *EVP_aes_256_ofb(void); | 705 | const EVP_CIPHER *EVP_aes_256_ofb(void); |
| 665 | #if 0 | 706 | #if 0 |
| 666 | const EVP_CIPHER *EVP_aes_256_ctr(void); | 707 | const 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 |
