summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/objects/obj_err.c
diff options
context:
space:
mode:
authorjsing <>2014-04-19 16:44:36 +0000
committerjsing <>2014-04-19 16:44:36 +0000
commita267d032e2aaa6ac481f33615c9e57c613d49e2e (patch)
tree49030d3fea9f966297eb3218259a4faca4c52c9f /src/lib/libcrypto/objects/obj_err.c
parenta21c0bb00d07d5263cf88747b598ac88a87d65ec (diff)
downloadopenbsd-a267d032e2aaa6ac481f33615c9e57c613d49e2e.tar.gz
openbsd-a267d032e2aaa6ac481f33615c9e57c613d49e2e.tar.bz2
openbsd-a267d032e2aaa6ac481f33615c9e57c613d49e2e.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/objects/obj_err.c')
-rw-r--r--src/lib/libcrypto/objects/obj_err.c51
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
71static ERR_STRING_DATA OBJ_str_functs[]= 71static 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
83static ERR_STRING_DATA OBJ_str_reasons[]= 82static 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
92void ERR_load_OBJ_strings(void) 90void
93 { 91ERR_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}