Skip to content

Commit 1350164

Browse files
committed
Merge PR 375
openssl-1.0.2 compat, fix compiler warnings Enable werror in CI build
1 parent ed6cac2 commit 1350164

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/openssl-1.0.2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
# configure without --enable-werror since openssl 1.0.2 will give warnings
9292
run: |
9393
autoreconf -fi
94-
./configure --with-openssl=$HOME/openssl
94+
./configure --enable-werror --with-openssl=$HOME/openssl
9595
9696
- name: 'build'
9797
run: make V=1

src/md_crypt.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
#define MD_HAVE_CT 0
7070
#endif
7171

72+
#if OPENSSL_VERSION_NUMBER < 0x10100000L
73+
#define MD_OPENSSL_10x
74+
#endif
75+
7276
static int initialized;
7377

7478
struct md_pkey_t {
@@ -257,9 +261,9 @@ static apr_time_t md_asn1_time_get(const ASN1_TIME* time)
257261
#endif
258262
}
259263

260-
apr_time_t md_asn1_generalized_time_get(void *ASN1_GENERALIZEDTIME)
264+
apr_time_t md_asn1_generalized_time_get(void *asn1_gtime)
261265
{
262-
return md_asn1_time_get(ASN1_GENERALIZEDTIME);
266+
return md_asn1_time_get(asn1_gtime);
263267
}
264268

265269
/**************************************************************************************************/
@@ -803,7 +807,11 @@ static apr_status_t check_EC_curve(int nid, apr_pool_t *p) {
803807
int rv = APR_ENOENT;
804808

805809
nc = EC_get_builtin_curves(NULL, 0);
810+
#ifdef MD_OPENSSL_10x
811+
if (NULL == (curves = OPENSSL_malloc((int)(sizeof(*curves) * nc))) ||
812+
#else
806813
if (NULL == (curves = OPENSSL_malloc(sizeof(*curves) * nc)) ||
814+
#endif
807815
nc != EC_get_builtin_curves(curves, nc)) {
808816
rv = APR_EGENERAL;
809817
md_log_perror(MD_LOG_MARK, MD_LOG_ERR, rv, p,
@@ -1515,7 +1523,11 @@ apr_status_t md_cert_read_chain(apr_array_header_t *chain, apr_pool_t *p,
15151523
md_cert_t *cert;
15161524
int added = 0;
15171525

1526+
#ifdef MD_OPENSSL_10x
1527+
if (NULL == (bf = BIO_new_mem_buf((char *)pem, (int)pem_len))) {
1528+
#else
15181529
if (NULL == (bf = BIO_new_mem_buf(pem, (int)pem_len))) {
1530+
#endif
15191531
rv = APR_ENOMEM;
15201532
goto cleanup;
15211533
}

0 commit comments

Comments
 (0)