hx509: Add hx509_get_instance()
authorNicolas Williams <nico@twosigma.com>
Thu, 24 Oct 2019 03:15:51 +0000 (22:15 -0500)
committerNicolas Williams <nico@twosigma.com>
Sat, 2 Nov 2019 23:49:42 +0000 (18:49 -0500)
lib/hx509/cert.c
lib/hx509/libhx509-exports.def
lib/hx509/version-script.map

index a375e45d96b14c0c0c610412b8e1dee9da0e43f6..d9a08ae5d64ea44583f60f33c9c663f29ebe28ce 100644 (file)
@@ -101,6 +101,30 @@ init_context_once(void *ignored)
     OpenSSL_add_all_algorithms();
 }
 
+/**
+ * Return a cookie identifying this instance of a library.
+ *
+ * Inputs:
+ *
+ * @context     A krb5_context
+ * @module      Our library name or a library we depend on
+ *
+ * Outputs:     The instance cookie
+ *
+ * @ingroup     krb5_support
+ */
+
+HX509_LIB_FUNCTION uintptr_t HX509_LIB_CALL
+hx509_get_instance(const char *libname)
+{
+    static const char *instance = "libhx509";
+
+    if (strcmp(libname, "hx509") == 0)
+        return (uintptr_t)instance;
+
+    return 0;
+}
+
 /**
  * Creates a hx509 context that most functions in the library
  * uses. The context is only allowed to be used by one thread at each
index 007983efe265800a20be71dc30acf419c0444740..aaf3c5cf62e1916cf87139b2767445532e51ff90 100644 (file)
@@ -175,6 +175,7 @@ EXPORTS
        hx509_free_octet_string_list
        hx509_general_name_unparse
        hx509_get_error_string
+       hx509_get_instance
        hx509_get_one_cert
        hx509_lock_add_cert
        hx509_lock_add_certs
index 576ceab2e3d85fd72f343062faf61fcbc010da9e..737de5f57966de562a56df6dd2d205176e40f435 100644 (file)
@@ -159,6 +159,7 @@ HEIMDAL_X509_1.2 {
                hx509_find_private_alg;
                hx509_general_name_unparse;
                hx509_get_error_string;
+               hx509_get_instance;
                hx509_get_one_cert;
                hx509_lock_add_cert;
                hx509_lock_add_certs;