diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/ecdsa/ecs_err.c (renamed from src/lib/libssl/src/fips/fips_err.h) | 66 |
1 files changed, 26 insertions, 40 deletions
diff --git a/src/lib/libssl/src/fips/fips_err.h b/src/lib/libcrypto/ecdsa/ecs_err.c index d643c9f55f..98e38d537f 100644 --- a/src/lib/libssl/src/fips/fips_err.h +++ b/src/lib/libcrypto/ecdsa/ecs_err.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* fips/fips_err.h */ | 1 | /* crypto/ecdsa/ecs_err.c */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1999-2003 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions | 6 | * modification, are permitted provided that the following conditions |
| @@ -60,59 +60,45 @@ | |||
| 60 | 60 | ||
| 61 | #include <stdio.h> | 61 | #include <stdio.h> |
| 62 | #include <openssl/err.h> | 62 | #include <openssl/err.h> |
| 63 | #include <openssl/fips.h> | 63 | #include <openssl/ecdsa.h> |
| 64 | 64 | ||
| 65 | /* BEGIN ERROR CODES */ | 65 | /* BEGIN ERROR CODES */ |
| 66 | #ifndef OPENSSL_NO_ERR | 66 | #ifndef OPENSSL_NO_ERR |
| 67 | static ERR_STRING_DATA FIPS_str_functs[]= | 67 | |
| 68 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECDSA,func,0) | ||
| 69 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECDSA,0,reason) | ||
| 70 | |||
| 71 | static ERR_STRING_DATA ECDSA_str_functs[]= | ||
| 68 | { | 72 | { |
| 69 | {ERR_PACK(0,FIPS_F_DSA_DO_SIGN,0), "DSA_do_sign"}, | 73 | {ERR_FUNC(ECDSA_F_ECDSA_DATA_NEW_METHOD), "ECDSA_DATA_NEW_METHOD"}, |
| 70 | {ERR_PACK(0,FIPS_F_DSA_DO_VERIFY,0), "DSA_do_verify"}, | 74 | {ERR_FUNC(ECDSA_F_ECDSA_DO_SIGN), "ECDSA_do_sign"}, |
| 71 | {ERR_PACK(0,FIPS_F_DSA_GENERATE_PARAMETERS,0), "DSA_generate_parameters"}, | 75 | {ERR_FUNC(ECDSA_F_ECDSA_DO_VERIFY), "ECDSA_do_verify"}, |
| 72 | {ERR_PACK(0,FIPS_F_FIPS_CHECK_DSA,0), "FIPS_CHECK_DSA"}, | 76 | {ERR_FUNC(ECDSA_F_ECDSA_SIGN_SETUP), "ECDSA_sign_setup"}, |
| 73 | {ERR_PACK(0,FIPS_F_FIPS_CHECK_EXE,0), "FIPS_CHECK_EXE"}, | ||
| 74 | {ERR_PACK(0,FIPS_F_FIPS_CHECK_RSA,0), "FIPS_CHECK_RSA"}, | ||
| 75 | {ERR_PACK(0,FIPS_F_FIPS_DSA_CHECK,0), "FIPS_dsa_check"}, | ||
| 76 | {ERR_PACK(0,FIPS_F_FIPS_MODE_SET,0), "FIPS_mode_set"}, | ||
| 77 | {ERR_PACK(0,FIPS_F_FIPS_SELFTEST_AES,0), "FIPS_selftest_aes"}, | ||
| 78 | {ERR_PACK(0,FIPS_F_FIPS_SELFTEST_DES,0), "FIPS_selftest_des"}, | ||
| 79 | {ERR_PACK(0,FIPS_F_FIPS_SELFTEST_DSA,0), "FIPS_selftest_dsa"}, | ||
| 80 | {ERR_PACK(0,FIPS_F_FIPS_SELFTEST_RSA,0), "FIPS_selftest_rsa"}, | ||
| 81 | {ERR_PACK(0,FIPS_F_FIPS_SELFTEST_SHA1,0), "FIPS_selftest_sha1"}, | ||
| 82 | {ERR_PACK(0,FIPS_F_HASH_FINAL,0), "HASH_FINAL"}, | ||
| 83 | {ERR_PACK(0,FIPS_F_DH_GENERATE_PARAMETERS,0), "DH_generate_parameters"}, | ||
| 84 | {ERR_PACK(0,FIPS_F_RSA_EAY_PUBLIC_ENCRYPT,0), "RSA_EAY_PUBLIC_ENCRYPT"}, | ||
| 85 | {ERR_PACK(0,FIPS_F_RSA_GENERATE_KEY,0), "RSA_generate_key"}, | ||
| 86 | {ERR_PACK(0,FIPS_F_SSLEAY_RAND_BYTES,0), "SSLEAY_RAND_BYTES"}, | ||
| 87 | {0,NULL} | 77 | {0,NULL} |
| 88 | }; | 78 | }; |
| 89 | 79 | ||
| 90 | static ERR_STRING_DATA FIPS_str_reasons[]= | 80 | static ERR_STRING_DATA ECDSA_str_reasons[]= |
| 91 | { | 81 | { |
| 92 | {FIPS_R_CANNOT_READ_EXE ,"cannot read exe"}, | 82 | {ERR_REASON(ECDSA_R_BAD_SIGNATURE) ,"bad signature"}, |
| 93 | {FIPS_R_CANNOT_READ_EXE_DIGEST ,"cannot read exe digest"}, | 83 | {ERR_REASON(ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),"data too large for key size"}, |
| 94 | {FIPS_R_EXE_DIGEST_DOES_NOT_MATCH ,"exe digest does not match"}, | 84 | {ERR_REASON(ECDSA_R_ERR_EC_LIB) ,"err ec lib"}, |
| 95 | {FIPS_R_FIPS_MODE_ALREADY_SET ,"fips mode already set"}, | 85 | {ERR_REASON(ECDSA_R_MISSING_PARAMETERS) ,"missing parameters"}, |
| 96 | {FIPS_R_FIPS_SELFTEST_FAILED ,"fips selftest failed"}, | 86 | {ERR_REASON(ECDSA_R_NEED_NEW_SETUP_VALUES),"need new setup values"}, |
| 97 | {FIPS_R_NON_FIPS_METHOD ,"non fips method"}, | 87 | {ERR_REASON(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED),"random number generation failed"}, |
| 98 | {FIPS_R_PAIRWISE_TEST_FAILED ,"pairwise test failed"}, | 88 | {ERR_REASON(ECDSA_R_SIGNATURE_MALLOC_FAILED),"signature malloc failed"}, |
| 99 | {FIPS_R_SELFTEST_FAILED ,"selftest failed"}, | ||
| 100 | {0,NULL} | 89 | {0,NULL} |
| 101 | }; | 90 | }; |
| 102 | 91 | ||
| 103 | #endif | 92 | #endif |
| 104 | 93 | ||
| 105 | void ERR_load_FIPS_strings(void) | 94 | void ERR_load_ECDSA_strings(void) |
| 106 | { | 95 | { |
| 107 | static int init=1; | ||
| 108 | |||
| 109 | if (init) | ||
| 110 | { | ||
| 111 | init=0; | ||
| 112 | #ifndef OPENSSL_NO_ERR | 96 | #ifndef OPENSSL_NO_ERR |
| 113 | ERR_load_strings(ERR_LIB_FIPS,FIPS_str_functs); | ||
| 114 | ERR_load_strings(ERR_LIB_FIPS,FIPS_str_reasons); | ||
| 115 | #endif | ||
| 116 | 97 | ||
| 98 | if (ERR_func_error_string(ECDSA_str_functs[0].error) == NULL) | ||
| 99 | { | ||
| 100 | ERR_load_strings(0,ECDSA_str_functs); | ||
| 101 | ERR_load_strings(0,ECDSA_str_reasons); | ||
| 117 | } | 102 | } |
| 103 | #endif | ||
| 118 | } | 104 | } |
