Add const to the 'name', 'header' and 'data' arguments of PEM_write(3) and PEM_write_bio(3). Tested in sthen's bulk with no fallout.
Index: lib/libcrypto/pem/pem.h =================================================================== RCS file: /var/cvs/src/lib/libcrypto/pem/pem.h,v retrieving revision 1.17 diff -u -p -r1.17 pem.h --- lib/libcrypto/pem/pem.h 4 Sep 2016 16:22:54 -0000 1.17 +++ lib/libcrypto/pem/pem.h 13 May 2018 07:13:43 -0000 @@ -385,8 +385,8 @@ int PEM_do_header (EVP_CIPHER_INFO *ciph #ifndef OPENSSL_NO_BIO int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data, long *len); -int PEM_write_bio(BIO *bp, const char *name, char *hdr, unsigned char *data, - long len); +int PEM_write_bio(BIO *bp, const char *name, const char *hdr, + const unsigned char *data, long len); int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, @@ -403,8 +403,8 @@ int PEM_X509_INFO_write_bio(BIO *bp, X50 int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, long *len); -int PEM_write(FILE *fp, char *name, char *hdr, unsigned char *data, - long len); +int PEM_write(FILE *fp, const char *name, const char *hdr, + const unsigned char *data, long len); void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, Index: lib/libcrypto/pem/pem_lib.c =================================================================== RCS file: /var/cvs/src/lib/libcrypto/pem/pem_lib.c,v retrieving revision 1.46 diff -u -p -r1.46 pem_lib.c --- lib/libcrypto/pem/pem_lib.c 14 Apr 2018 07:09:21 -0000 1.46 +++ lib/libcrypto/pem/pem_lib.c 13 May 2018 07:13:43 -0000 @@ -564,7 +564,8 @@ load_iv(char **fromp, unsigned char *to, } int -PEM_write(FILE *fp, char *name, char *header, unsigned char *data, long len) +PEM_write(FILE *fp, const char *name, const char *header, + const unsigned char *data, long len) { BIO *b; int ret; @@ -580,8 +581,8 @@ PEM_write(FILE *fp, char *name, char *he } int -PEM_write_bio(BIO *bp, const char *name, char *header, unsigned char *data, - long len) +PEM_write_bio(BIO *bp, const char *name, const char *header, + const unsigned char *data, long len) { int nlen, n, i, j, outl; unsigned char *buf = NULL;