Change the PEM_* function prototypes to use DECLARE_PEM macros and change
authorDr. Stephen Henson <steve@openssl.org>
Tue, 22 Jun 1999 01:38:31 +0000 (01:38 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 22 Jun 1999 01:38:31 +0000 (01:38 +0000)
util/mkdef.pl to handle this. Also do a 'make update'.

CHANGES
crypto/pem/pem.h
util/libeay.num
util/mkdef.pl

diff --git a/CHANGES b/CHANGES
index 09509c677a64ef605eed0f5273df12ab8e3faaa4..6dddf4a2806a4a7948ba58bab0fc06e257c4351b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,11 @@
 
  Changes between 0.9.3a and 0.9.4
 
+  *) Complete the PEM_* macros with DECLARE_PEM versions to replace the
+     function prototypes in pem.h, also change util/mkdef.pl to add the
+     necessary function names. 
+     [Steve Henson]
+
   *) mk1mf.pl (used by Windows builds) did not properly read the
      options set by Configure in the top level Makefile; typo fixed,
      now "no-idea" etc. works as intended.
index 3f89b0cd9b0d5c8f13c7cfb0fdaebdc24587fad2..0ce05cc9ece977a02a5dd24faa9f4b973495fa34 100644 (file)
@@ -262,6 +262,67 @@ int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
        IMPLEMENT_PEM_read(name, type, str, asn1) \
        IMPLEMENT_PEM_write_cb(name, type, str, asn1)
 
+/* These are the same except they are for the declarations */
+
+#if defined(WIN16) || defined(NO_FP_API)
+
+#define DECLARE_PEM_read_fp(name, type) /**/
+#define DECLARE_PEM_write_fp(name, type) /**/
+#define DECLARE_PEM_write_cb_fp(name, type) /**/
+
+#else
+
+#define DECLARE_PEM_read_fp(name, type) \
+       type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb);
+
+#define DECLARE_PEM_write_fp(name, type) \
+       int PEM_write_##name(FILE *fp, type *x);
+
+#define DECLARE_PEM_write_cb_fp(name, type) \
+       int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \
+            unsigned char *kstr, int klen, pem_password_cb *cb);
+
+#endif
+
+#ifdef HEADER_BIO_H
+#define DECLARE_PEM_read_bio(name, type) \
+       type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb);
+
+#define DECLARE_PEM_write_bio(name, type) \
+       int PEM_write_bio_##name(BIO *bp, type *x);
+
+#define DECLARE_PEM_write_cb_bio(name, type) \
+       int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \
+            unsigned char *kstr, int klen, pem_password_cb *cb);
+
+#else
+
+#define DECLARE_PEM_read_bio(name, type) /**/
+#define DECLARE_PEM_write_bio(name, type) /**/
+#define DECLARE_PEM_write_cb_bio(name, type) /**/
+
+#endif
+
+#define DECLARE_PEM_write(name, type) \
+       DECLARE_PEM_write_bio(name, type) \
+       DECLARE_PEM_write_fp(name, type) 
+
+#define DECLARE_PEM_write_cb(name, type) \
+       DECLARE_PEM_write_cb_bio(name, type) \
+       DECLARE_PEM_write_cb_fp(name, type) 
+
+#define DECLARE_PEM_read(name, type) \
+       DECLARE_PEM_read_bio(name, type) \
+       DECLARE_PEM_read_fp(name, type)
+
+#define DECLARE_PEM_rw(name, type) \
+       DECLARE_PEM_read(name, type) \
+       DECLARE_PEM_write(name, type)
+
+#define DECLARE_PEM_rw_cb(name, type) \
+       DECLARE_PEM_read(name, type) \
+       DECLARE_PEM_write_cb(name, type)
+
 #ifdef SSLEAY_MACROS
 
 #define PEM_write_SSL_SESSION(fp,x) \
@@ -455,6 +516,44 @@ void       PEM_dek_info(char *buf, const char *type, int len, char *str);
 
 #ifndef SSLEAY_MACROS
 
+DECLARE_PEM_rw(X509, X509)
+
+DECLARE_PEM_rw(X509_REQ, X509_REQ)
+
+DECLARE_PEM_rw(X509_CRL, X509_CRL)
+
+DECLARE_PEM_rw(PKCS7, PKCS7)
+
+DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)
+
+DECLARE_PEM_rw(PKCS8, X509_SIG)
+
+DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)
+
+#ifndef NO_RSA
+
+DECLARE_PEM_rw_cb(RSAPrivateKey, RSA)
+
+DECLARE_PEM_rw(RSAPublicKey, RSA)
+
+#endif
+
+#ifndef NO_DSA
+
+DECLARE_PEM_rw_cb(DSAPrivateKey, DSA)
+
+DECLARE_PEM_rw(DSAparams, DSA)
+
+#endif
+
+#ifndef NO_DH
+
+DECLARE_PEM_rw(DHparams, DH)
+
+#endif
+
+DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
+
 #ifdef VMS
 /* Too long names need to be abbreviated to at most 31 characters */
 #undef PEM_write_NETSCAPE_CERT_SEQUENCE
