This file is indexed.

/usr/include/fko.h is in libfko2-dev 2.6.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
/*
 *****************************************************************************
 *
 * File:    fko.h
 *
 * Author:  Damien S. Stuart
 *
 * Purpose: Header for libfko.
 *
 * Copyright 2009-2013 Damien Stuart (dstuart@dstuart.org)
 *
 *  License (GNU General Public License):
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 2
 *  of the License, or (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 *  USA
 *
 *****************************************************************************
*/
#ifndef FKO_H
#define FKO_H 1

#include <time.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef WIN32
  #ifdef DLL_EXPORTS
    #define DLL_API __declspec(dllexport)
  #else
	#ifdef DLL_IMPORTS
		#define DLL_API __declspec(dllimport)
	#else
		#define DLL_API
	#endif
  #endif
#else
  #define DLL_API
#endif

/* General params
*/
#define FKO_PROTOCOL_VERSION "2.0.1" /* The fwknop protocol version */

/* Supported FKO Message types...
*/
typedef enum {
    FKO_COMMAND_MSG = 0,
    FKO_ACCESS_MSG,
    FKO_NAT_ACCESS_MSG,
    FKO_CLIENT_TIMEOUT_ACCESS_MSG,
    FKO_CLIENT_TIMEOUT_NAT_ACCESS_MSG,
    FKO_LOCAL_NAT_ACCESS_MSG,
    FKO_CLIENT_TIMEOUT_LOCAL_NAT_ACCESS_MSG,
    FKO_LAST_MSG_TYPE /* Always leave this as the last one */
} fko_message_type_t;

/* Supported digest types...
*/
typedef enum {
    FKO_DIGEST_INVALID_DATA = -1,
    FKO_DIGEST_UNKNOWN = 0,
    FKO_DIGEST_MD5,
    FKO_DIGEST_SHA1,
    FKO_DIGEST_SHA256,
    FKO_DIGEST_SHA384,
    FKO_DIGEST_SHA512,
    FKO_LAST_DIGEST_TYPE /* Always leave this as the last one */
} fko_digest_type_t;

/* Supported hmac digest types...
*/
typedef enum {
    FKO_HMAC_INVALID_DATA = -1,
    FKO_HMAC_UNKNOWN = 0,
    FKO_HMAC_MD5,
    FKO_HMAC_SHA1,
    FKO_HMAC_SHA256,
    FKO_HMAC_SHA384,
    FKO_HMAC_SHA512,
    FKO_LAST_HMAC_MODE /* Always leave this as the last one */
} fko_hmac_type_t;

/* Supported encryption types...
*/
typedef enum {
    FKO_ENCRYPTION_INVALID_DATA = -1,
    FKO_ENCRYPTION_UNKNOWN = 0,
    FKO_ENCRYPTION_RIJNDAEL,
    FKO_ENCRYPTION_GPG,
    FKO_LAST_ENCRYPTION_TYPE /* Always leave this as the last one */
} fko_encryption_type_t;

/* Symmetric encryption modes to correspond to rijndael.h
*/
typedef enum {
    FKO_ENC_MODE_UNKNOWN = 0,
    FKO_ENC_MODE_ECB,
    FKO_ENC_MODE_CBC,
    FKO_ENC_MODE_CFB,
    FKO_ENC_MODE_PCBC,
    FKO_ENC_MODE_OFB,
    FKO_ENC_MODE_CTR,
    FKO_ENC_MODE_ASYMMETRIC,  /* placeholder when GPG is used */
    FKO_ENC_MODE_CBC_LEGACY_IV,  /* for the old zero-padding strategy */
    FKO_LAST_ENC_MODE /* Always leave this as the last one */
} fko_encryption_mode_t;

