summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/store/str_meth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/store/str_meth.c')
-rw-r--r--src/lib/libcrypto/store/str_meth.c295
1 files changed, 0 insertions, 295 deletions
diff --git a/src/lib/libcrypto/store/str_meth.c b/src/lib/libcrypto/store/str_meth.c
deleted file mode 100644
index 9d7c5ed98d..0000000000
--- a/src/lib/libcrypto/store/str_meth.c
+++ /dev/null
@@ -1,295 +0,0 @@
1/* $OpenBSD: str_meth.c,v 1.7 2014/07/22 02:21:20 beck Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2003.
4 */
5/* ====================================================================
6 * Copyright (c) 2003 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * openssl-core@openssl.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58
59#include <string.h>
60#include <openssl/buffer.h>
61#include "str_locl.h"
62
63STORE_METHOD *
64STORE_create_method(char *name)
65{
66 STORE_METHOD *store_method = calloc(1, sizeof(STORE_METHOD));
67
68 if (store_method && name)
69 store_method->name = strdup(name);
70
71 return store_method;
72}
73
74/* BIG FSCKING WARNING!!!! If you use this on a statically allocated method
75 (that is, it hasn't been allocated using STORE_create_method(), you deserve
76 anything Murphy can throw at you and more! You have been warned. */
77void
78STORE_destroy_method(STORE_METHOD *store_method)
79{
80 if (!store_method)
81 return;
82 free(store_method->name);
83 store_method->name = NULL;
84 free(store_method);
85}
86
87int
88STORE_method_set_initialise_function(STORE_METHOD *sm,
89 STORE_INITIALISE_FUNC_PTR init_f)
90{
91 sm->init = init_f;
92 return 1;
93}
94
95int
96STORE_method_set_cleanup_function(STORE_METHOD *sm,
97 STORE_CLEANUP_FUNC_PTR clean_f)
98{
99 sm->clean = clean_f;
100 return 1;
101}
102
103int
104STORE_method_set_generate_function(STORE_METHOD *sm,
105 STORE_GENERATE_OBJECT_FUNC_PTR generate_f)
106{
107 sm->generate_object = generate_f;
108 return 1;
109}
110
111int
112STORE_method_set_get_function(STORE_METHOD *sm,
113 STORE_GET_OBJECT_FUNC_PTR get_f)
114{
115 sm->get_object = get_f;
116 return 1;
117}
118
119int
120STORE_method_set_store_function(STORE_METHOD *sm,
121 STORE_STORE_OBJECT_FUNC_PTR store_f)
122{
123 sm->store_object = store_f;
124 return 1;
125}
126
127int
128STORE_method_set_modify_function(STORE_METHOD *sm,
129 STORE_MODIFY_OBJECT_FUNC_PTR modify_f)
130{
131 sm->modify_object = modify_f;
132 return 1;
133}
134
135int
136STORE_method_set_revoke_function(STORE_METHOD *sm,
137 STORE_HANDLE_OBJECT_FUNC_PTR revoke_f)
138{
139 sm->revoke_object = revoke_f;
140 return 1;
141}
142
143int
144STORE_method_set_delete_function(STORE_METHOD *sm,
145 STORE_HANDLE_OBJECT_FUNC_PTR delete_f)
146{
147 sm->delete_object = delete_f;
148 return 1;
149}
150
151int
152STORE_method_set_list_start_function(STORE_METHOD *sm,
153 STORE_START_OBJECT_FUNC_PTR list_start_f)
154{
155 sm->list_object_start = list_start_f;
156 return 1;
157}
158
159int
160STORE_method_set_list_next_function(STORE_METHOD *sm,
161 STORE_NEXT_OBJECT_FUNC_PTR list_next_f)
162{
163 sm->list_object_next = list_next_f;
164 return 1;
165}
166
167int
168STORE_method_set_list_end_function(STORE_METHOD *sm,
169 STORE_END_OBJECT_FUNC_PTR list_end_f)
170{
171 sm->list_object_end = list_end_f;
172 return 1;
173}
174
175int
176STORE_method_set_update_store_function(STORE_METHOD *sm,
177 STORE_GENERIC_FUNC_PTR update_f)
178{
179 sm->update_store = update_f;
180 return 1;
181}
182
183int
184STORE_method_set_lock_store_function(STORE_METHOD *sm,
185 STORE_GENERIC_FUNC_PTR lock_f)
186{
187 sm->lock_store = lock_f;
188 return 1;
189}
190
191int
192STORE_method_set_unlock_store_function(STORE_METHOD *sm,
193 STORE_GENERIC_FUNC_PTR unlock_f)
194{
195 sm->unlock_store = unlock_f;
196 return 1;
197}
198
199int
200STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f)
201{
202 sm->ctrl = ctrl_f;
203 return 1;
204}
205
206STORE_INITIALISE_FUNC_PTR
207STORE_method_get_initialise_function(STORE_METHOD *sm)
208{
209 return sm->init;
210}
211
212STORE_CLEANUP_FUNC_PTR
213STORE_method_get_cleanup_function(STORE_METHOD *sm)
214{
215 return sm->clean;
216}
217
218STORE_GENERATE_OBJECT_FUNC_PTR
219STORE_method_get_generate_function(STORE_METHOD *sm)
220{
221 return sm->generate_object;
222}
223
224STORE_GET_OBJECT_FUNC_PTR
225STORE_method_get_get_function(STORE_METHOD *sm)
226{
227 return sm->get_object;
228}
229
230STORE_STORE_OBJECT_FUNC_PTR
231STORE_method_get_store_function(STORE_METHOD *sm)
232{
233 return sm->store_object;
234}
235
236STORE_MODIFY_OBJECT_FUNC_PTR
237STORE_method_get_modify_function(STORE_METHOD *sm)
238{
239 return sm->modify_object;
240}
241
242STORE_HANDLE_OBJECT_FUNC_PTR
243STORE_method_get_revoke_function(STORE_METHOD *sm)
244{
245 return sm->revoke_object;
246}
247
248STORE_HANDLE_OBJECT_FUNC_PTR
249STORE_method_get_delete_function(STORE_METHOD *sm)
250{
251 return sm->delete_object;
252}
253
254STORE_START_OBJECT_FUNC_PTR
255STORE_method_get_list_start_function(STORE_METHOD *sm)
256{
257 return sm->list_object_start;
258}
259
260STORE_NEXT_OBJECT_FUNC_PTR
261STORE_method_get_list_next_function(STORE_METHOD *sm)
262{
263 return sm->list_object_next;
264}
265
266STORE_END_OBJECT_FUNC_PTR
267STORE_method_get_list_end_function(STORE_METHOD *sm)
268{
269 return sm->list_object_end;
270}
271
272STORE_GENERIC_FUNC_PTR
273STORE_method_get_update_store_function(STORE_METHOD *sm)
274{
275 return sm->update_store;
276}
277
278STORE_GENERIC_FUNC_PTR
279STORE_method_get_lock_store_function(STORE_METHOD *sm)
280{
281 return sm->lock_store;
282}
283
284STORE_GENERIC_FUNC_PTR
285STORE_method_get_unlock_store_function(STORE_METHOD *sm)
286{
287 return sm->unlock_store;
288}
289
290STORE_CTRL_FUNC_PTR
291STORE_method_get_ctrl_function(STORE_METHOD *sm)
292{
293 return sm->ctrl;
294}
295