diff options
| author | jsing <> | 2014-04-19 16:44:36 +0000 |
|---|---|---|
| committer | jsing <> | 2014-04-19 16:44:36 +0000 |
| commit | c19c4375e3f8dfc462fa78b0d62b1892f06af5ff (patch) | |
| tree | 49030d3fea9f966297eb3218259a4faca4c52c9f /src/lib/libcrypto/objects/obj_err.c | |
| parent | 62d63a0bed5c92b951099f34597a65065659a1df (diff) | |
| download | openbsd-c19c4375e3f8dfc462fa78b0d62b1892f06af5ff.tar.gz openbsd-c19c4375e3f8dfc462fa78b0d62b1892f06af5ff.tar.bz2 openbsd-c19c4375e3f8dfc462fa78b0d62b1892f06af5ff.zip | |
KNF.
Diffstat (limited to 'src/lib/libcrypto/objects/obj_err.c')
| -rw-r--r-- | src/lib/libcrypto/objects/obj_err.c | 51 |
1 files changed, 24 insertions, 27 deletions
diff --git a/src/lib/libcrypto/objects/obj_err.c b/src/lib/libcrypto/objects/obj_err.c index 2e7a034c3f..47597dbfe4 100644 --- a/src/lib/libcrypto/objects/obj_err.c +++ b/src/lib/libcrypto/objects/obj_err.c | |||
| @@ -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 |
| @@ -68,35 +68,32 @@ | |||
| 68 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_OBJ,func,0) | 68 | #define ERR_FUNC(func) ERR_PACK(ERR_LIB_OBJ,func,0) |
| 69 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_OBJ,0,reason) | 69 | #define ERR_REASON(reason) ERR_PACK(ERR_LIB_OBJ,0,reason) |
| 70 | 70 | ||
| 71 | static ERR_STRING_DATA OBJ_str_functs[]= | 71 | static ERR_STRING_DATA OBJ_str_functs[] = { |
| 72 | { | 72 | {ERR_FUNC(OBJ_F_OBJ_ADD_OBJECT), "OBJ_add_object"}, |
| 73 | {ERR_FUNC(OBJ_F_OBJ_ADD_OBJECT), "OBJ_add_object"}, | 73 | {ERR_FUNC(OBJ_F_OBJ_CREATE), "OBJ_create"}, |
| 74 | {ERR_FUNC(OBJ_F_OBJ_CREATE), "OBJ_create"}, | 74 | {ERR_FUNC(OBJ_F_OBJ_DUP), "OBJ_dup"}, |
| 75 | {ERR_FUNC(OBJ_F_OBJ_DUP), "OBJ_dup"}, | 75 | {ERR_FUNC(OBJ_F_OBJ_NAME_NEW_INDEX), "OBJ_NAME_new_index"}, |
| 76 | {ERR_FUNC(OBJ_F_OBJ_NAME_NEW_INDEX), "OBJ_NAME_new_index"}, | 76 | {ERR_FUNC(OBJ_F_OBJ_NID2LN), "OBJ_nid2ln"}, |
| 77 | {ERR_FUNC(OBJ_F_OBJ_NID2LN), "OBJ_nid2ln"}, | 77 | {ERR_FUNC(OBJ_F_OBJ_NID2OBJ), "OBJ_nid2obj"}, |
| 78 | {ERR_FUNC(OBJ_F_OBJ_NID2OBJ), "OBJ_nid2obj"}, | 78 | {ERR_FUNC(OBJ_F_OBJ_NID2SN), "OBJ_nid2sn"}, |
| 79 | {ERR_FUNC(OBJ_F_OBJ_NID2SN), "OBJ_nid2sn"}, | 79 | {0, NULL} |
| 80 | {0,NULL} | 80 | }; |
| 81 | }; | ||
| 82 | 81 | ||
| 83 | static ERR_STRING_DATA OBJ_str_reasons[]= | 82 | static ERR_STRING_DATA OBJ_str_reasons[] = { |
| 84 | { | 83 | {ERR_REASON(OBJ_R_MALLOC_FAILURE) , "malloc failure"}, |
| 85 | {ERR_REASON(OBJ_R_MALLOC_FAILURE) ,"malloc failure"}, | 84 | {ERR_REASON(OBJ_R_UNKNOWN_NID) , "unknown nid"}, |
| 86 | {ERR_REASON(OBJ_R_UNKNOWN_NID) ,"unknown nid"}, | 85 | {0, NULL} |
| 87 | {0,NULL} | 86 | }; |
| 88 | }; | ||
| 89 | 87 | ||
| 90 | #endif | 88 | #endif |
| 91 | 89 | ||
| 92 | void ERR_load_OBJ_strings(void) | 90 | void |
| 93 | { | 91 | ERR_load_OBJ_strings(void) |
| 92 | { | ||
| 94 | #ifndef OPENSSL_NO_ERR | 93 | #ifndef OPENSSL_NO_ERR |
| 95 | 94 | if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL) { | |
| 96 | if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL) | 95 | ERR_load_strings(0, OBJ_str_functs); |
| 97 | { | 96 | ERR_load_strings(0, OBJ_str_reasons); |
| 98 | ERR_load_strings(0,OBJ_str_functs); | ||
| 99 | ERR_load_strings(0,OBJ_str_reasons); | ||
| 100 | } | ||
| 101 | #endif | ||
| 102 | } | 97 | } |
| 98 | #endif | ||
| 99 | } | ||