/* FKO ERROR_CODES
 *
 * Note: If you change this list in any way, please be sure to make the
 *       appropriate corresponding change to the error message list in
 *       fko_error.c.
*/
typedef enum {
    FKO_SUCCESS = 0,
    FKO_ERROR_CTX_NOT_INITIALIZED,
    FKO_ERROR_MEMORY_ALLOCATION,
    FKO_ERROR_FILESYSTEM_OPERATION,

    /* Invalid data errors */
    FKO_ERROR_INVALID_DATA,
    FKO_ERROR_INVALID_DATA_CLIENT_TIMEOUT_NEGATIVE,
    FKO_ERROR_INVALID_DATA_DECODE_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_NON_ASCII,
    FKO_ERROR_INVALID_DATA_DECODE_LT_MIN_FIELDS,
    FKO_ERROR_INVALID_DATA_DECODE_ENC_MSG_LEN_MT_T_SIZE,
    FKO_ERROR_INVALID_DATA_DECODE_RAND_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_USERNAME_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_TIMESTAMP_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_VERSION_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_VERSION_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_MSGTYPE_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_MESSAGE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_ACCESS_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_NATACCESS_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_SRVAUTH_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_SPA_EXTRA_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_EXTRA_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_MISSING,
    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_TOOBIG,
    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_DECODE_TIMEOUT_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_ENCODE_MESSAGE_TOOBIG,
    FKO_ERROR_INVALID_DATA_ENCODE_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCODE_DIGEST_TOOBIG,
    FKO_ERROR_INVALID_DATA_ENCODE_NOTBASE64,
    FKO_ERROR_INVALID_DATA_ENCRYPT_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_DIGESTLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_PTLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_RESULT_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_CIPHERLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MESSAGE_MISSING,
    FKO_ERROR_INVALID_DATA_ENCRYPT_DECRYPTED_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MESSAGE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_DIGEST_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_RESULT_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_CIPHER_DECODEFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSG_NULL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_GPG_ENCODEDMSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_MODE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_ENCRYPT_TYPE_UNKNOWN,
    FKO_ERROR_INVALID_DATA_FUNCS_NEW_ENCMSG_MISSING,
    FKO_ERROR_INVALID_DATA_FUNCS_NEW_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEYLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMACLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_FUNCS_GEN_KEY_ENCODEFAIL,
    FKO_ERROR_INVALID_DATA_FUNCS_GEN_HMAC_ENCODEFAIL,
    FKO_ERROR_INVALID_DATA_FUNCS_SET_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_HMAC_MSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_HMAC_ENCMSGLEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_HMAC_COMPAREFAIL,
    FKO_ERROR_INVALID_DATA_HMAC_TYPE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_HMAC_LEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_MESSAGE_PORT_MISSING,
    FKO_ERROR_INVALID_DATA_MESSAGE_TYPE_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_MESSAGE_EMPTY,
    FKO_ERROR_INVALID_DATA_MESSAGE_CMD_MISSING,
    FKO_ERROR_INVALID_DATA_MESSAGE_ACCESS_MISSING,
    FKO_ERROR_INVALID_DATA_MESSAGE_NAT_MISSING,
    FKO_ERROR_INVALID_DATA_MESSAGE_PORTPROTO_MISSING,
    FKO_ERROR_INVALID_DATA_NAT_EMPTY,
    FKO_ERROR_INVALID_DATA_RAND_LEN_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_SRVAUTH_MISSING,
    FKO_ERROR_INVALID_DATA_TIMESTAMP_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_USER_MISSING,
    FKO_ERROR_INVALID_DATA_USER_FIRSTCHAR_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_USER_REMCHAR_VALIDFAIL,
    FKO_ERROR_INVALID_DATA_UTIL_STRTOL_LT_MIN,
    FKO_ERROR_INVALID_DATA_UTIL_STROL_GT_MAX,

    FKO_ERROR_DATA_TOO_LARGE,
    FKO_ERROR_INVALID_KEY_LEN,
    FKO_ERROR_USERNAME_UNKNOWN,
    FKO_ERROR_INCOMPLETE_SPA_DATA,
    FKO_ERROR_MISSING_ENCODED_DATA,
    FKO_ERROR_INVALID_DIGEST_TYPE,
    FKO_ERROR_INVALID_ALLOW_IP,
    FKO_ERROR_INVALID_SPA_COMMAND_MSG,
    FKO_ERROR_INVALID_SPA_ACCESS_MSG,
    FKO_ERROR_INVALID_SPA_NAT_ACCESS_MSG,
    FKO_ERROR_INVALID_ENCRYPTION_TYPE,
    FKO_ERROR_WRONG_ENCRYPTION_TYPE,
    FKO_ERROR_DECRYPTION_SIZE,
    FKO_ERROR_DECRYPTION_FAILURE,
    FKO_ERROR_DIGEST_VERIFICATION_FAILED,
    FKO_ERROR_INVALID_HMAC_KEY_LEN,
    FKO_ERROR_UNSUPPORTED_HMAC_MODE,
    FKO_ERROR_UNSUPPORTED_FEATURE,
    FKO_ERROR_ZERO_OUT_DATA,
    FKO_ERROR_UNKNOWN,

    /* Start GPGME-related errors (NOTE: Do not put non-GPG-related error
     * below this point).
    */
    GPGME_ERR_START,
    FKO_ERROR_MISSING_GPG_KEY_DATA,
    FKO_ERROR_GPGME_NO_OPENPGP,
    FKO_ERROR_GPGME_CONTEXT,
    FKO_ERROR_GPGME_PLAINTEXT_DATA_OBJ,
    FKO_ERROR_GPGME_SET_PROTOCOL,
    FKO_ERROR_GPGME_CIPHER_DATA_OBJ,
    FKO_ERROR_GPGME_BAD_PASSPHRASE,
    FKO_ERROR_GPGME_ENCRYPT_SIGN,
    FKO_ERROR_GPGME_CONTEXT_SIGNER_KEY,
    FKO_ERROR_GPGME_SIGNER_KEYLIST_START,
    FKO_ERROR_GPGME_SIGNER_KEY_NOT_FOUND,
    FKO_ERROR_GPGME_SIGNER_KEY_AMBIGUOUS,
    FKO_ERROR_GPGME_ADD_SIGNER,
    FKO_ERROR_GPGME_CONTEXT_RECIPIENT_KEY,
    FKO_ERROR_GPGME_RECIPIENT_KEYLIST_START,
    FKO_ERROR_GPGME_RECIPIENT_KEY_NOT_FOUND,
    FKO_ERROR_GPGME_RECIPIENT_KEY_AMBIGUOUS,
    FKO_ERROR_GPGME_DECRYPT_FAILED,
    FKO_ERROR_GPGME_DECRYPT_UNSUPPORTED_ALGORITHM,
    FKO_ERROR_GPGME_BAD_GPG_EXE,
    FKO_ERROR_GPGME_BAD_HOME_DIR,
    FKO_ERROR_GPGME_SET_HOME_DIR,
    FKO_ERROR_GPGME_NO_SIGNATURE,
    FKO_ERROR_GPGME_BAD_SIGNATURE,
    FKO_ERROR_GPGME_SIGNATURE_VERIFY_DISABLED,

    FKO_LAST_ERROR
} fko_error_codes_t;

