summaryrefslogtreecommitdiff
path: root/lib/x509/pkcs7.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-07 15:19:16 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-10-11 13:59:41 +0200
commit206414e55543e34ece06337132767f1887f569d7 (patch)
treef6b1eea7e743682d4bf1bd23612f542a9691631c /lib/x509/pkcs7.c
parent8d4b93d7beae6831f950f3f89c8688f01cd04f34 (diff)
downloadgnutls-206414e55543e34ece06337132767f1887f569d7.tar.gz
pkcs7: print the eContent type in output functions if it does not match the defaults
Diffstat (limited to 'lib/x509/pkcs7.c')
-rw-r--r--lib/x509/pkcs7.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
index 0d57afa4e7..0ff6efdc4a 100644
--- a/lib/x509/pkcs7.c
+++ b/lib/x509/pkcs7.c
@@ -32,13 +32,10 @@
#include "errors.h"
#include <common.h>
#include <x509_b64.h>
+#include <pkcs7_int.h>
#include <gnutls/abstract.h>
#include <gnutls/pkcs7.h>
-#define SIGNED_DATA_OID "1.2.840.113549.1.7.2"
-#define PLAIN_DATA_OID "1.2.840.113549.1.7.1"
-#define DIGESTED_DATA_OID "1.2.840.113549.1.7.5"
-
#define ATTR_MESSAGE_DIGEST "1.2.840.113549.1.9.4"
#define ATTR_SIGNING_TIME "1.2.840.113549.1.9.5"
#define ATTR_CONTENT_TYPE "1.2.840.113549.1.9.3"
@@ -104,7 +101,7 @@ static int _decode_pkcs7_signed_data(gnutls_pkcs7_t pkcs7)
goto cleanup;
}
- if (strcmp(pkcs7->encap_data_oid, PLAIN_DATA_OID) != 0
+ if (strcmp(pkcs7->encap_data_oid, DATA_OID) != 0
&& strcmp(pkcs7->encap_data_oid, DIGESTED_DATA_OID) != 0) {
_gnutls_debug_log
("Unknown PKCS#7 Encapsulated Content OID '%s'; treating as raw data\n",
@@ -2155,7 +2152,7 @@ int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7,
result =
asn1_write_value(pkcs7->signed_data,
- "encapContentInfo.eContentType", PLAIN_DATA_OID,
+ "encapContentInfo.eContentType", DATA_OID,
0);
if (result != ASN1_SUCCESS) {
ret = _gnutls_asn2err(result);