diff options
author | jsing <> | 2015-02-08 13:35:07 +0000 |
---|---|---|
committer | jsing <> | 2015-02-08 13:35:07 +0000 |
commit | 726b51738f080413928933335c86b6b01cf96864 (patch) | |
tree | 5a291cb11bb8d4fde0d4d335440fe8cad504b4c4 /src/lib/libcrypto/ecdsa/ecs_err.c | |
parent | f5656e5948afd96eceeae5f83939965ba96edc28 (diff) | |
download | openbsd-726b51738f080413928933335c86b6b01cf96864.tar.gz openbsd-726b51738f080413928933335c86b6b01cf96864.tar.bz2 openbsd-726b51738f080413928933335c86b6b01cf96864.zip |
Lob a KNF grenade into the ecdsa code.
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/ecdsa/ecs_err.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_err.c b/src/lib/libcrypto/ecdsa/ecs_err.c index 721b53c3f4..26efc135e3 100644 --- a/src/lib/libcrypto/ecdsa/ecs_err.c +++ b/src/lib/libcrypto/ecdsa/ecs_err.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecs_err.c,v 1.3 2014/07/10 22:45:57 jsing Exp $ */ | 1 | /* $OpenBSD: ecs_err.c,v 1.4 2015/02/08 13:35:07 jsing Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -7,7 +7,7 @@ | |||
7 | * are met: | 7 | * are met: |
8 | * | 8 | * |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * | 11 | * |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in | 13 | * notice, this list of conditions and the following disclaimer in |
@@ -71,39 +71,36 @@ | |||
71 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECDSA,func,0) | 71 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECDSA,func,0) |
72 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECDSA,0,reason) | 72 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECDSA,0,reason) |
73 | 73 | ||
74 | static ERR_STRING_DATA ECDSA_str_functs[]= | 74 | static ERR_STRING_DATA ECDSA_str_functs[]= { |
75 | { | 75 | {ERR_FUNC(ECDSA_F_ECDSA_CHECK), "ECDSA_CHECK"}, |
76 | {ERR_FUNC(ECDSA_F_ECDSA_CHECK), "ECDSA_CHECK"}, | 76 | {ERR_FUNC(ECDSA_F_ECDSA_DATA_NEW_METHOD), "ECDSA_DATA_NEW_METHOD"}, |
77 | {ERR_FUNC(ECDSA_F_ECDSA_DATA_NEW_METHOD), "ECDSA_DATA_NEW_METHOD"}, | 77 | {ERR_FUNC(ECDSA_F_ECDSA_DO_SIGN), "ECDSA_do_sign"}, |
78 | {ERR_FUNC(ECDSA_F_ECDSA_DO_SIGN), "ECDSA_do_sign"}, | 78 | {ERR_FUNC(ECDSA_F_ECDSA_DO_VERIFY), "ECDSA_do_verify"}, |
79 | {ERR_FUNC(ECDSA_F_ECDSA_DO_VERIFY), "ECDSA_do_verify"}, | 79 | {ERR_FUNC(ECDSA_F_ECDSA_SIGN_SETUP), "ECDSA_sign_setup"}, |
80 | {ERR_FUNC(ECDSA_F_ECDSA_SIGN_SETUP), "ECDSA_sign_setup"}, | 80 | {0, NULL} |
81 | {0,NULL} | 81 | }; |
82 | }; | ||
83 | 82 | ||
84 | static ERR_STRING_DATA ECDSA_str_reasons[]= | 83 | static ERR_STRING_DATA ECDSA_str_reasons[]= { |
85 | { | 84 | {ERR_REASON(ECDSA_R_BAD_SIGNATURE) , "bad signature"}, |
86 | {ERR_REASON(ECDSA_R_BAD_SIGNATURE) ,"bad signature"}, | 85 | {ERR_REASON(ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE), "data too large for key size"}, |
87 | {ERR_REASON(ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),"data too large for key size"}, | 86 | {ERR_REASON(ECDSA_R_ERR_EC_LIB) , "err ec lib"}, |
88 | {ERR_REASON(ECDSA_R_ERR_EC_LIB) ,"err ec lib"}, | 87 | {ERR_REASON(ECDSA_R_MISSING_PARAMETERS) , "missing parameters"}, |
89 | {ERR_REASON(ECDSA_R_MISSING_PARAMETERS) ,"missing parameters"}, | 88 | {ERR_REASON(ECDSA_R_NEED_NEW_SETUP_VALUES), "need new setup values"}, |
90 | {ERR_REASON(ECDSA_R_NEED_NEW_SETUP_VALUES),"need new setup values"}, | 89 | {ERR_REASON(ECDSA_R_NON_FIPS_METHOD) , "non fips method"}, |
91 | {ERR_REASON(ECDSA_R_NON_FIPS_METHOD) ,"non fips method"}, | 90 | {ERR_REASON(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED), "random number generation failed"}, |
92 | {ERR_REASON(ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED),"random number generation failed"}, | 91 | {ERR_REASON(ECDSA_R_SIGNATURE_MALLOC_FAILED), "signature malloc failed"}, |
93 | {ERR_REASON(ECDSA_R_SIGNATURE_MALLOC_FAILED),"signature malloc failed"}, | 92 | {0, NULL} |
94 | {0,NULL} | 93 | }; |
95 | }; | ||
96 | 94 | ||
97 | #endif | 95 | #endif |
98 | 96 | ||
99 | void ERR_load_ECDSA_strings(void) | 97 | void |
100 | { | 98 | ERR_load_ECDSA_strings(void) |
99 | { | ||
101 | #ifndef OPENSSL_NO_ERR | 100 | #ifndef OPENSSL_NO_ERR |
102 | 101 | if (ERR_func_error_string(ECDSA_str_functs[0].error) == NULL) { | |
103 | if (ERR_func_error_string(ECDSA_str_functs[0].error) == NULL) | 102 | ERR_load_strings(0, ECDSA_str_functs); |
104 | { | 103 | ERR_load_strings(0, ECDSA_str_reasons); |
105 | ERR_load_strings(0,ECDSA_str_functs); | ||
106 | ERR_load_strings(0,ECDSA_str_reasons); | ||
107 | } | ||
108 | #endif | ||
109 | } | 104 | } |
105 | #endif | ||
106 | } | ||