/* Macro that returns true if the given error code is a gpg-related error.
*/
#define IS_GPG_ERROR(x) (x > GPGME_ERR_START && x < FKO_LAST_ERROR)

/* General Defaults
*/
#define FKO_DEFAULT_MSG_TYPE     FKO_ACCESS_MSG
#define FKO_DEFAULT_DIGEST       FKO_DIGEST_SHA256
#define FKO_DEFAULT_ENCRYPTION   FKO_ENCRYPTION_RIJNDAEL
#define FKO_DEFAULT_ENC_MODE     FKO_ENC_MODE_CBC
#define FKO_DEFAULT_KEY_LEN      0
#define FKO_DEFAULT_HMAC_KEY_LEN 0
#define FKO_DEFAULT_HMAC_MODE    FKO_HMAC_SHA256

/* Define the consistent prefixes or salt on some encryption schemes.
*/
#define B64_RIJNDAEL_SALT "U2FsdGVkX1"
#define B64_RIJNDAEL_SALT_STR_LEN 10

#define B64_GPG_PREFIX "hQ"
#define B64_GPG_PREFIX_STR_LEN 2

/* Specify whether libfko is allowed to call exit()
*/
#define EXIT_UPON_ERR 1
#define NO_EXIT_UPON_ERR 0

/* The context holds the global state and config options, as
 * well as some intermediate results during processing. This
 * is an opaque pointer.
*/
struct fko_context;
typedef struct fko_context *fko_ctx_t;

