1 /*
2  * Copyright (C) 2017 Nikos Mavrogiannopoulos
3  *
4  * Author: Nikos Mavrogiannopoulos
5  *
6  * This file is part of GnuTLS.
7  *
8  * The GnuTLS is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>
20  *
21  */
22 
23 /* This file contains the definitions of OpenPGP stub functions
24  * for ABI compatibility.
25  */
26 
27 #include "gnutls_int.h"
28 #include <gnutls/openpgp.h>
29 #include <gnutls/abstract.h>
30 
gnutls_openpgp_crt_init(gnutls_openpgp_crt_t * key)31 int gnutls_openpgp_crt_init(gnutls_openpgp_crt_t * key)
32 {
33 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
34 }
35 
gnutls_openpgp_crt_deinit(gnutls_openpgp_crt_t key)36 void gnutls_openpgp_crt_deinit(gnutls_openpgp_crt_t key)
37 {
38 	return;
39 }
40 
gnutls_openpgp_crt_import(gnutls_openpgp_crt_t key,const gnutls_datum_t * data,gnutls_openpgp_crt_fmt_t format)41 int gnutls_openpgp_crt_import(gnutls_openpgp_crt_t key,
42 			      const gnutls_datum_t * data,
43 			      gnutls_openpgp_crt_fmt_t format)
44 {
45 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
46 }
47 
gnutls_openpgp_crt_export(gnutls_openpgp_crt_t key,gnutls_openpgp_crt_fmt_t format,void * output_data,size_t * output_data_size)48 int gnutls_openpgp_crt_export(gnutls_openpgp_crt_t key,
49 			      gnutls_openpgp_crt_fmt_t format,
50 			      void *output_data,
51 			      size_t * output_data_size)
52 {
53 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
54 }
55 
gnutls_openpgp_crt_export2(gnutls_openpgp_crt_t key,gnutls_openpgp_crt_fmt_t format,gnutls_datum_t * out)56 int gnutls_openpgp_crt_export2(gnutls_openpgp_crt_t key,
57 			       gnutls_openpgp_crt_fmt_t format,
58 			       gnutls_datum_t * out)
59 {
60 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
61 }
62 
63 
gnutls_openpgp_crt_print(gnutls_openpgp_crt_t cert,gnutls_certificate_print_formats_t format,gnutls_datum_t * out)64 int gnutls_openpgp_crt_print(gnutls_openpgp_crt_t cert,
65 			     gnutls_certificate_print_formats_t
66 			     format, gnutls_datum_t * out)
67 {
68 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
69 }
70 
71 
gnutls_openpgp_crt_get_key_usage(gnutls_openpgp_crt_t key,unsigned int * key_usage)72 int gnutls_openpgp_crt_get_key_usage(gnutls_openpgp_crt_t key,
73 				     unsigned int *key_usage)
74 {
75 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
76 }
77 
gnutls_openpgp_crt_get_fingerprint(gnutls_openpgp_crt_t key,void * fpr,size_t * fprlen)78 int gnutls_openpgp_crt_get_fingerprint(gnutls_openpgp_crt_t key,
79 				       void *fpr, size_t * fprlen)
80 {
81 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
82 }
83 
gnutls_openpgp_crt_get_subkey_fingerprint(gnutls_openpgp_crt_t key,unsigned int idx,void * fpr,size_t * fprlen)84 int gnutls_openpgp_crt_get_subkey_fingerprint(gnutls_openpgp_crt_t
85 					      key,
86 					      unsigned int idx,
87 					      void *fpr, size_t * fprlen)
88 {
89 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
90 }
91 
92 
gnutls_openpgp_crt_get_name(gnutls_openpgp_crt_t key,int idx,char * buf,size_t * sizeof_buf)93 int gnutls_openpgp_crt_get_name(gnutls_openpgp_crt_t key,
94 				int idx, char *buf, size_t * sizeof_buf)
95 {
96 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
97 }
98 
99 
100 gnutls_pk_algorithm_t
gnutls_openpgp_crt_get_pk_algorithm(gnutls_openpgp_crt_t key,unsigned int * bits)101 gnutls_openpgp_crt_get_pk_algorithm(gnutls_openpgp_crt_t key,
102 				    unsigned int *bits)
103 {
104 	return GNUTLS_PK_UNKNOWN;
105 }
106 
107 
gnutls_openpgp_crt_get_version(gnutls_openpgp_crt_t key)108 int gnutls_openpgp_crt_get_version(gnutls_openpgp_crt_t key)
109 {
110 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
111 }
112 
113 
gnutls_openpgp_crt_get_creation_time(gnutls_openpgp_crt_t key)114 time_t gnutls_openpgp_crt_get_creation_time(gnutls_openpgp_crt_t key)
115 {
116 	return (time_t)-1;
117 }
118 
gnutls_openpgp_crt_get_expiration_time(gnutls_openpgp_crt_t key)119 time_t gnutls_openpgp_crt_get_expiration_time(gnutls_openpgp_crt_t key)
120 {
121 	return (time_t)-1;
122 }
123 
124 
gnutls_openpgp_crt_get_key_id(gnutls_openpgp_crt_t key,gnutls_openpgp_keyid_t keyid)125 int gnutls_openpgp_crt_get_key_id(gnutls_openpgp_crt_t key,
126 				  gnutls_openpgp_keyid_t keyid)
127 {
128 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
129 }
130 
131 
gnutls_openpgp_crt_check_hostname(gnutls_openpgp_crt_t key,const char * hostname)132 int gnutls_openpgp_crt_check_hostname(gnutls_openpgp_crt_t key,
133 				      const char *hostname)
134 {
135 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
136 }
137 
gnutls_openpgp_crt_check_hostname2(gnutls_openpgp_crt_t key,const char * hostname,unsigned int flags)138 int gnutls_openpgp_crt_check_hostname2(gnutls_openpgp_crt_t key,
139 				      const char *hostname, unsigned int flags)
140 {
141 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
142 }
143 
144 int
gnutls_openpgp_crt_check_email(gnutls_openpgp_crt_t key,const char * email,unsigned flags)145 gnutls_openpgp_crt_check_email(gnutls_openpgp_crt_t key, const char *email, unsigned flags)
146 {
147 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
148 }
149 
150 
gnutls_openpgp_crt_get_revoked_status(gnutls_openpgp_crt_t key)151 int gnutls_openpgp_crt_get_revoked_status(gnutls_openpgp_crt_t key)
152 {
153 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
154 }
155 
156 
gnutls_openpgp_crt_get_subkey_count(gnutls_openpgp_crt_t key)157 int gnutls_openpgp_crt_get_subkey_count(gnutls_openpgp_crt_t key)
158 {
159 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
160 }
161 
gnutls_openpgp_crt_get_subkey_idx(gnutls_openpgp_crt_t key,const gnutls_openpgp_keyid_t keyid)162 int gnutls_openpgp_crt_get_subkey_idx(gnutls_openpgp_crt_t key,
163 				      const gnutls_openpgp_keyid_t keyid)
164 {
165 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
166 }
167 
gnutls_openpgp_crt_get_subkey_revoked_status(gnutls_openpgp_crt_t key,unsigned int idx)168 int gnutls_openpgp_crt_get_subkey_revoked_status
169     (gnutls_openpgp_crt_t key, unsigned int idx)
170 {
171 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
172 }
173 
174 gnutls_pk_algorithm_t
gnutls_openpgp_crt_get_subkey_pk_algorithm(gnutls_openpgp_crt_t key,unsigned int idx,unsigned int * bits)175 gnutls_openpgp_crt_get_subkey_pk_algorithm(gnutls_openpgp_crt_t
176 					   key,
177 					   unsigned int idx,
178 					   unsigned int *bits)
179 {
180 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
181 }
182 
183 time_t
gnutls_openpgp_crt_get_subkey_creation_time(gnutls_openpgp_crt_t key,unsigned int idx)184     gnutls_openpgp_crt_get_subkey_creation_time
185     (gnutls_openpgp_crt_t key, unsigned int idx)
186 {
187 	return (time_t)-1;
188 }
189 
190 time_t
gnutls_openpgp_crt_get_subkey_expiration_time(gnutls_openpgp_crt_t key,unsigned int idx)191     gnutls_openpgp_crt_get_subkey_expiration_time
192     (gnutls_openpgp_crt_t key, unsigned int idx)
193 {
194 	return (time_t)-1;
195 }
196 
gnutls_openpgp_crt_get_subkey_id(gnutls_openpgp_crt_t key,unsigned int idx,gnutls_openpgp_keyid_t keyid)197 int gnutls_openpgp_crt_get_subkey_id(gnutls_openpgp_crt_t key,
198 				     unsigned int idx,
199 				     gnutls_openpgp_keyid_t keyid)
200 {
201 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
202 }
203 
gnutls_openpgp_crt_get_subkey_usage(gnutls_openpgp_crt_t key,unsigned int idx,unsigned int * key_usage)204 int gnutls_openpgp_crt_get_subkey_usage(gnutls_openpgp_crt_t key,
205 					unsigned int idx,
206 					unsigned int *key_usage)
207 {
208 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
209 }
210 
211 
gnutls_openpgp_crt_get_subkey_pk_dsa_raw(gnutls_openpgp_crt_t crt,unsigned int idx,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * g,gnutls_datum_t * y)212 int gnutls_openpgp_crt_get_subkey_pk_dsa_raw(gnutls_openpgp_crt_t
213 					     crt, unsigned int idx,
214 					     gnutls_datum_t * p,
215 					     gnutls_datum_t * q,
216 					     gnutls_datum_t * g,
217 					     gnutls_datum_t * y)
218 {
219 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
220 }
221 
gnutls_openpgp_crt_get_subkey_pk_rsa_raw(gnutls_openpgp_crt_t crt,unsigned int idx,gnutls_datum_t * m,gnutls_datum_t * e)222 int gnutls_openpgp_crt_get_subkey_pk_rsa_raw(gnutls_openpgp_crt_t
223 					     crt, unsigned int idx,
224 					     gnutls_datum_t * m,
225 					     gnutls_datum_t * e)
226 {
227 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
228 }
229 
gnutls_openpgp_crt_get_pk_dsa_raw(gnutls_openpgp_crt_t crt,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * g,gnutls_datum_t * y)230 int gnutls_openpgp_crt_get_pk_dsa_raw(gnutls_openpgp_crt_t crt,
231 				      gnutls_datum_t * p,
232 				      gnutls_datum_t * q,
233 				      gnutls_datum_t * g,
234 				      gnutls_datum_t * y)
235 {
236 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
237 }
238 
gnutls_openpgp_crt_get_pk_rsa_raw(gnutls_openpgp_crt_t crt,gnutls_datum_t * m,gnutls_datum_t * e)239 int gnutls_openpgp_crt_get_pk_rsa_raw(gnutls_openpgp_crt_t crt,
240 				      gnutls_datum_t * m,
241 				      gnutls_datum_t * e)
242 {
243 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
244 }
245 
246 
gnutls_openpgp_crt_get_preferred_key_id(gnutls_openpgp_crt_t key,gnutls_openpgp_keyid_t keyid)247 int gnutls_openpgp_crt_get_preferred_key_id(gnutls_openpgp_crt_t
248 					    key,
249 					    gnutls_openpgp_keyid_t keyid)
250 {
251 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
252 }
253 
254 int
gnutls_openpgp_crt_set_preferred_key_id(gnutls_openpgp_crt_t key,const gnutls_openpgp_keyid_t keyid)255 gnutls_openpgp_crt_set_preferred_key_id(gnutls_openpgp_crt_t key,
256 					const
257 					gnutls_openpgp_keyid_t keyid)
258 {
259 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
260 }
261 
262 
263 /* privkey stuff.
264  */
gnutls_openpgp_privkey_init(gnutls_openpgp_privkey_t * key)265 int gnutls_openpgp_privkey_init(gnutls_openpgp_privkey_t * key)
266 {
267 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
268 }
269 
gnutls_openpgp_privkey_deinit(gnutls_openpgp_privkey_t key)270 void gnutls_openpgp_privkey_deinit(gnutls_openpgp_privkey_t key)
271 {
272 	return;
273 }
274 
275 gnutls_pk_algorithm_t
gnutls_openpgp_privkey_get_pk_algorithm(gnutls_openpgp_privkey_t key,unsigned int * bits)276     gnutls_openpgp_privkey_get_pk_algorithm
277     (gnutls_openpgp_privkey_t key, unsigned int *bits)
278 {
279 	return GNUTLS_PK_UNKNOWN;
280 }
281 
282 gnutls_sec_param_t
gnutls_openpgp_privkey_sec_param(gnutls_openpgp_privkey_t key)283 gnutls_openpgp_privkey_sec_param(gnutls_openpgp_privkey_t key)
284 {
285 	return 0;
286 }
287 
gnutls_openpgp_privkey_import(gnutls_openpgp_privkey_t key,const gnutls_datum_t * data,gnutls_openpgp_crt_fmt_t format,const char * password,unsigned int flags)288 int gnutls_openpgp_privkey_import(gnutls_openpgp_privkey_t key,
289 				  const gnutls_datum_t * data,
290 				  gnutls_openpgp_crt_fmt_t format,
291 				  const char *password,
292 				  unsigned int flags)
293 {
294 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
295 }
296 
297 
gnutls_openpgp_privkey_get_fingerprint(gnutls_openpgp_privkey_t key,void * fpr,size_t * fprlen)298 int gnutls_openpgp_privkey_get_fingerprint(gnutls_openpgp_privkey_t
299 					   key, void *fpr,
300 					   size_t * fprlen)
301 {
302 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
303 }
304 
gnutls_openpgp_privkey_get_subkey_fingerprint(gnutls_openpgp_privkey_t key,unsigned int idx,void * fpr,size_t * fprlen)305 int gnutls_openpgp_privkey_get_subkey_fingerprint
306     (gnutls_openpgp_privkey_t key, unsigned int idx, void *fpr,
307      size_t * fprlen)
308 {
309 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
310 }
311 
gnutls_openpgp_privkey_get_key_id(gnutls_openpgp_privkey_t key,gnutls_openpgp_keyid_t keyid)312 int gnutls_openpgp_privkey_get_key_id(gnutls_openpgp_privkey_t key,
313 				      gnutls_openpgp_keyid_t keyid)
314 {
315 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
316 }
317 
gnutls_openpgp_privkey_get_subkey_count(gnutls_openpgp_privkey_t key)318 int gnutls_openpgp_privkey_get_subkey_count(gnutls_openpgp_privkey_t key)
319 {
320 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
321 }
322 
gnutls_openpgp_privkey_get_subkey_idx(gnutls_openpgp_privkey_t key,const gnutls_openpgp_keyid_t keyid)323 int gnutls_openpgp_privkey_get_subkey_idx(gnutls_openpgp_privkey_t
324 					  key,
325 					  const
326 					  gnutls_openpgp_keyid_t keyid)
327 {
328 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
329 }
330 
331 
gnutls_openpgp_privkey_get_subkey_revoked_status(gnutls_openpgp_privkey_t key,unsigned int idx)332 int gnutls_openpgp_privkey_get_subkey_revoked_status
333     (gnutls_openpgp_privkey_t key, unsigned int idx)
334 {
335 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
336 }
337 
338 
gnutls_openpgp_privkey_get_revoked_status(gnutls_openpgp_privkey_t key)339 int gnutls_openpgp_privkey_get_revoked_status
340     (gnutls_openpgp_privkey_t key)
341 {
342 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
343 }
344 
345 
346 gnutls_pk_algorithm_t
gnutls_openpgp_privkey_get_subkey_pk_algorithm(gnutls_openpgp_privkey_t key,unsigned int idx,unsigned int * bits)347     gnutls_openpgp_privkey_get_subkey_pk_algorithm
348     (gnutls_openpgp_privkey_t key, unsigned int idx, unsigned int *bits)
349 {
350 	return GNUTLS_PK_UNKNOWN;
351 }
352 
353 
354 time_t
gnutls_openpgp_privkey_get_subkey_expiration_time(gnutls_openpgp_privkey_t key,unsigned int idx)355     gnutls_openpgp_privkey_get_subkey_expiration_time
356     (gnutls_openpgp_privkey_t key, unsigned int idx)
357 {
358 	return (time_t)-1;
359 }
360 
gnutls_openpgp_privkey_get_subkey_id(gnutls_openpgp_privkey_t key,unsigned int idx,gnutls_openpgp_keyid_t keyid)361 int gnutls_openpgp_privkey_get_subkey_id(gnutls_openpgp_privkey_t
362 					 key, unsigned int idx,
363 					 gnutls_openpgp_keyid_t keyid)
364 {
365 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
366 }
367 
368 
369 time_t
gnutls_openpgp_privkey_get_subkey_creation_time(gnutls_openpgp_privkey_t key,unsigned int idx)370     gnutls_openpgp_privkey_get_subkey_creation_time
371     (gnutls_openpgp_privkey_t key, unsigned int idx)
372 {
373 	return (time_t)-1;
374 }
375 
376 
gnutls_openpgp_privkey_export_subkey_dsa_raw(gnutls_openpgp_privkey_t pkey,unsigned int idx,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * g,gnutls_datum_t * y,gnutls_datum_t * x)377 int gnutls_openpgp_privkey_export_subkey_dsa_raw
378     (gnutls_openpgp_privkey_t pkey, unsigned int idx,
379      gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * g,
380      gnutls_datum_t * y, gnutls_datum_t * x)
381 {
382 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
383 }
384 
gnutls_openpgp_privkey_export_subkey_rsa_raw(gnutls_openpgp_privkey_t pkey,unsigned int idx,gnutls_datum_t * m,gnutls_datum_t * e,gnutls_datum_t * d,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * u)385 int gnutls_openpgp_privkey_export_subkey_rsa_raw
386     (gnutls_openpgp_privkey_t pkey, unsigned int idx,
387      gnutls_datum_t * m, gnutls_datum_t * e, gnutls_datum_t * d,
388      gnutls_datum_t * p, gnutls_datum_t * q, gnutls_datum_t * u)
389 {
390 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
391 }
392 
393 
gnutls_openpgp_privkey_export_dsa_raw(gnutls_openpgp_privkey_t pkey,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * g,gnutls_datum_t * y,gnutls_datum_t * x)394 int gnutls_openpgp_privkey_export_dsa_raw(gnutls_openpgp_privkey_t
395 					  pkey, gnutls_datum_t * p,
396 					  gnutls_datum_t * q,
397 					  gnutls_datum_t * g,
398 					  gnutls_datum_t * y,
399 					  gnutls_datum_t * x)
400 {
401 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
402 }
403 
gnutls_openpgp_privkey_export_rsa_raw(gnutls_openpgp_privkey_t pkey,gnutls_datum_t * m,gnutls_datum_t * e,gnutls_datum_t * d,gnutls_datum_t * p,gnutls_datum_t * q,gnutls_datum_t * u)404 int gnutls_openpgp_privkey_export_rsa_raw(gnutls_openpgp_privkey_t
405 					  pkey, gnutls_datum_t * m,
406 					  gnutls_datum_t * e,
407 					  gnutls_datum_t * d,
408 					  gnutls_datum_t * p,
409 					  gnutls_datum_t * q,
410 					  gnutls_datum_t * u)
411 {
412 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
413 }
414 
415 
gnutls_openpgp_privkey_export(gnutls_openpgp_privkey_t key,gnutls_openpgp_crt_fmt_t format,const char * password,unsigned int flags,void * output_data,size_t * output_data_size)416 int gnutls_openpgp_privkey_export(gnutls_openpgp_privkey_t key,
417 				  gnutls_openpgp_crt_fmt_t format,
418 				  const char *password,
419 				  unsigned int flags,
420 				  void *output_data,
421 				  size_t * output_data_size)
422 {
423 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
424 }
425 
gnutls_openpgp_privkey_export2(gnutls_openpgp_privkey_t key,gnutls_openpgp_crt_fmt_t format,const char * password,unsigned int flags,gnutls_datum_t * out)426 int gnutls_openpgp_privkey_export2(gnutls_openpgp_privkey_t key,
427 				   gnutls_openpgp_crt_fmt_t format,
428 				   const char *password,
429 				   unsigned int flags,
430 				   gnutls_datum_t * out)
431 {
432 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
433 }
434 
435 
gnutls_openpgp_privkey_set_preferred_key_id(gnutls_openpgp_privkey_t key,const gnutls_openpgp_keyid_t keyid)436 int gnutls_openpgp_privkey_set_preferred_key_id
437     (gnutls_openpgp_privkey_t key, const gnutls_openpgp_keyid_t keyid)
438 {
439 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
440 }
441 
gnutls_openpgp_privkey_get_preferred_key_id(gnutls_openpgp_privkey_t key,gnutls_openpgp_keyid_t keyid)442 int gnutls_openpgp_privkey_get_preferred_key_id
443     (gnutls_openpgp_privkey_t key, gnutls_openpgp_keyid_t keyid)
444 {
445 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
446 }
447 
448 
gnutls_openpgp_crt_get_auth_subkey(gnutls_openpgp_crt_t crt,gnutls_openpgp_keyid_t keyid,unsigned int flag)449 int gnutls_openpgp_crt_get_auth_subkey(gnutls_openpgp_crt_t crt,
450 				       gnutls_openpgp_keyid_t
451 				       keyid, unsigned int flag)
452 {
453 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
454 }
455 
456 
457 /* Keyring stuff.
458  */
459 
gnutls_openpgp_keyring_init(gnutls_openpgp_keyring_t * keyring)460 int gnutls_openpgp_keyring_init(gnutls_openpgp_keyring_t * keyring)
461 {
462 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
463 }
464 
gnutls_openpgp_keyring_deinit(gnutls_openpgp_keyring_t keyring)465 void gnutls_openpgp_keyring_deinit(gnutls_openpgp_keyring_t keyring)
466 {
467 	return;
468 }
469 
gnutls_openpgp_keyring_import(gnutls_openpgp_keyring_t keyring,const gnutls_datum_t * data,gnutls_openpgp_crt_fmt_t format)470 int gnutls_openpgp_keyring_import(gnutls_openpgp_keyring_t keyring,
471 				  const gnutls_datum_t * data,
472 				  gnutls_openpgp_crt_fmt_t format)
473 {
474 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
475 }
476 
477 
gnutls_openpgp_keyring_check_id(gnutls_openpgp_keyring_t ring,const gnutls_openpgp_keyid_t keyid,unsigned int flags)478 int gnutls_openpgp_keyring_check_id(gnutls_openpgp_keyring_t ring,
479 				    const gnutls_openpgp_keyid_t
480 				    keyid, unsigned int flags)
481 {
482 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
483 }
484 
485 
486 
gnutls_openpgp_crt_verify_ring(gnutls_openpgp_crt_t key,gnutls_openpgp_keyring_t keyring,unsigned int flags,unsigned int * verify)487 int gnutls_openpgp_crt_verify_ring(gnutls_openpgp_crt_t key,
488 				   gnutls_openpgp_keyring_t
489 				   keyring, unsigned int flags,
490 				   unsigned int *verify
491 				   /* the output of the verification */
492     )
493 {
494 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
495 }
496 
497 
gnutls_openpgp_crt_verify_self(gnutls_openpgp_crt_t key,unsigned int flags,unsigned int * verify)498 int gnutls_openpgp_crt_verify_self(gnutls_openpgp_crt_t key,
499 				   unsigned int flags,
500 				   unsigned int *verify)
501 {
502 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
503 }
504 
505 
gnutls_openpgp_keyring_get_crt(gnutls_openpgp_keyring_t ring,unsigned int idx,gnutls_openpgp_crt_t * cert)506 int gnutls_openpgp_keyring_get_crt(gnutls_openpgp_keyring_t ring,
507 				   unsigned int idx,
508 				   gnutls_openpgp_crt_t * cert)
509 {
510 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
511 }
512 
513 
gnutls_openpgp_keyring_get_crt_count(gnutls_openpgp_keyring_t ring)514 int gnutls_openpgp_keyring_get_crt_count(gnutls_openpgp_keyring_t ring)
515 {
516 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
517 }
518 
519 
520 
521 
522 void
gnutls_openpgp_set_recv_key_function(gnutls_session_t session,gnutls_openpgp_recv_key_func func)523 gnutls_openpgp_set_recv_key_function(gnutls_session_t session,
524 				     gnutls_openpgp_recv_key_func func)
525 {
526 	return;
527 }
528 
gnutls_certificate_set_openpgp_key(gnutls_certificate_credentials_t res,gnutls_openpgp_crt_t crt,gnutls_openpgp_privkey_t pkey)529 int gnutls_certificate_set_openpgp_key
530     (gnutls_certificate_credentials_t res,
531      gnutls_openpgp_crt_t crt, gnutls_openpgp_privkey_t pkey)
532 {
533 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
534 }
535 
536 
537 int
gnutls_certificate_get_openpgp_key(gnutls_certificate_credentials_t res,unsigned index,gnutls_openpgp_privkey_t * key)538 gnutls_certificate_get_openpgp_key(gnutls_certificate_credentials_t res,
539                                    unsigned index,
540                                    gnutls_openpgp_privkey_t *key)
541 {
542 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
543 }
544 
545 int
gnutls_certificate_get_openpgp_crt(gnutls_certificate_credentials_t res,unsigned index,gnutls_openpgp_crt_t ** crt_list,unsigned * crt_list_size)546 gnutls_certificate_get_openpgp_crt(gnutls_certificate_credentials_t res,
547                                    unsigned index,
548                                    gnutls_openpgp_crt_t **crt_list,
549                                    unsigned *crt_list_size)
550 {
551 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
552 }
553 
554 
555 int
gnutls_certificate_set_openpgp_key_file(gnutls_certificate_credentials_t res,const char * certfile,const char * keyfile,gnutls_openpgp_crt_fmt_t format)556  gnutls_certificate_set_openpgp_key_file
557     (gnutls_certificate_credentials_t res, const char *certfile,
558      const char *keyfile, gnutls_openpgp_crt_fmt_t format)
559 {
560 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
561 }
562 
gnutls_certificate_set_openpgp_key_mem(gnutls_certificate_credentials_t res,const gnutls_datum_t * cert,const gnutls_datum_t * key,gnutls_openpgp_crt_fmt_t format)563 int gnutls_certificate_set_openpgp_key_mem
564     (gnutls_certificate_credentials_t res,
565      const gnutls_datum_t * cert, const gnutls_datum_t * key,
566      gnutls_openpgp_crt_fmt_t format)
567 {
568 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
569 }
570 
571 
572 int
gnutls_certificate_set_openpgp_key_file2(gnutls_certificate_credentials_t res,const char * certfile,const char * keyfile,const char * subkey_id,gnutls_openpgp_crt_fmt_t format)573  gnutls_certificate_set_openpgp_key_file2
574     (gnutls_certificate_credentials_t res, const char *certfile,
575      const char *keyfile, const char *subkey_id,
576      gnutls_openpgp_crt_fmt_t format)
577 {
578 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
579 }
580 
581 int
gnutls_certificate_set_openpgp_key_mem2(gnutls_certificate_credentials_t res,const gnutls_datum_t * cert,const gnutls_datum_t * key,const char * subkey_id,gnutls_openpgp_crt_fmt_t format)582  gnutls_certificate_set_openpgp_key_mem2
583     (gnutls_certificate_credentials_t res,
584      const gnutls_datum_t * cert, const gnutls_datum_t * key,
585      const char *subkey_id, gnutls_openpgp_crt_fmt_t format)
586 {
587 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
588 }
589 
590 
gnutls_certificate_set_openpgp_keyring_mem(gnutls_certificate_credentials_t c,const unsigned char * data,size_t dlen,gnutls_openpgp_crt_fmt_t format)591 int gnutls_certificate_set_openpgp_keyring_mem
592     (gnutls_certificate_credentials_t c, const unsigned char *data,
593      size_t dlen, gnutls_openpgp_crt_fmt_t format)
594 {
595 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
596 }
597 
598 
gnutls_certificate_set_openpgp_keyring_file(gnutls_certificate_credentials_t c,const char * file,gnutls_openpgp_crt_fmt_t format)599 int gnutls_certificate_set_openpgp_keyring_file
600     (gnutls_certificate_credentials_t c, const char *file,
601      gnutls_openpgp_crt_fmt_t format)
602 {
603 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
604 }
605 
606 /**
607  * gnutls_pubkey_import_openpgp:
608  * @key: The public key
609  * @crt: The certificate to be imported
610  * @flags: should be zero
611  *
612  * This function is no-op.
613  *
614  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
615  *
616  * Since: 2.12.0
617  **/
gnutls_pubkey_import_openpgp(gnutls_pubkey_t key,gnutls_openpgp_crt_t crt,unsigned int flags)618 int gnutls_pubkey_import_openpgp(gnutls_pubkey_t key,
619 				 gnutls_openpgp_crt_t crt,
620 				 unsigned int flags)
621 {
622 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
623 }
624 
625 /**
626  * gnutls_pubkey_import_openpgp_raw:
627  * @pkey: The public key
628  * @data: The public key data to be imported
629  * @format: The format of the public key
630  * @keyid: The key id to use (optional)
631  * @flags: Should be zero
632  *
633  * This function is no-op.
634  *
635  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
636  *
637  * Since: 3.1.3
638  **/
gnutls_pubkey_import_openpgp_raw(gnutls_pubkey_t pkey,const gnutls_datum_t * data,gnutls_openpgp_crt_fmt_t format,const gnutls_openpgp_keyid_t keyid,unsigned int flags)639 int gnutls_pubkey_import_openpgp_raw(gnutls_pubkey_t pkey,
640 				     const gnutls_datum_t * data,
641 				     gnutls_openpgp_crt_fmt_t
642 				     format,
643 				     const gnutls_openpgp_keyid_t
644 				     keyid, unsigned int flags)
645 {
646 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
647 }
648 
649 /**
650  * gnutls_pubkey_get_key_id:
651  * @key: Holds the public key
652  * @flags: should be one of the flags from %gnutls_keyid_flags_t
653  * @output_data: will contain the key ID
654  * @output_data_size: holds the size of output_data (and will be
655  *   replaced by the actual size of parameters)
656  * @subkey: ignored
657  *
658  * This function is no-op.
659  *
660  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
661  *
662  * Since: 2.12.0
663  **/
664 int
gnutls_pubkey_get_openpgp_key_id(gnutls_pubkey_t key,unsigned int flags,unsigned char * output_data,size_t * output_data_size,unsigned int * subkey)665 gnutls_pubkey_get_openpgp_key_id(gnutls_pubkey_t key,
666 				 unsigned int flags,
667 				 unsigned char *output_data,
668 				 size_t * output_data_size,
669 				 unsigned int *subkey)
670 {
671 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
672 }
673 
674 /**
675  * gnutls_privkey_import_openpgp:
676  * @pkey: The private key
677  * @key: The private key to be imported
678  * @flags: Flags for the import
679  *
680  * This function is no-op.
681  *
682  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
683  *
684  * Since: 2.12.0
685  **/
gnutls_privkey_import_openpgp(gnutls_privkey_t pkey,gnutls_openpgp_privkey_t key,unsigned int flags)686 int gnutls_privkey_import_openpgp(gnutls_privkey_t pkey,
687 				  gnutls_openpgp_privkey_t key,
688 				  unsigned int flags)
689 {
690 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
691 }
692 
693 /**
694  * gnutls_privkey_export_openpgp:
695  * @pkey: The private key
696  * @key: Location for the key to be exported.
697  *
698  * This function is no-op.
699  *
700  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
701  *
702  * Since: 3.4.0
703  */
gnutls_privkey_export_openpgp(gnutls_privkey_t pkey,gnutls_openpgp_privkey_t * key)704 int gnutls_privkey_export_openpgp(gnutls_privkey_t pkey,
705                                   gnutls_openpgp_privkey_t * key)
706 {
707 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
708 }
709 
710 /**
711  * gnutls_privkey_import_openpgp_raw:
712  * @pkey: The private key
713  * @data: The private key data to be imported
714  * @format: The format of the private key
715  * @keyid: The key id to use (optional)
716  * @password: A password (optional)
717  *
718  * This function is no-op.
719  *
720  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
721  *
722  * Since: 3.1.0
723  **/
gnutls_privkey_import_openpgp_raw(gnutls_privkey_t pkey,const gnutls_datum_t * data,gnutls_openpgp_crt_fmt_t format,const gnutls_openpgp_keyid_t keyid,const char * password)724 int gnutls_privkey_import_openpgp_raw(gnutls_privkey_t pkey,
725 				      const gnutls_datum_t * data,
726 				      gnutls_openpgp_crt_fmt_t
727 				      format,
728 				      const gnutls_openpgp_keyid_t
729 				      keyid, const char *password)
730 {
731 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
732 }
733 
734 /**
735  * gnutls_pcert_import_openpgp_raw:
736  * @pcert: The pcert structure
737  * @cert: The raw certificate to be imported
738  * @format: The format of the certificate
739  * @keyid: The key ID to use (NULL for the master key)
740  * @flags: zero for now
741  *
742  * This function is no-op.
743  *
744  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
745  *
746  * Since: 3.0
747  **/
gnutls_pcert_import_openpgp_raw(gnutls_pcert_st * pcert,const gnutls_datum_t * cert,gnutls_openpgp_crt_fmt_t format,gnutls_openpgp_keyid_t keyid,unsigned int flags)748 int gnutls_pcert_import_openpgp_raw(gnutls_pcert_st * pcert,
749 				    const gnutls_datum_t * cert,
750 				    gnutls_openpgp_crt_fmt_t
751 				    format,
752 				    gnutls_openpgp_keyid_t keyid,
753 				    unsigned int flags)
754 {
755 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
756 }
757 
758 /**
759  * gnutls_pcert_import_openpgp:
760  * @pcert: The pcert structure
761  * @crt: The raw certificate to be imported
762  * @flags: zero for now
763  *
764  * This function is no-op.
765  *
766  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
767  *
768  * Since: 3.0
769  **/
gnutls_pcert_import_openpgp(gnutls_pcert_st * pcert,gnutls_openpgp_crt_t crt,unsigned int flags)770 int gnutls_pcert_import_openpgp(gnutls_pcert_st * pcert,
771 				gnutls_openpgp_crt_t crt,
772 				unsigned int flags)
773 {
774 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
775 }
776 
777 /**
778  * gnutls_pcert_export_x509:
779  * @pcert: The pcert structure.
780  * @crt: An initialized #gnutls_openpgp_crt_t.
781  *
782  * This function is no-op.
783  *
784  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
785  *
786  * Since: 3.4.0
787  */
gnutls_pcert_export_openpgp(gnutls_pcert_st * pcert,gnutls_openpgp_crt_t * crt)788 int gnutls_pcert_export_openpgp(gnutls_pcert_st * pcert,
789                                 gnutls_openpgp_crt_t * crt)
790 {
791 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
792 }
793 
794 /**
795  * gnutls_openpgp_privkey_sign_hash:
796  * @session: is a gnutls session
797  * @status: is ignored
798  *
799  * This function is no-op.
800  *
801  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
802  */
803 void
gnutls_openpgp_send_cert(gnutls_session_t session,gnutls_openpgp_crt_status_t status)804 gnutls_openpgp_send_cert(gnutls_session_t session,
805 			 gnutls_openpgp_crt_status_t status)
806 {
807 	return;
808 }
809 
810 /**
811  * gnutls_certificate_get_peers_subkey_id:
812  * @session: is a gnutls session
813  * @id: will contain the ID
814  *
815  * This function is no-op.
816  *
817  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
818  *
819  * Since: 3.1.3
820  **/
gnutls_certificate_get_peers_subkey_id(gnutls_session_t session,gnutls_datum_t * id)821 int gnutls_certificate_get_peers_subkey_id(gnutls_session_t session,
822 					   gnutls_datum_t * id)
823 {
824 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
825 }
826 
827 /**
828  * gnutls_openpgp_privkey_sign_hash:
829  * @key: Holds the key
830  * @hash: holds the data to be signed
831  * @signature: will contain newly allocated signature
832  *
833  * This function is no-op.
834  *
835  * Returns: %GNUTLS_E_UNIMPLEMENTED_FEATURE.
836  */
837 int
gnutls_openpgp_privkey_sign_hash(gnutls_openpgp_privkey_t key,const gnutls_datum_t * hash,gnutls_datum_t * signature)838 gnutls_openpgp_privkey_sign_hash(gnutls_openpgp_privkey_t key,
839 				 const gnutls_datum_t * hash,
840 				 gnutls_datum_t * signature)
841 {
842 	return GNUTLS_E_UNIMPLEMENTED_FEATURE;
843 }
844 
845