diff options
Diffstat (limited to 'src/lib/libcrypto/engine/tb_store.c')
-rw-r--r-- | src/lib/libcrypto/engine/tb_store.c | 68 |
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 @@ | |||
62 | static ENGINE_TABLE *store_table = NULL; | 62 | static ENGINE_TABLE *store_table = NULL; |
63 | static const int dummy_nid = 1; | 63 | static const int dummy_nid = 1; |
64 | 64 | ||
65 | void ENGINE_unregister_STORE(ENGINE *e) | 65 | void |
66 | { | 66 | ENGINE_unregister_STORE(ENGINE *e) |
67 | { | ||
67 | engine_table_unregister(&store_table, e); | 68 | engine_table_unregister(&store_table, e); |
68 | } | 69 | } |
69 | 70 | ||
70 | static void engine_unregister_all_STORE(void) | 71 | static void |
71 | { | 72 | engine_unregister_all_STORE(void) |
73 | { | ||
72 | engine_table_cleanup(&store_table); | 74 | engine_table_cleanup(&store_table); |
73 | } | 75 | } |
74 | 76 | ||
75 | int ENGINE_register_STORE(ENGINE *e) | 77 | int |
76 | { | 78 | ENGINE_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 | ||
83 | void ENGINE_register_all_STORE(void) | 86 | void |
84 | { | 87 | ENGINE_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 |
93 | int ENGINE_set_default_STORE(ENGINE *e) | 97 | int |
94 | { | 98 | ENGINE_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). */ |
106 | ENGINE *ENGINE_get_default_STORE(void) | 111 | ENGINE * |
107 | { | 112 | ENGINE_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 */ |
113 | const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e) | 119 | const STORE_METHOD * |
114 | { | 120 | ENGINE_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 */ |
119 | int ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth) | 126 | int |
120 | { | 127 | ENGINE_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 | } |