/* Some gpg-specifc data types and constants.
*/
#if HAVE_LIBGPGME

enum {
    FKO_GPG_NO_SIG_VERIFY_SIGS  = 0x01,
    FKO_GPG_ALLOW_BAD_SIG       = 0x02,
    FKO_GPG_NO_SIG_INFO         = 0x04,
    FKO_GPG_ALLOW_EXPIRED_SIG   = 0x08,
    FKO_GPG_ALLOW_REVOKED_SIG   = 0x10
};

#define FKO_GPG_GOOD_SIGSUM     3

#endif /* HAVE_LIBGPGME */

/* Function prototypes */

/* General API calls
*/
DLL_API int fko_new(fko_ctx_t *ctx);
DLL_API int fko_new_with_data(fko_ctx_t *ctx, const char * const enc_msg,
    const char * const dec_key, const int dec_key_len, int encryption_mode,
    const char * const hmac_key, const int hmac_key_len, const int hmac_type);
DLL_API int fko_destroy(fko_ctx_t ctx);
DLL_API int fko_spa_data_final(fko_ctx_t ctx, const char * const enc_key,
    const int enc_key_len, const char * const hmac_key, const int hmac_key_len);

/* Set context data functions
*/
DLL_API int fko_set_rand_value(fko_ctx_t ctx, const char * const val);
DLL_API int fko_set_username(fko_ctx_t ctx, const char * const spoof_user);
DLL_API int fko_set_timestamp(fko_ctx_t ctx, const int offset);
DLL_API int fko_set_spa_message_type(fko_ctx_t ctx, const short msg_type);
DLL_API int fko_set_spa_message(fko_ctx_t ctx, const char * const msg_string);
DLL_API int fko_set_spa_nat_access(fko_ctx_t ctx, const char * const nat_access);
DLL_API int fko_set_spa_server_auth(fko_ctx_t ctx, const char * const server_auth);
DLL_API int fko_set_spa_client_timeout(fko_ctx_t ctx, const int timeout);
DLL_API int fko_set_spa_digest_type(fko_ctx_t ctx, const short digest_type);
DLL_API int fko_set_spa_digest(fko_ctx_t ctx);
DLL_API int fko_set_raw_spa_digest_type(fko_ctx_t ctx, const short raw_digest_type);
DLL_API int fko_set_raw_spa_digest(fko_ctx_t ctx);
DLL_API int fko_set_spa_encryption_type(fko_ctx_t ctx, const short encrypt_type);
DLL_API int fko_set_spa_encryption_mode(fko_ctx_t ctx, const int encrypt_mode);
DLL_API int fko_set_spa_data(fko_ctx_t ctx, const char * const enc_msg);
DLL_API int fko_set_spa_hmac_type(fko_ctx_t ctx, const short hmac_type);

/* Data processing and misc utility functions
*/
DLL_API const char* fko_errstr(const int err_code);
DLL_API int fko_encryption_type(const char * const enc_data);
DLL_API int fko_key_gen(char * const key_base64, const int key_len,
        char * const hmac_key_base64, const int hmac_ken_len,
        const int hmac_type);
DLL_API int fko_base64_encode(unsigned char * const in, char * const out, int in_len);
DLL_API int fko_base64_decode(const char * const in, unsigned char *out);

DLL_API int fko_encode_spa_data(fko_ctx_t ctx);
DLL_API int fko_decode_spa_data(fko_ctx_t ctx);
DLL_API int fko_encrypt_spa_data(fko_ctx_t ctx, const char * const enc_key,
    const int enc_key_len);
DLL_API int fko_decrypt_spa_data(fko_ctx_t ctx, const char * const dec_key,
    const int dec_key_len);
DLL_API int fko_verify_hmac(fko_ctx_t ctx, const char * const hmac_key,
    const int hmac_key_len);
DLL_API int fko_set_spa_hmac(fko_ctx_t ctx, const char * const hmac_key,
    const int hmac_key_len);
