* IMPLEMENT_PEM_rw_cb(...)
*/
+# define PEM_write_fnsig(name, type, OUTTYPE, writename) \
+ int PEM_##writename##_##name(OUTTYPE *out, const type *x)
+# define PEM_write_cb_fnsig(name, type, OUTTYPE, writename) \
+ int PEM_##writename##_##name(OUTTYPE *out, const type *x, \
+ const EVP_CIPHER *enc, \
+ const unsigned char *kstr, int klen, \
+ pem_password_cb *cb, void *u)
+
# ifdef OPENSSL_NO_STDIO
# define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/
}
# define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \
- int PEM_write_##name(FILE *fp, const type *x) \
+ PEM_write_fnsig(name, type, FILE, write) \
{ \
- return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, fp, \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
x, NULL, NULL, 0, NULL, NULL); \
}
# endif
# define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \
- int PEM_write_##name(FILE *fp, const type *x, \
- const EVP_CIPHER *enc, \
- const unsigned char *kstr, int klen, \
- pem_password_cb *cb, void *u) \
+ PEM_write_cb_fnsig(name, type, FILE, write) \
{ \
- return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, fp, \
+ return PEM_ASN1_write((i2d_of_void *)i2d_##asn1, str, out, \
x, enc, kstr, klen, cb, u); \
}
}
# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \
- int PEM_write_bio_##name(BIO *bp, const type *x) \
+ PEM_write_fnsig(name, type, BIO, write_bio) \
{ \
- return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, bp, \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
x, NULL,NULL,0,NULL,NULL); \
}
# endif
# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \
- int PEM_write_bio_##name(BIO *bp, const type *x, \
- const EVP_CIPHER *enc, \
- const unsigned char *kstr, int klen, \
- pem_password_cb *cb, void *u) \
+ PEM_write_cb_fnsig(name, type, BIO, write_bio) \
{ \
- return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, bp, \
+ return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1, str, out, \
x, enc, kstr, klen, cb, u); \
}
type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);
# define DECLARE_PEM_write_fp(name, type) \
- int PEM_write_##name(FILE *fp, const type *x);
+ PEM_write_fnsig(name, type, FILE, write);
# ifndef OPENSSL_NO_DEPRECATED_3_0
-# define DECLARE_PEM_write_fp_const(name, type) \
- DECLARE_PEM_write_fp(name, type)
+# define DECLARE_PEM_write_fp_const(name, type) \
+ PEM_write_fnsig(name, type, FILE, write);
# endif
-# define DECLARE_PEM_write_cb_fp(name, type) \
- int PEM_write_##name(FILE *fp, const type *x, \
- const EVP_CIPHER *enc, \
- const unsigned char *kstr, int klen, \
- pem_password_cb *cb, void *u);
+# define DECLARE_PEM_write_cb_fp(name, type) \
+ PEM_write_cb_fnsig(name, type, FILE, write);
# endif
pem_password_cb *cb, void *u);
# define DECLARE_PEM_write_bio(name, type) \
- int PEM_write_bio_##name(BIO *bp, const type *x);
+ PEM_write_fnsig(name, type, BIO, write_bio);
# ifndef OPENSSL_NO_DEPRECATED_3_0
-# define DECLARE_PEM_write_bio_const(name, type) \
- DECLARE_PEM_write_bio(name, type)
+# define DECLARE_PEM_write_bio_const(name, type) \
+ PEM_write_fnsig(name, type, BIO, write_bio);
# endif
-# define DECLARE_PEM_write_cb_bio(name, type) \
- int PEM_write_bio_##name(BIO *bp, const type *x, \
- const EVP_CIPHER *enc, \
- const unsigned char *kstr, int klen, \
- pem_password_cb *cb, void *u);
+# define DECLARE_PEM_write_cb_bio(name, type) \
+ PEM_write_cb_fnsig(name, type, BIO, write_bio);
# define DECLARE_PEM_write(name, type) \
DECLARE_PEM_write_bio(name, type) \