Tolerate PKCS#8 DSA format with negative private key.
[openssl.git] / crypto / x509 / x509.h
index ce52e00531403beb553a016a60b0b699793a415c..eb1b7c6b2d34a8cf14b751f9688e73510f0f2245 100644 (file)
@@ -116,6 +116,7 @@ extern "C" {
 /* Under Win32 these are defined in wincrypt.h */
 #undef X509_NAME
 #undef X509_CERT_PAIR
+#undef X509_EXTENSIONS
 #endif
 
 #define X509_FILETYPE_PEM      1
@@ -584,6 +585,7 @@ struct pkcs8_priv_key_info_st
 #define PKCS8_NO_OCTET         1
 #define PKCS8_EMBEDDED_PARAM   2
 #define PKCS8_NS_DB            3
+#define PKCS8_NEG_PRIVKEY      4
         ASN1_INTEGER *version;
         X509_ALGOR *pkeyalg;
         ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */
@@ -793,21 +795,21 @@ int               X509_get_pubkey_parameters(EVP_PKEY *pkey,
                                           STACK_OF(X509) *chain);
 int            i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp);
 EVP_PKEY *     d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp,
-                          size_t length);
+                       long length);
 #ifndef OPENSSL_NO_RSA
 int            i2d_RSA_PUBKEY(RSA *a,unsigned char **pp);
 RSA *          d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp,
-                              size_t length);
+                       long length);
 #endif
 #ifndef OPENSSL_NO_DSA
 int            i2d_DSA_PUBKEY(DSA *a,unsigned char **pp);
 DSA *          d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp,
-                              size_t length);
+                       long length);
 #endif
 #ifndef OPENSSL_NO_EC
 int            i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);
 EC_KEY                 *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp,
-                              size_t length);
+                       long length);
 #endif
 
 DECLARE_ASN1_FUNCTIONS(X509_SIG)
@@ -862,9 +864,8 @@ int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);
 
 X509_PKEY *    X509_PKEY_new(void );
 void           X509_PKEY_free(X509_PKEY *a);
-int            i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp);
-X509_PKEY *    d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp,
-                             size_t length);
+int            i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp);
+X509_PKEY *    d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length);
 
 DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)
 DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
@@ -961,9 +962,15 @@ unsigned long      X509_issuer_name_hash(X509 *a);
 int            X509_subject_name_cmp(const X509 *a, const X509 *b);
 unsigned long  X509_subject_name_hash(X509 *x);
 
+#ifndef OPENSSL_NO_MD5
+unsigned long  X509_issuer_name_hash_old(X509 *a);
+unsigned long  X509_subject_name_hash_old(X509 *x);
+#endif
+
 int            X509_cmp(const X509 *a, const X509 *b);
 int            X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);
 unsigned long  X509_NAME_hash(X509_NAME *x);
+unsigned long  X509_NAME_hash_old(X509_NAME *x);
 
 int            X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
 int            X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
@@ -1153,6 +1160,9 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,
                                 unsigned char *salt, int saltlen,
                                 unsigned char *aiv, int prf_nid);
 
+X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,
+                               int prf_nid, int keylen);
+
 /* PKCS#8 utilities */
 
 DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)