summaryrefslogtreecommitdiff
path: root/pith/smime.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-09-03 18:44:40 -0600
committerEduardo Chappa <chappa@washington.edu>2016-09-03 18:44:40 -0600
commitbe296fed0db493bd09c0ffd4ee67e8687eb69c1d (patch)
treeaa64a53975e17167c11209cb2fdaeb3addbc2c60 /pith/smime.c
parent7663f0dd87d15a7b53b81aecef8aaf5efd100d3f (diff)
downloadalpine-be296fed0db493bd09c0ffd4ee67e8687eb69c1d.tar.xz
* Alpine does not build with openssl 1.1.0, so this update fixes that.
Users have the option to build with older versions of OpenSSL or with version 1.1.0. The current code is transitional and it is intended that we will move Alpine to build exclusively with version 1.1.0 or above in the future. This update also recognizes if we are using LibreSSL. It was tested with version 2.4.2.
Diffstat (limited to 'pith/smime.c')
-rw-r--r--pith/smime.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pith/smime.c b/pith/smime.c
index 9629f743..389ce012 100644
--- a/pith/smime.c
+++ b/pith/smime.c
@@ -1238,8 +1238,12 @@ smime_init(void)
s_cert_store = get_ca_store();
setup_certs_backup_by_type(CACert);
+#ifdef OPENSSL_1_1_0
+ OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_CIPHERS|OPENSSL_INIT_ADD_ALL_DIGESTS|OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+#else
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
+#endif /* OPENSSL_1_1_0 */
app_RAND_load_file(NULL);
openssl_extra_randomness();
@@ -3142,8 +3146,8 @@ find_certificate_matching_recip_info(PKCS7_RECIP_INFO *ri)
mine = x->cert;
- if(!X509_NAME_cmp(ri->issuer_and_serial->issuer,mine->cert_info->issuer) &&
- !ASN1_INTEGER_cmp(ri->issuer_and_serial->serial,mine->cert_info->serialNumber)){
+ if(!X509_NAME_cmp(ri->issuer_and_serial->issuer,X509_get_issuer_name(mine)) &&
+ !ASN1_INTEGER_cmp(ri->issuer_and_serial->serial,X509_get_serialNumber(mine))){
break;
}
}