Add type-safe STACKs and SETs.
[openssl.git] / crypto / x509 / x509.h
index 2f1ca6229b87159b0491d62a4be66b4a256ffa35..0cb6c04f47c439d59ad2d1a74e4e29cc4495e72a 100644 (file)
@@ -66,6 +66,7 @@ extern "C" {
 
 #include "stack.h"
 #include "asn1.h"
+#include "safestack.h"
 
 #ifndef NO_RSA
 #include "rsa.h"
@@ -155,6 +156,8 @@ typedef struct X509_name_st
        unsigned long hash; /* Keep the hash around for lookups */
        } X509_NAME;
 
+DECLARE_STACK_OF(X509_NAME)
+
 #define X509_EX_V_NETSCAPE_HACK                0x8000
 #define X509_EX_V_INIT                 0x0001
 typedef struct X509_extension_st
@@ -228,6 +231,9 @@ typedef struct x509_st
        char *name;
        } X509;
 
+DECLARE_STACK_OF(X509)
+DECLARE_ASN1_SET_OF(X509)
+
 typedef struct X509_revoked_st
        {
        ASN1_INTEGER *serialNumber;
@@ -870,9 +876,9 @@ ASN1_STRING *       X509v3_unpack_string(ASN1_STRING **ex,int type,
 int            X509_verify_cert(X509_STORE_CTX *ctx);
 
 /* lookup a cert from a X509 STACK */
-X509 *X509_find_by_issuer_and_serial(STACK *sk,X509_NAME *name,
-                ASN1_INTEGER *serial);
-X509 *X509_find_by_subject(STACK *sk,X509_NAME *name);
+X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name,
+                                    ASN1_INTEGER *serial);
+X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name);
 
 int i2d_PBEPARAM(PBEPARAM *a, unsigned char **pp);
 PBEPARAM *PBEPARAM_new(void);