DLL_API int fko_get_spa_hmac(fko_ctx_t ctx, char **enc_data);

DLL_API int fko_get_encoded_data(fko_ctx_t ctx, char **enc_data);

/* Get context data functions
*/
DLL_API int fko_get_rand_value(fko_ctx_t ctx, char **rand_val);
DLL_API int fko_get_username(fko_ctx_t ctx, char **username);
DLL_API int fko_get_timestamp(fko_ctx_t ctx, time_t *ts);
DLL_API int fko_get_spa_message_type(fko_ctx_t ctx, short *spa_msg);
DLL_API int fko_get_spa_message(fko_ctx_t ctx, char **spa_message);
DLL_API int fko_get_spa_nat_access(fko_ctx_t ctx, char **nat_access);
DLL_API int fko_get_spa_server_auth(fko_ctx_t ctx, char **server_auth);
DLL_API int fko_get_spa_client_timeout(fko_ctx_t ctx, int *client_timeout);
DLL_API int fko_get_spa_digest_type(fko_ctx_t ctx, short *spa_digest_type);
DLL_API int fko_get_raw_spa_digest_type(fko_ctx_t ctx, short *raw_spa_digest_type);
DLL_API int fko_get_spa_hmac_type(fko_ctx_t ctx, short *spa_hmac_type);
DLL_API int fko_get_spa_digest(fko_ctx_t ctx, char **spa_digest);
DLL_API int fko_get_raw_spa_digest(fko_ctx_t ctx, char **raw_spa_digest);
DLL_API int fko_get_spa_encryption_type(fko_ctx_t ctx, short *spa_enc_type);
DLL_API int fko_get_spa_encryption_mode(fko_ctx_t ctx, int *spa_enc_mode);
DLL_API int fko_get_spa_data(fko_ctx_t ctx, char **spa_data);

DLL_API int fko_get_version(fko_ctx_t ctx, char **version);

/* GPG-related functions
*/
DLL_API int fko_set_gpg_exe(fko_ctx_t ctx, const char * const gpg_exe);
DLL_API int fko_get_gpg_exe(fko_ctx_t ctx, char **gpg_exe);

DLL_API int fko_set_gpg_recipient(fko_ctx_t ctx, const char * const recip);
DLL_API int fko_get_gpg_recipient(fko_ctx_t ctx, char **recip);
DLL_API int fko_set_gpg_signer(fko_ctx_t ctx, const char * const signer);
DLL_API int fko_get_gpg_signer(fko_ctx_t ctx, char **signer);
DLL_API int fko_set_gpg_home_dir(fko_ctx_t ctx, const char * const gpg_home_dir);
DLL_API int fko_get_gpg_home_dir(fko_ctx_t ctx, char **gpg_home_dir);

DLL_API const char* fko_gpg_errstr(fko_ctx_t ctx);

DLL_API int fko_set_gpg_signature_verify(fko_ctx_t ctx,
    const unsigned char val);
DLL_API int fko_get_gpg_signature_verify(fko_ctx_t ctx,
    unsigned char * const val);
DLL_API int fko_set_gpg_ignore_verify_error(fko_ctx_t ctx,
    const unsigned char val);
DLL_API int fko_get_gpg_ignore_verify_error(fko_ctx_t ctx,
    unsigned char * const val);

DLL_API int fko_get_gpg_signature_id(fko_ctx_t ctx, char **sig_id);
DLL_API int fko_get_gpg_signature_fpr(fko_ctx_t ctx, char **sig_fpr);
DLL_API int fko_get_gpg_signature_summary(fko_ctx_t ctx, int *sigsum);
DLL_API int fko_get_gpg_signature_status(fko_ctx_t ctx, int *sigstat);

DLL_API int fko_gpg_signature_id_match(fko_ctx_t ctx, const char * const id,
    unsigned char * const result);
DLL_API int fko_gpg_signature_fpr_match(fko_ctx_t ctx, const char * const fpr,
    unsigned char * const result);

#ifdef __cplusplus
}
#endif

#endif /* FKO_H */

/***EOF***/