summaryrefslogtreecommitdiff
path: root/libextra
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2007-01-11 08:09:54 +0000
committerSimon Josefsson <simon@josefsson.org>2007-01-11 08:09:54 +0000
commitfdd88fb3d2a5f7a74a608743f334ed84895bcc4d (patch)
treedd0e1b16c38cebe6186ad6b57a4aa4487140d498 /libextra
parente3652edc1e88e2a985874ed428ec4db629fcfb67 (diff)
downloadgnutls-fdd88fb3d2a5f7a74a608743f334ed84895bcc4d.tar.gz
Cleanup gnutls vs gnutls-extra integration, for OpenPGP certs.
Diffstat (limited to 'libextra')
-rw-r--r--libextra/gnutls_extra.c61
1 files changed, 17 insertions, 44 deletions
diff --git a/libextra/gnutls_extra.c b/libextra/gnutls_extra.c
index 80400a5b69..26fb6e8aa6 100644
--- a/libextra/gnutls_extra.c
+++ b/libextra/gnutls_extra.c
@@ -27,6 +27,7 @@
#include <gnutls_extensions.h>
#include <gnutls_openpgp.h>
#include <gnutls_extra.h>
+#include <gnutls_extra_hooks.h>
#include <gnutls_algorithms.h>
#ifdef USE_LZO
# ifdef USE_MINILZO
@@ -86,55 +87,17 @@ _gnutls_add_lzo_comp (void)
}
#endif
-extern OPENPGP_KEY_CREATION_TIME_FUNC
- _E_gnutls_openpgp_get_raw_key_creation_time;
-extern OPENPGP_KEY_EXPIRATION_TIME_FUNC
- _E_gnutls_openpgp_get_raw_key_expiration_time;
-extern OPENPGP_VERIFY_KEY_FUNC _E_gnutls_openpgp_verify_key;
-extern OPENPGP_FINGERPRINT _E_gnutls_openpgp_fingerprint;
-extern OPENPGP_KEY_REQUEST _E_gnutls_openpgp_request_key;
-
-extern OPENPGP_RAW_KEY_TO_GCERT _E_gnutls_openpgp_raw_key_to_gcert;
-extern OPENPGP_RAW_PRIVKEY_TO_GKEY _E_gnutls_openpgp_raw_privkey_to_gkey;
-
-extern OPENPGP_KEY_TO_GCERT _E_gnutls_openpgp_key_to_gcert;
-extern OPENPGP_PRIVKEY_TO_GKEY _E_gnutls_openpgp_privkey_to_gkey;
-extern OPENPGP_KEY_DEINIT _E_gnutls_openpgp_key_deinit;
-extern OPENPGP_PRIVKEY_DEINIT _E_gnutls_openpgp_privkey_deinit;
-
-static void
-_gnutls_add_openpgp_functions (void)
-{
-#ifdef ENABLE_OPENPGP
- _E_gnutls_openpgp_verify_key = _gnutls_openpgp_verify_key;
- _E_gnutls_openpgp_get_raw_key_expiration_time =
- _gnutls_openpgp_get_raw_key_expiration_time;
- _E_gnutls_openpgp_get_raw_key_creation_time =
- _gnutls_openpgp_get_raw_key_creation_time;
- _E_gnutls_openpgp_fingerprint = _gnutls_openpgp_fingerprint;
- _E_gnutls_openpgp_request_key = _gnutls_openpgp_request_key;
-
- _E_gnutls_openpgp_raw_key_to_gcert = _gnutls_openpgp_raw_key_to_gcert;
- _E_gnutls_openpgp_raw_privkey_to_gkey = _gnutls_openpgp_raw_privkey_to_gkey;
-
- _E_gnutls_openpgp_key_to_gcert = _gnutls_openpgp_key_to_gcert;
- _E_gnutls_openpgp_privkey_to_gkey = _gnutls_openpgp_privkey_to_gkey;
- _E_gnutls_openpgp_key_deinit = gnutls_openpgp_key_deinit;
- _E_gnutls_openpgp_privkey_deinit = gnutls_openpgp_privkey_deinit;
-#endif
-}
-
static int _gnutls_init_extra = 0;
/**
* gnutls_global_init_extra - This function initializes the global state of gnutls-extra
*
- * This function initializes the global state of gnutls-extra library to defaults.
- * Returns zero on success.
+ * This function initializes the global state of gnutls-extra library
+ * to defaults. Returns zero on success.
*
- * Note that gnutls_global_init() has to be called before this function.
- * If this function is not called then the gnutls-extra library will not
- * be usable.
+ * Note that gnutls_global_init() has to be called before this
+ * function. If this function is not called then the gnutls-extra
+ * library will not be usable.
*
**/
int
@@ -180,7 +143,17 @@ gnutls_global_init_extra (void)
/* Register the openpgp functions. This is because some
* of them are defined to be NULL in the main library.
*/
- _gnutls_add_openpgp_functions ();
+ _gnutls_add_openpgp_functions (_gnutls_openpgp_verify_key,
+ _gnutls_openpgp_get_raw_key_creation_time,
+ _gnutls_openpgp_get_raw_key_expiration_time,
+ _gnutls_openpgp_fingerprint,
+ _gnutls_openpgp_request_key,
+ _gnutls_openpgp_raw_key_to_gcert,
+ _gnutls_openpgp_raw_privkey_to_gkey,
+ _gnutls_openpgp_key_to_gcert,
+ _gnutls_openpgp_privkey_to_gkey,
+ gnutls_openpgp_key_deinit,
+ gnutls_openpgp_privkey_deinit);
return 0;
}