@@ -465,107 +564,8 @@ void      PEM_dek_info(char *buf, const char *type, int len, char *str);
 #define PEM_write_bio_NETSCAPE_CERT_SEQUENCE PEM_write_bio_NETSCAPE_CERT_SEQ
 #endif
 
-#ifndef WIN16
-X509 *PEM_read_X509(FILE *fp,X509 **x, pem_password_cb *);
-X509_REQ *PEM_read_X509_REQ(FILE *fp,X509_REQ **x, pem_password_cb *);
-X509_CRL *PEM_read_X509_CRL(FILE *fp,X509_CRL **x, pem_password_cb *);
-#ifndef NO_RSA
-RSA *PEM_read_RSAPrivateKey(FILE *fp,RSA **x, pem_password_cb *);
-RSA *PEM_read_RSAPublicKey(FILE *fp,RSA **x, pem_password_cb *);
-#endif
-#ifndef NO_DSA
-DSA *PEM_read_DSAPrivateKey(FILE *fp,DSA **x, pem_password_cb *);
-DSA *PEM_read_DSAparams(FILE *fp,DSA **x, pem_password_cb *);
-#endif
-#ifndef NO_DH
-DH *PEM_read_DHparams(FILE *fp,DH **x, pem_password_cb *);
-#endif
-EVP_PKEY *PEM_read_PrivateKey(FILE *fp,EVP_PKEY **x, pem_password_cb *);
-PKCS7 *PEM_read_PKCS7(FILE *fp,PKCS7 **x, pem_password_cb *);
-NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE **x, pem_password_cb *);
-X509_SIG *PEM_read_PKCS8(FILE *fp,X509_SIG **x, pem_password_cb *);
-PKCS8_PRIV_KEY_INFO *PEM_read_PKCS8_PRIV_KEY_INFO(FILE *fp,
-                               PKCS8_PRIV_KEY_INFO **x, pem_password_cb *);
-int PEM_write_X509(FILE *fp,X509 *x);
-int PEM_write_X509_REQ(FILE *fp,X509_REQ *x);
-int PEM_write_X509_CRL(FILE *fp,X509_CRL *x);
-#ifndef NO_RSA
-int PEM_write_RSAPrivateKey(FILE *fp,RSA *x,const EVP_CIPHER *enc,unsigned char *kstr,
-        int klen, pem_password_cb *);
-int PEM_write_RSAPublicKey(FILE *fp,RSA *x);
-#endif
-#ifndef NO_DSA
-int PEM_write_DSAPrivateKey(FILE *fp,DSA *x,const EVP_CIPHER *enc,
-                           unsigned char *kstr,
-        int klen, pem_password_cb *);
-#endif
-int PEM_write_PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
-       unsigned char *kstr,int klen, pem_password_cb *);
 int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
                              char *kstr,int klen, pem_password_cb *);
