summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/tb_store.c
diff options
context:
space:
mode:
authorjsing <>2014-06-10 14:56:02 +0000
committerjsing <>2014-06-10 14:56:02 +0000
commit3d34b57814cfdc90c98c015ae0dbd3c1862c83cd (patch)
treed8941695c82ed288c91b99b76a5a19ac06596dd7 /src/lib/libcrypto/engine/tb_store.c
parent4ddb3c431a24f55e2e20d36bbcefaf3ab168082d (diff)
downloadopenbsd-3d34b57814cfdc90c98c015ae0dbd3c1862c83cd.tar.gz
openbsd-3d34b57814cfdc90c98c015ae0dbd3c1862c83cd.tar.bz2
openbsd-3d34b57814cfdc90c98c015ae0dbd3c1862c83cd.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/engine/tb_store.c')
-rw-r--r--src/lib/libcrypto/engine/tb_store.c68
1 files changed, 38 insertions, 30 deletions
diff --git a/src/lib/libcrypto/engine/tb_store.c b/src/lib/libcrypto/engine/tb_store.c
index bd853733ea..81b3f7b27e 100644
--- a/src/lib/libcrypto/engine/tb_store.c
+++ b/src/lib/libcrypto/engine/tb_store.c
@@ -6,7 +6,7 @@
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in 12 * notice, this list of conditions and the following disclaimer in
@@ -62,62 +62,70 @@
62static ENGINE_TABLE *store_table = NULL; 62static ENGINE_TABLE *store_table = NULL;
63static const int dummy_nid = 1; 63static const int dummy_nid = 1;
64 64
65void ENGINE_unregister_STORE(ENGINE *e) 65void
66 { 66ENGINE_unregister_STORE(ENGINE *e)
67{
67 engine_table_unregister(&store_table, e); 68 engine_table_unregister(&store_table, e);
68 } 69}
69 70
70static void engine_unregister_all_STORE(void) 71static void
71 { 72engine_unregister_all_STORE(void)
73{
72 engine_table_cleanup(&store_table); 74 engine_table_cleanup(&store_table);
73 } 75}
74 76
75int ENGINE_register_STORE(ENGINE *e) 77int
76 { 78ENGINE_register_STORE(ENGINE *e)
77 if(e->store_meth) 79{
80 if (e->store_meth)
78 return engine_table_register(&store_table, 81 return engine_table_register(&store_table,
79 engine_unregister_all_STORE, e, &dummy_nid, 1, 0); 82 engine_unregister_all_STORE, e, &dummy_nid, 1, 0);
80 return 1; 83 return 1;
81 } 84}
82 85
83void ENGINE_register_all_STORE(void) 86void
84 { 87ENGINE_register_all_STORE(void)
88{
85 ENGINE *e; 89 ENGINE *e;
86 90
87 for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e)) 91 for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
88 ENGINE_register_STORE(e); 92 ENGINE_register_STORE(e);
89 } 93}
90 94
91/* The following two functions are removed because they're useless. */ 95/* The following two functions are removed because they're useless. */
92#if 0 96#if 0
93int ENGINE_set_default_STORE(ENGINE *e) 97int
94 { 98ENGINE_set_default_STORE(ENGINE *e)
95 if(e->store_meth) 99{
100 if (e->store_meth)
96 return engine_table_register(&store_table, 101 return engine_table_register(&store_table,
97 engine_unregister_all_STORE, e, &dummy_nid, 1, 1); 102 engine_unregister_all_STORE, e, &dummy_nid, 1, 1);
98 return 1; 103 return 1;
99 } 104}
100#endif 105#endif
101 106
102#if 0 107#if 0
103/* Exposed API function to get a functional reference from the implementation 108/* Exposed API function to get a functional reference from the implementation
104 * table (ie. try to get a functional reference from the tabled structural 109 * table (ie. try to get a functional reference from the tabled structural
105 * references). */ 110 * references). */
106ENGINE *ENGINE_get_default_STORE(void) 111ENGINE *
107 { 112ENGINE_get_default_STORE(void)
113{
108 return engine_table_select(&store_table, dummy_nid); 114 return engine_table_select(&store_table, dummy_nid);
109 } 115}
110#endif 116#endif
111 117
112/* Obtains an STORE implementation from an ENGINE functional reference */ 118/* Obtains an STORE implementation from an ENGINE functional reference */
113const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e) 119const STORE_METHOD *
114 { 120ENGINE_get_STORE(const ENGINE *e)
121{
115 return e->store_meth; 122 return e->store_meth;
116 } 123}
117 124
118/* Sets an STORE implementation in an ENGINE structure */ 125/* Sets an STORE implementation in an ENGINE structure */
119int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth) 126int
120 { 127ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth)
128{
121 e->store_meth = store_meth; 129 e->store_meth = store_meth;
122 return 1; 130 return 1;
123 } 131}