]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
pkcs7: support Data Content Type
authorDmitry Baryshkov <dbaryshkov@gmail.com>
Thu, 14 May 2020 03:03:22 +0000 (06:03 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Sun, 11 Sep 2022 13:24:47 +0000 (16:24 +0300)
As a first step towards supporting different PKCS7 content types, add
support for plain Data Content Type.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
lib/x509/pkcs7-output.c
lib/x509/pkcs7-sign.c
lib/x509/pkcs7.c
lib/x509/x509_int.h
tests/cert-tests/Makefile.am
tests/cert-tests/data/rfc4134-3.1.der [new file with mode: 0644]
tests/cert-tests/data/rfc4134-3.1.der.out [new file with mode: 0644]
tests/cert-tests/data/rfc4134-3.2.der [new file with mode: 0644]
tests/cert-tests/data/rfc4134-3.2.der.out [new file with mode: 0644]
tests/cert-tests/pkcs7.sh

index 3d686df22826f20a124547eecd3d8a52a427f738..1021777419151bd1041d6289bae3c8eaa980db62 100644 (file)
@@ -215,53 +215,22 @@ int gnutls_pkcs7_print_signature_info(gnutls_pkcs7_signature_info_st * info,
        return _gnutls_buffer_to_datum(&str, out, 1);
 }
 
-/**
- * gnutls_pkcs7_crt_print:
- * @pkcs7: The PKCS7 struct to be printed
- * @format: Indicate the format to use
- * @out: Newly allocated datum with null terminated string.
- *
- * This function will pretty print a signed PKCS #7 structure, suitable for
- * display to a human.
- *
- * Currently the supported formats are %GNUTLS_CRT_PRINT_FULL and
- * %GNUTLS_CRT_PRINT_COMPACT.
- *
- * The output @out needs to be deallocated using gnutls_free().
- *
- * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
- *   negative error value.
- **/
-int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
-                      gnutls_certificate_print_formats_t format,
-                      gnutls_datum_t * out)
+static void _gnutls_pkcs7_print_signed(gnutls_pkcs7_t pkcs7,
+                                      gnutls_certificate_print_formats_t format,
+                                      gnutls_buffer_st * str)
 {
        int count, ret, i;
        gnutls_pkcs7_signature_info_st info;
-       gnutls_buffer_st str;
-       const char *oid;
-
-       _gnutls_buffer_init(&str);
-
-       /* For backwards compatibility with structures using the default OID,
-        * we don't print the eContent Type explicitly */
-       oid = gnutls_pkcs7_get_embedded_data_oid(pkcs7);
-       if (oid) {
-               if (strcmp(oid, DATA_OID) != 0
-                   && strcmp(oid, DIGESTED_DATA_OID) != 0) {
-                       addf(&str, "eContent Type: %s\n", oid);
-               }
-       }
 
        for (i = 0;; i++) {
                if (i == 0)
-                       addf(&str, "Signers:\n");
+                       addf(str, "Signers:\n");
 
                ret = gnutls_pkcs7_get_signature_info(pkcs7, i, &info);
                if (ret < 0)
                        break;
 
-               print_pkcs7_info(&info, &str, format);
+               print_pkcs7_info(&info, str, format);
                gnutls_pkcs7_signature_info_deinit(&info);
        }
 
@@ -271,14 +240,14 @@ int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
                count = gnutls_pkcs7_get_crt_count(pkcs7);
 
                if (count > 0) {
-                       addf(&str, "Number of certificates: %u\n\n",
+                       addf(str, "Number of certificates: %u\n\n",
                             count);
 
                        for (i = 0; i < count; i++) {
                                ret =
                                    gnutls_pkcs7_get_crt_raw2(pkcs7, i, &data);
                                if (ret < 0) {
-                                       addf(&str,
+                                       addf(str,
                                             "Error: cannot print certificate %d\n",
                                             i);
                                        continue;
@@ -292,8 +261,8 @@ int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
                                        continue;
                                }
 
-                               adds(&str, (char*)b64.data);
-                               adds(&str, "\n");
+                               adds(str, (char*)b64.data);
+                               adds(str, "\n");
                                gnutls_free(b64.data);
                                gnutls_free(data.data);
                        }
@@ -301,13 +270,13 @@ int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
 
                count = gnutls_pkcs7_get_crl_count(pkcs7);
                if (count > 0) {
-                       addf(&str, "Number of CRLs: %u\n\n", count);
+                       addf(str, "Number of CRLs: %u\n\n", count);
 
                        for (i = 0; i < count; i++) {
                                ret =
                                    gnutls_pkcs7_get_crl_raw2(pkcs7, i, &data);
                                if (ret < 0) {
-                                       addf(&str,
+                                       addf(str,
                                             "Error: cannot print certificate %d\n",
                                             i);
                                        continue;
@@ -321,13 +290,65 @@ int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
                                        continue;
                                }
 
-                               adds(&str, (char*)b64.data);
-                               adds(&str, "\n");
+                               adds(str, (char*)b64.data);
+                               adds(str, "\n");
                                gnutls_free(b64.data);
                                gnutls_free(data.data);
                        }
                }
        }
+}
+
+/**
+ * gnutls_pkcs7_print:
+ * @pkcs7: The PKCS7 struct to be printed
+ * @format: Indicate the format to use
+ * @out: Newly allocated datum with null terminated string.
+ *
+ * This function will pretty print a signed PKCS #7 structure, suitable for
+ * display to a human.
+ *
+ * Currently the supported formats are %GNUTLS_CRT_PRINT_FULL and
+ * %GNUTLS_CRT_PRINT_COMPACT.
+ *
+ * The output @out needs to be deallocated using gnutls_free().
+ *
+ * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a
+ *   negative error value.
+ **/
+int gnutls_pkcs7_print(gnutls_pkcs7_t pkcs7,
+                      gnutls_certificate_print_formats_t format,
+                      gnutls_datum_t * out)
+{
+       gnutls_buffer_st str;
+       const char *oid;
+
+       _gnutls_buffer_init(&str);
+
+       /* For backwards compatibility with structures using the default OID,
+        * we don't print the eContent Type explicitly */
+       oid = gnutls_pkcs7_get_embedded_data_oid(pkcs7);
+       if (oid) {
+               if (strcmp(oid, DATA_OID) != 0
+                   && strcmp(oid, DIGESTED_DATA_OID) != 0) {
+                       addf(&str, "eContent Type: %s\n", oid);
+               }
+       }
+
+       /* For backwards compatibility don't print anything for Signed-data
+        * files. Print type for all other files */
+       switch (pkcs7->type) {
+       case GNUTLS_PKCS7_DATA:
+               adds(&str, "Content Type: Data\n");
+               addf(&str, "Embedded size: %d octets\n\n", pkcs7->der_encap_data.size);
+               break;
+       case GNUTLS_PKCS7_SIGNED:
+               _gnutls_pkcs7_print_signed(pkcs7, format, &str);
+               break;
+       default:
+               adds(&str, "Unsupported PKCS#7 Content Type\n");
+               break;
+       }
 
        return _gnutls_buffer_to_datum(&str, out, 1);
 }
index 8191092bf44e629c9c117f5b5ea397cac78376fa..d121c56c8a1c9924a90532e47929ffb42c3e4b61 100644 (file)
@@ -167,7 +167,7 @@ gnutls_pkcs7_get_crt_raw2(gnutls_pkcs7_t pkcs7,
        char oid[MAX_OID_SIZE];
        gnutls_datum_t tmp = { NULL, 0 };
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        /* Step 2. Parse the CertificateSet
@@ -369,7 +369,7 @@ int gnutls_pkcs7_get_signature_count(gnutls_pkcs7_t pkcs7)
 {
        int ret, count;
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        ret =
@@ -408,7 +408,7 @@ int gnutls_pkcs7_get_signature_info(gnutls_pkcs7_t pkcs7, unsigned idx,
        gnutls_datum_t tmp = { NULL, 0 };
        unsigned i;
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        memset(info, 0, sizeof(*info));
@@ -772,7 +772,7 @@ int gnutls_pkcs7_verify_direct(gnutls_pkcs7_t pkcs7,
 
        memset(&info, 0, sizeof(info));
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        ret =
@@ -1193,7 +1193,7 @@ int gnutls_pkcs7_verify(gnutls_pkcs7_t pkcs7,
 
        memset(&info, 0, sizeof(info));
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        ret =
@@ -1243,15 +1243,15 @@ int gnutls_pkcs7_verify(gnutls_pkcs7_t pkcs7,
 /* Creates an empty signed data structure in the pkcs7
  * structure and returns a handle to the signed data.
  */
-static int create_empty_signed_data(asn1_node pkcs7, asn1_node * sdata)
+static int create_empty_signed_data(gnutls_pkcs7_t pkcs7)
 {
        int result;
 
-       *sdata = NULL;
+       pkcs7->content_data = NULL;
 
        if ((result = asn1_create_element
             (_gnutls_get_pkix(), "PKIX1.pkcs-7-SignedData",
-             sdata)) != ASN1_SUCCESS) {
+             &pkcs7->content_data)) != ASN1_SUCCESS) {
                gnutls_assert();
                result = _gnutls_asn2err(result);
                goto cleanup;
@@ -1259,7 +1259,7 @@ static int create_empty_signed_data(asn1_node pkcs7, asn1_node * sdata)
 
        /* Use version 1
         */
-       result = asn1_write_value(*sdata, "version", &one, 1);
+       result = asn1_write_value(pkcs7->content_data, "version", &one, 1);
        if (result != ASN1_SUCCESS) {
                gnutls_assert();
                result = _gnutls_asn2err(result);
@@ -1271,7 +1271,7 @@ static int create_empty_signed_data(asn1_node pkcs7, asn1_node * sdata)
 
        /* id-data */
        result =
-           asn1_write_value(*sdata, "encapContentInfo.eContentType",
+           asn1_write_value(pkcs7->content_data, "encapContentInfo.eContentType",
                             DIGESTED_DATA_OID, 1);
        if (result != ASN1_SUCCESS) {
                gnutls_assert();
@@ -1279,13 +1279,15 @@ static int create_empty_signed_data(asn1_node pkcs7, asn1_node * sdata)
                goto cleanup;
        }
 
-       result = asn1_write_value(*sdata, "encapContentInfo.eContent", NULL, 0);
+       result = asn1_write_value(pkcs7->content_data, "encapContentInfo.eContent", NULL, 0);
        if (result != ASN1_SUCCESS) {
                gnutls_assert();
                result = _gnutls_asn2err(result);
                goto cleanup;
        }
 
+       pkcs7->type = GNUTLS_PKCS7_SIGNED;
+
        /* Add no certificates.
         */
 
@@ -1298,7 +1300,8 @@ static int create_empty_signed_data(asn1_node pkcs7, asn1_node * sdata)
        return 0;
 
  cleanup:
-       asn1_delete_structure(sdata);
+       asn1_delete_structure(&pkcs7->content_data);
+       pkcs7->type = GNUTLS_PKCS7_UNINITIALIZED;
        return result;
 
 }
@@ -1329,13 +1332,16 @@ int gnutls_pkcs7_set_crt_raw(gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crt)
                 * signedData.
                 */
                result =
-                   create_empty_signed_data(pkcs7->pkcs7, &pkcs7->content_data);
+                   create_empty_signed_data(pkcs7);
                if (result < 0) {
                        gnutls_assert();
                        return result;
                }
        }
 
+       if (pkcs7->type != GNUTLS_PKCS7_SIGNED)
+               return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+
        /* Step 2. Append the new certificate.
         */
 
@@ -1425,7 +1431,7 @@ int gnutls_pkcs7_delete_crt(gnutls_pkcs7_t pkcs7, int indx)
        int result;
        char root2[MAX_NAME_SIZE];
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        /* Step 2. Delete the certificate.
@@ -1472,7 +1478,7 @@ gnutls_pkcs7_get_crl_raw2(gnutls_pkcs7_t pkcs7,
        gnutls_datum_t tmp = { NULL, 0 };
        int start, end;
 
-       if (pkcs7 == NULL || crl == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED || crl == NULL)
                return GNUTLS_E_INVALID_REQUEST;
 
        result = _gnutls_x509_read_value(pkcs7->pkcs7, "content", &tmp);
@@ -1604,13 +1610,17 @@ int gnutls_pkcs7_set_crl_raw(gnutls_pkcs7_t pkcs7, const gnutls_datum_t * crl)
                 * signedData.
                 */
                result =
-                   create_empty_signed_data(pkcs7->pkcs7, &pkcs7->content_data);
+                   create_empty_signed_data(pkcs7);
                if (result < 0) {
                        gnutls_assert();
                        return result;
                }
        }
 
+       if (pkcs7->type != GNUTLS_PKCS7_SIGNED)
+               return gnutls_assert_val(GNUTLS_E_INVALID_REQUEST);
+
+
        /* Step 2. Append the new crl.
         */
 
@@ -1689,7 +1699,7 @@ int gnutls_pkcs7_delete_crl(gnutls_pkcs7_t pkcs7, int indx)
        int result;
        char root2[MAX_NAME_SIZE];
 
-       if (pkcs7 == NULL)
+       if (pkcs7 == NULL || pkcs7->type != GNUTLS_PKCS7_SIGNED)
                return GNUTLS_E_INVALID_REQUEST;
 
        /* Delete the crl.
@@ -2010,6 +2020,9 @@ int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7,
        if (pkcs7 == NULL || me == NULL)
                return GNUTLS_E_INVALID_REQUEST;
 
+       if (pkcs7->type != GNUTLS_PKCS7_SIGNED)
+               asn1_delete_structure(&pkcs7->content_data);
+
        if (pkcs7->content_data == NULL) {
                result =
                    asn1_create_element(_gnutls_get_pkix(),
@@ -2025,6 +2038,7 @@ int gnutls_pkcs7_sign(gnutls_pkcs7_t pkcs7,
                        (void)asn1_write_value(pkcs7->content_data,
                                         "encapContentInfo.eContent", NULL, 0);
                }
+               pkcs7->type = GNUTLS_PKCS7_SIGNED;
        }
 
        result = asn1_write_value(pkcs7->content_data, "version", &one, 1);
index baa5127f0fab25319341d648cfc37844301b0b6c..9fff94279318f3d532d0a3b7493175094f8f2227 100644 (file)
@@ -36,6 +36,11 @@ static int pkcs7_reinit(gnutls_pkcs7_t pkcs7)
 {
        int result;
 
+       if (pkcs7->content_data)
+               asn1_delete_structure(&pkcs7->content_data);
+
+       _gnutls_free_datum(&pkcs7->der_encap_data);
+
        asn1_delete_structure(&pkcs7->pkcs7);
 
        result = asn1_create_element(_gnutls_get_pkix(),
@@ -46,6 +51,8 @@ static int pkcs7_reinit(gnutls_pkcs7_t pkcs7)
                return result;
        }
 
+       pkcs7->type = GNUTLS_PKCS7_UNINITIALIZED;
+
        return 0;
 }
 
@@ -98,6 +105,54 @@ void gnutls_pkcs7_deinit(gnutls_pkcs7_t pkcs7)
        gnutls_free(pkcs7);
 }
 
+static int _gnutls_pkcs7_decode_plain_data(gnutls_pkcs7_t pkcs7)
+{
+       asn1_node c2;
+       int result;
+       gnutls_datum_t tmp = {NULL, 0};
+
+       if ((result = asn1_create_element
+            (_gnutls_get_pkix(), "PKIX1.pkcs-7-Data",
+             &c2)) != ASN1_SUCCESS) {
+               gnutls_assert();
+               return _gnutls_asn2err(result);
+       }
+
+       /* the Data has been created, so decode it.
+        */
+       result = _gnutls_x509_read_value(pkcs7->pkcs7, "content", &tmp);
+       if (result < 0) {
+               gnutls_assert();
+               goto cleanup;
+       }
+
+       result = asn1_der_decoding(&c2, tmp.data, tmp.size, NULL);
+       if (result != ASN1_SUCCESS) {
+               gnutls_assert();
+               result = _gnutls_asn2err(result);
+               goto cleanup;
+       }
+
+       result = _gnutls_x509_read_value(c2, "", &pkcs7->der_encap_data);
+       if (result < 0) {
+               gnutls_assert();
+               goto cleanup;
+       }
+
+       strcpy(pkcs7->encap_data_oid, DATA_OID);
+
+       pkcs7->content_data = c2;
+       gnutls_free(tmp.data);
+
+       return 0;
+
+ cleanup:
+       gnutls_free(tmp.data);
+       if (c2)
+               asn1_delete_structure(&c2);
+       return result;
+}
+
 /**
  * gnutls_pkcs7_import:
  * @pkcs7: The data to store the parsed PKCS7.
@@ -165,15 +220,18 @@ gnutls_pkcs7_import(gnutls_pkcs7_t pkcs7, const gnutls_datum_t * data,
                return _gnutls_asn2err(result);
        }
 
-       if (strcmp(data_oid, SIGNED_DATA_OID) != 0) {
+       if (strcmp(data_oid, DATA_OID) == 0) {
+               pkcs7->type = GNUTLS_PKCS7_DATA;
+               result = _gnutls_pkcs7_decode_plain_data(pkcs7);
+       } else if (strcmp(data_oid, SIGNED_DATA_OID) == 0) {
+               pkcs7->type = GNUTLS_PKCS7_SIGNED;
+               result = _gnutls_pkcs7_decode_signed_data(pkcs7);
+       } else {
                gnutls_assert();
                _gnutls_debug_log("Unknown PKCS7 Content OID '%s'\n", pkcs7->encap_data_oid);
                return GNUTLS_E_UNKNOWN_PKCS_CONTENT_TYPE;
        }
 
-       /* Decode the signed data.
-        */
-       result = _gnutls_pkcs7_decode_signed_data(pkcs7);
        if (result < 0) {
                gnutls_assert();
                goto cleanup;
@@ -257,6 +315,9 @@ static void disable_opt_fields(gnutls_pkcs7_t pkcs7)
        int result;
        int count;
 
+       if (pkcs7->type != GNUTLS_PKCS7_SIGNED)
+               return;
+
        /* disable the optional fields */
        result = asn1_number_of_elements(pkcs7->content_data, "crls", &count);
        if (result != ASN1_SUCCESS || count == 0) {
@@ -275,6 +336,7 @@ static void disable_opt_fields(gnutls_pkcs7_t pkcs7)
 static int reencode(gnutls_pkcs7_t pkcs7)
 {
        int result;
+       const char *oid;
 
        if (pkcs7->content_data != NULL) {
                disable_opt_fields(pkcs7);
@@ -289,11 +351,20 @@ static int reencode(gnutls_pkcs7_t pkcs7)
                        return gnutls_assert_val(result);
                }
 
+               switch (pkcs7->type) {
+               case GNUTLS_PKCS7_DATA:
+                       oid = DATA_OID;
+                       break;
+               case GNUTLS_PKCS7_SIGNED:
+                       oid = SIGNED_DATA_OID;
+                       break;
+               default:
+                       return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR);
+               }
+
                /* Write the content type of the signed data
                 */
-               result =
-                   asn1_write_value(pkcs7->pkcs7, "contentType",
-                                    SIGNED_DATA_OID, 1);
+               result = asn1_write_value(pkcs7->pkcs7, "contentType", oid, 1);
                if (result != ASN1_SUCCESS) {
                        gnutls_assert();
                        return _gnutls_asn2err(result);
index 085a1a70bd891c59839cd2ed86b5c20215fa4c93..5c9461d1145110ee44999c7a810058fb6278c453 100644 (file)
@@ -115,6 +115,12 @@ typedef struct gnutls_x509_crq_int {
        asn1_node crq;
 } gnutls_x509_crq_int;
 
+typedef enum {
+       GNUTLS_PKCS7_UNINITIALIZED = 0,
+       GNUTLS_PKCS7_DATA = 1,
+       GNUTLS_PKCS7_SIGNED = 2,
+} gnutls_pkcs7_content_type_t;
+
 typedef struct gnutls_pkcs7_attrs_st {
        char *oid;
        gnutls_datum_t data;
@@ -124,6 +130,8 @@ typedef struct gnutls_pkcs7_attrs_st {
 typedef struct gnutls_pkcs7_int {
        asn1_node pkcs7;
 
+       gnutls_pkcs7_content_type_t type;
+
        char encap_data_oid[MAX_OID_SIZE];
 
        gnutls_datum_t der_encap_data;
index 3df478449a81a9bf0d0d172a4158a5b957e59325..b527fe4ecbff7130d90bffab6bae250a333f4e4b 100644 (file)
@@ -101,6 +101,8 @@ EXTRA_DIST = data/ca-no-pathlen.pem data/no-ca-or-pathlen.pem data/aki-cert.pem
        data/cert-with-non-digits-time-ca.pem data/cert-with-non-digits-time.pem \
        data/chain-512-leaf.pem data/chain-512-subca.pem data/chain-512-ca.pem \
        templates/template-no-ca-honor.tmpl templates/template-no-ca-explicit.tmpl \
+       data/rfc4134-3.1.der data/rfc4134-3.1.der.out \
+       data/rfc4134-3.2.der data/rfc4134-3.2.der.out \
        data/crq-cert-no-ca-explicit.pem data/crq-cert-no-ca-honor.pem data/commonName.cer \
        templates/simple-policy.tmpl data/simple-policy.pem
 
diff --git a/tests/cert-tests/data/rfc4134-3.1.der b/tests/cert-tests/data/rfc4134-3.1.der
new file mode 100644 (file)
index 0000000..c4e92dd
Binary files /dev/null and b/tests/cert-tests/data/rfc4134-3.1.der differ
diff --git a/tests/cert-tests/data/rfc4134-3.1.der.out b/tests/cert-tests/data/rfc4134-3.1.der.out
new file mode 100644 (file)
index 0000000..5c92480
--- /dev/null
@@ -0,0 +1,5 @@
+Content Type: Data
+Embedded size: 28 octets
+-----BEGIN PKCS7-----
+MCsGCSqGSIb3DQEHAaAeBBxUaGlzIGlzIHNvbWUgc2FtcGxlIGNvbnRlbnQu
+-----END PKCS7-----
diff --git a/tests/cert-tests/data/rfc4134-3.2.der b/tests/cert-tests/data/rfc4134-3.2.der
new file mode 100644 (file)
index 0000000..9c82edf
--- /dev/null
@@ -0,0 +1 @@
+0+\ 6    *\86H\86÷\r\ 1\a\ 1 \1e\ 4\1cThis is some sample content.
\ No newline at end of file
diff --git a/tests/cert-tests/data/rfc4134-3.2.der.out b/tests/cert-tests/data/rfc4134-3.2.der.out
new file mode 100644 (file)
index 0000000..5c92480
--- /dev/null
@@ -0,0 +1,5 @@
+Content Type: Data
+Embedded size: 28 octets
+-----BEGIN PKCS7-----
+MCsGCSqGSIb3DQEHAaAeBBxUaGlzIGlzIHNvbWUgc2FtcGxlIGNvbnRlbnQu
+-----END PKCS7-----
index 709ee5c07ff2294c24141a1130f58fb08385f303..5235625ba4458f1e5ab9afccb939f223537b434f 100755 (executable)
@@ -47,7 +47,7 @@ else
        GOST_P7B=""
 fi
 
-for FILE in single-ca.p7b full.p7b openssl.p7b openssl-keyid.p7b $GOST_P7B; do
+for FILE in single-ca.p7b full.p7b openssl.p7b openssl-keyid.p7b rfc4134-3.1.der rfc4134-3.2.der $GOST_P7B; do
 ${VALGRIND} "${CERTTOOL}" --inder --p7-info --infile "${srcdir}/data/${FILE}"|grep -v "Signing time" >"${OUTFILE}"
 rc=$?