ct_nid = OBJ_obj2nid(p7_signed_content->type);
+ /* ASN1_STRING is opaque since OpenSSL 4.0, use accessors */
if (ct_nid == NID_pkcs7_data && p7_signed_content->d.data &&
- p7_signed_content->d.data->length > 0 &&
- p7_signed_content->d.data->data) {
+ ASN1_STRING_length(p7_signed_content->d.data) > 0 &&
+ ASN1_STRING_get0_data(p7_signed_content->d.data)) {
int ret;
+ int p7_data_len = ASN1_STRING_length(p7_signed_content->d.data);
+ const unsigned char *p7_data = ASN1_STRING_get0_data(p7_signed_content->d.data);
msg_debug_mime("found an additional part inside of "
"smime structure of type %T/%T; length=%d",
- &ct->type, &ct->subtype, p7_signed_content->d.data->length);
+ &ct->type, &ct->subtype, p7_data_len);
/*
* Since ASN.1 structures are freed, we need to copy
* the content
*/
char *cpy = rspamd_mempool_alloc(task->task_pool,
- p7_signed_content->d.data->length);
- memcpy(cpy, p7_signed_content->d.data->data,
- p7_signed_content->d.data->length);
+ p7_data_len);
+ memcpy(cpy, p7_data, p7_data_len);
/*
* S/MIME re-enters the parser here without going through
st->nesting++;
ret = rspamd_mime_process_multipart_node(task,
st, NULL,
- cpy, cpy + p7_signed_content->d.data->length,
+ cpy, cpy + p7_data_len,
TRUE, err);
st->nesting--;
static gboolean openssl_initialized = FALSE;
if (!openssl_initialized) {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
ERR_load_crypto_strings();
SSL_load_error_strings();
OpenSSL_add_all_algorithms();
OpenSSL_add_all_digests();
OpenSSL_add_all_ciphers();
+#endif
#if OPENSSL_VERSION_NUMBER >= 0x1000104fL && OPENSSL_VERSION_NUMBER < 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
ENGINE_load_builtin_engines();