Update dependencies.
[openssl.git] / crypto / x509 / x509.h
index df04cfed01e9b8d8298dc53c7573fb2a9cb99048..79828daab40a0c41dfe1548394b66301114e6a27 100644 (file)
 extern "C" {
 #endif
 
+#ifdef VMS
+#undef X509_REVOKED_get_ext_by_critical
+#define X509_REVOKED_get_ext_by_critical X509_REVOKED_get_ext_by_critic
+#endif
+
 #include <openssl/stack.h>
 #include <openssl/asn1.h>
 #include <openssl/safestack.h>
@@ -167,13 +172,31 @@ typedef struct X509_extension_st
        void (*ex_free)();              /* clear argp stuff */
        } X509_EXTENSION;
 
+DECLARE_STACK_OF(X509_EXTENSION)
+DECLARE_ASN1_SET_OF(X509_EXTENSION)
+
+/* a sequence of these are used */
+typedef struct x509_attributes_st
+       {
+       ASN1_OBJECT *object;
+       int set; /* 1 for a set, 0 for a single item (which is wrong) */
+       union   {
+               char            *ptr;
+/* 1 */                STACK_OF(ASN1_TYPE) *set;
+/* 0 */                ASN1_TYPE       *single;
+               } value;
+       } X509_ATTRIBUTE;
+
+DECLARE_STACK_OF(X509_ATTRIBUTE)
+DECLARE_ASN1_SET_OF(X509_ATTRIBUTE)
+
 typedef struct X509_req_info_st
        {
        ASN1_INTEGER *version;
        X509_NAME *subject;
        X509_PUBKEY *pubkey;
        /*  d=2 hl=2 l=  0 cons: cont: 00 */
-       STACK /* X509_ATTRIBUTE */ *attributes; /* [ 0 ] */
+       STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
        int req_kludge;
        } X509_REQ_INFO;
 
@@ -196,7 +219,7 @@ typedef struct x509_cinf_st
        X509_PUBKEY *key;
        ASN1_BIT_STRING *issuerUID;             /* [ 1 ] optional in v2 */
        ASN1_BIT_STRING *subjectUID;            /* [ 2 ] optional in v2 */
-       STACK /* X509_EXTENSION */ *extensions; /* [ 3 ] optional in v3 */
+       STACK_OF(X509_EXTENSION) *extensions;   /* [ 3 ] optional in v3 */
        } X509_CINF;
 
 typedef struct x509_st
@@ -216,7 +239,7 @@ typedef struct X509_revoked_st
        {
        ASN1_INTEGER *serialNumber;
        ASN1_UTCTIME *revocationDate;
-       STACK /* optional X509_EXTENSION */ *extensions;
+       STACK_OF(X509_EXTENSION) /* optional */ *extensions;
        int sequence; /* load sequence */
        } X509_REVOKED;
 
@@ -228,7 +251,7 @@ typedef struct X509_crl_info_st
        ASN1_UTCTIME *lastUpdate;
        ASN1_UTCTIME *nextUpdate;
        STACK /* X509_REVOKED */ *revoked;
-       STACK /* [0] X509_EXTENSION */ *extensions;
+       STACK_OF(X509_EXTENSION) /* [0] */ *extensions;
        } X509_CRL_INFO;
 
 typedef struct X509_crl_st
@@ -240,20 +263,6 @@ typedef struct X509_crl_st
        int references;
        } X509_CRL;
 
-/* a sequence of these are used */
-typedef struct x509_attributes_st
-       {
-       ASN1_OBJECT *object;
-       int set; /* 1 for a set, 0 for a single item (which is wrong) */
-       union   {
-               char            *ptr;
-/* 1 */                STACK /* ASN1_TYPE */ *set;
-/* 0 */                ASN1_TYPE       *single;
-               } value;
-       } X509_ATTRIBUTE;
-
-DECLARE_STACK_OF(X509_ATTRIBUTE)
-
 typedef struct private_key_st
        {
        int version;
@@ -288,6 +297,8 @@ typedef struct X509_info_st
 
        int references;
        } X509_INFO;
+
+DECLARE_STACK_OF(X509_INFO)
 #endif
 
 /* The next 2 structures and their 8 routines were sent to me by
@@ -649,7 +660,7 @@ void                X509_ATTRIBUTE_free(X509_ATTRIBUTE *a);
 int            i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a,unsigned char **pp);
 X509_ATTRIBUTE *d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a,unsigned char **pp,
                        long length);
-X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, char *value);
+X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);
 
 
 X509_EXTENSION *X509_EXTENSION_new(void );
@@ -809,13 +820,17 @@ int               X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
 ASN1_OBJECT *  X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
 ASN1_STRING *  X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
 
-int            X509v3_get_ext_count(STACK *x);
-int            X509v3_get_ext_by_NID(STACK *x, int nid, int lastpos);
-int            X509v3_get_ext_by_OBJ(STACK *x,ASN1_OBJECT *obj,int lastpos);
-int            X509v3_get_ext_by_critical(STACK *x, int crit, int lastpos);
-X509_EXTENSION *X509v3_get_ext(STACK *x, int loc);
-X509_EXTENSION *X509v3_delete_ext(STACK *x, int loc);
-STACK *                X509v3_add_ext(STACK **x, X509_EXTENSION *ex, int loc);
+int            X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);
+int            X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,
+                                     int nid, int lastpos);
+int            X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,
+                                     ASN1_OBJECT *obj,int lastpos);
+int            X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,
+                                          int crit, int lastpos);
+X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);
+X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
+STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
+                                        X509_EXTENSION *ex, int loc);
 
 int            X509_get_ext_count(X509 *x);
 int            X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
@@ -890,6 +905,9 @@ PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);
 
 /* Password based encryption routines */
 
+int EVP_PBE_CipherInit (ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
+            unsigned char *salt, int saltlen, int iter, EVP_CIPHER_CTX *ctx,
+            int en_de);
 int EVP_PBE_ALGOR_CipherInit(X509_ALGOR *algor, const char *pass,
                             int passlen, EVP_CIPHER_CTX *ctx, int en_de);
 int EVP_PBE_alg_add(int nid, EVP_CIPHER *cipher, EVP_MD *md,