-int PEM_write_PKCS7(FILE *fp,PKCS7 *x);
-#ifndef NO_DH
-int PEM_write_DHparams(FILE *fp,DH *x);
-#endif
-#ifndef NO_DSA
-int PEM_write_DSAparams(FILE *fp,DSA *x);
-#endif
-int PEM_write_NETSCAPE_CERT_SEQUENCE(FILE *fp,NETSCAPE_CERT_SEQUENCE *x);
-int PEM_write_PKCS8(FILE *fp,X509_SIG *x);
-int PEM_write_PKCS8_PRIV_KEY_INFO(FILE *fp,PKCS8_PRIV_KEY_INFO *x);
-#endif
-
-#ifdef HEADER_BIO_H
-X509 *PEM_read_bio_X509(BIO *bp,X509 **x, pem_password_cb *);
-X509_REQ *PEM_read_bio_X509_REQ(BIO *bp,X509_REQ **x, pem_password_cb *);
-X509_CRL *PEM_read_bio_X509_CRL(BIO *bp,X509_CRL **x, pem_password_cb *);
-#ifndef NO_RSA
-RSA *PEM_read_bio_RSAPrivateKey(BIO *bp,RSA **x, pem_password_cb *);
-RSA *PEM_read_bio_RSAPublicKey(BIO *bp,RSA **x, pem_password_cb *);
-#endif
-#ifndef NO_DSA
-DSA *PEM_read_bio_DSAPrivateKey(BIO *bp,DSA **x, pem_password_cb *);
-#endif
-EVP_PKEY *PEM_read_bio_PrivateKey(BIO *bp,EVP_PKEY **x, pem_password_cb *);
-PKCS7 *PEM_read_bio_PKCS7(BIO *bp,PKCS7 **x, pem_password_cb *);
-#ifndef NO_DH
-DH *PEM_read_bio_DHparams(BIO *bp,DH **x, pem_password_cb *);
-#endif
-NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE **x, pem_password_cb *);
-X509_SIG *PEM_read_bio_PKCS8(BIO *bp,X509_SIG **x, pem_password_cb *);
-PKCS8_PRIV_KEY_INFO *PEM_read_bio_PKCS8_PRIV_KEY_INFO(BIO *bp,
-                               PKCS8_PRIV_KEY_INFO **x, pem_password_cb *);
-#ifndef NO_DSA
-DSA *PEM_read_bio_DSAparams(BIO *bp,DSA **x, pem_password_cb *);
-#endif
-int PEM_write_bio_X509(BIO *bp,X509 *x);
-int PEM_write_bio_X509_REQ(BIO *bp,X509_REQ *x);
-int PEM_write_bio_X509_CRL(BIO *bp,X509_CRL *x);
-#ifndef NO_RSA
-int PEM_write_bio_RSAPrivateKey(BIO *fp,RSA *x,const EVP_CIPHER *enc,
-        unsigned char *kstr,int klen, pem_password_cb *);
-int PEM_write_bio_RSAPublicKey(BIO *fp,RSA *x);
-#endif
-#ifndef NO_DSA
-int PEM_write_bio_DSAPrivateKey(BIO *fp,DSA *x,const EVP_CIPHER *enc,
-        unsigned char *kstr,int klen, pem_password_cb *);
-#endif
-int PEM_write_bio_PrivateKey(BIO *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
-        unsigned char *kstr,int klen, pem_password_cb *);
-int PEM_write_bio_PKCS8PrivateKey(BIO *fp,EVP_PKEY *x,const EVP_CIPHER *enc,
-        char *kstr,int klen, pem_password_cb *);
-int PEM_write_bio_PKCS7(BIO *bp,PKCS7 *x);
-#ifndef NO_DH
-int PEM_write_bio_DHparams(BIO *bp,DH *x);
-#endif
-#ifndef NO_DSA
-int PEM_write_bio_DSAparams(BIO *bp,DSA *x);
-#endif
-int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp,NETSCAPE_CERT_SEQUENCE *x);
-int PEM_write_bio_PKCS8(BIO *bp,X509_SIG *x);
-int PEM_write_bio_PKCS8_PRIV_KEY_INFO(BIO *bp,PKCS8_PRIV_KEY_INFO *x);
-#endif
-
 #endif /* SSLEAY_MACROS */
 
 
index fd08ff35fd52da215b920e3622e95e79ce2f9574..36c0cd42acf75f361a9537437806f67770b7dd91 100755 (executable)
@@ -1797,3 +1797,23 @@ sk_CONF_VALUE_new_null                  1821
 sk_CONF_VALUE_dup                       1822
 sk_CONF_VALUE_insert                    1823
 sk_CONF_VALUE_new                       1824
+sk_ASN1_OBJECT_find                     1825
+sk_ASN1_OBJECT_pop_free                 1826
+sk_ASN1_OBJECT_dup                      1827
+sk_ASN1_OBJECT_delete_ptr               1828
+sk_ASN1_OBJECT_new                      1829
+sk_ASN1_OBJECT_unshift                  1830
+sk_ASN1_OBJECT_delete                   1831
+sk_ASN1_OBJECT_shift                    1832
+sk_ASN1_OBJECT_pop                      1833
+sk_ASN1_OBJECT_num                      1834
+sk_ASN1_OBJECT_value                    1835
+sk_ASN1_OBJECT_new_null                 1836
+i2d_ASN1_SET_OF_ASN1_OBJECT             1837
+sk_ASN1_OBJECT_free                     1838
+sk_ASN1_OBJECT_set                      1839
+sk_ASN1_OBJECT_set_cmp_func             1840
+sk_ASN1_OBJECT_zero                     1841
+sk_ASN1_OBJECT_insert                   1842
+sk_ASN1_OBJECT_push                     1843
+d2i_ASN1_SET_OF_ASN1_OBJECT             1844
index 75454dea45dccfcdde7c69709b09c9a780b1ba4d..c2a8d9a07f5f85cadbc9d5901ceccec99d5ac98c 100755 (executable)
@@ -241,6 +241,14 @@ sub do_defs
                                /^\s*DECLARE_ASN1_SET_OF\s*\(\s*(\w*)\s*\)/) {
                                $funcs{"d2i_ASN1_SET_OF_${1}"} = 1;
                                $funcs{"i2d_ASN1_SET_OF_${1}"} = 1;
+                       } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ ||
+                                    /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ ) {
+                               if($W32) {
+                                       $funcs{"PEM_read_${1}"} = 1;
+                                       $funcs{"PEM_write_${1}"} = 1;
+                               }
+                               $funcs{"PEM_read_bio_${1}"} = 1;
+                               $funcs{"PEM_write_bio_${1}"} = 1;
                        } elsif ( 
                                ($tag{'FreeBSD'} != 1) &&
                                ($tag{'CONST_STRICT'} != 1) &&