If we've not been inited don't deinit
[openssl.git] / include / openssl / store.h
index cd07b26d4b893cab3827e2c715c1f0a89a6b700a..01fa8461bf877d240aea2fb895b568c40d47c1f2 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */
 /*
  * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
  * 2003.
@@ -67,7 +66,7 @@
 # endif
 
 # include <openssl/ossl_typ.h>
-# ifdef OPENSSL_USE_DEPRECATED
+# if OPENSSL_API_COMPAT < 0x10100000L
 #  include <openssl/evp.h>
 #  include <openssl/bn.h>
 #  include <openssl/x509.h>
@@ -122,9 +121,9 @@ int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f) (void));
 /* Some methods may use extra data */
 # define STORE_set_app_data(s,arg)       STORE_set_ex_data(s,0,arg)
 # define STORE_get_app_data(s)           STORE_get_ex_data(s,0)
-int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
-                           CRYPTO_EX_dup *dup_func,
-                           CRYPTO_EX_free *free_func);
+
+#define STORE_get_ex_new_index(l, p, newf, dupf, freef) \
+    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_STORE, l, p, newf, dupf, freef)
 int STORE_set_ex_data(STORE *r, int idx, void *arg);
 void *STORE_get_ex_data(STORE *r, int idx);
 
@@ -180,8 +179,7 @@ typedef enum STORE_params {
     STORE_PARAM_KEY_PARAMETERS = 0x03, /* ??? */
     STORE_PARAM_KEY_NO_PARAMETERS = 0x04, /* N/A */
     STORE_PARAM_AUTH_PASSPHRASE = 0x05, /* char * */
-    STORE_PARAM_AUTH_KRB5_TICKET = 0x06, /* void * */
-    STORE_PARAM_TYPE_NUM = 0x06 /* The amount of known parameter types */
+    STORE_PARAM_TYPE_NUM = 0x05 /* The amount of known parameter types */
 } STORE_PARAM_TYPES;
 /*
  * Parameter value sizes.  -1 means unknown, anything else is the required
@@ -245,10 +243,19 @@ typedef struct STORE_OBJECT_st {
         BUF_MEM *arbitrary;
     } data;
 } STORE_OBJECT;
-DECLARE_STACK_OF(STORE_OBJECT)
+DEFINE_STACK_OF(STORE_OBJECT)
 STORE_OBJECT *STORE_OBJECT_new(void);
 void STORE_OBJECT_free(STORE_OBJECT *data);
 
+/* A generic structure to pass assorted data in a expandable way */
+typedef struct openssl_item_st {
+    int code;
+    void *value;                /* Not used for flag attributes */
+    size_t value_size;          /* Max size of value for output, length for
+                                 * input */
+    size_t *value_length;       /* Returned length of value for output */
+} OPENSSL_ITEM;
+
 /*
  * The following functions handle the storage. They return 0, a negative
  * number or NULL on error, anything else on success.