diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-12-16 16:13:41 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2015-12-16 16:13:41 +0100 |
commit | d7a42b3c5c2f5a346edeb8ad0986ea22d53dd389 (patch) | |
tree | f3a9b88908309f87de6b63d9bfdf23af565a9b76 /tests/pkcs7-gen.c | |
parent | d6f842d5f5b99a39149ffd296633492273680b73 (diff) | |
download | gnutls-d7a42b3c5c2f5a346edeb8ad0986ea22d53dd389.tar.gz |
tests: updated pkcs7-gen to account for content-type attribute
Diffstat (limited to 'tests/pkcs7-gen.c')
-rw-r--r-- | tests/pkcs7-gen.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/pkcs7-gen.c b/tests/pkcs7-gen.c index 39120eb3c7..f7c51a9afc 100644 --- a/tests/pkcs7-gen.c +++ b/tests/pkcs7-gen.c @@ -175,13 +175,13 @@ void doit(void) exit(1); } - ret = gnutls_pkcs7_get_attr(info.signed_attrs, 1, &oid, &data, GNUTLS_PKCS7_ATTR_ENCODE_OCTET_STRING); + ret = gnutls_pkcs7_get_attr(info.signed_attrs, 1, &oid, &data, 0); if (ret < 0) { fail("error in %d: %s\n", __LINE__, gnutls_strerror(ret)); exit(1); } - if (strcmp(oid, "1.2.3.4") != 0 || data.size != data1.size || memcmp(data.data, data1.data, data.size) != 0) { + if (strcmp(oid, "1.2.840.113549.1.9.3") != 0) { fail("error in %d: %s\n", __LINE__, oid); exit(1); } @@ -193,6 +193,18 @@ void doit(void) exit(1); } + if (strcmp(oid, "1.2.3.4") != 0 || data.size != data1.size || memcmp(data.data, data1.data, data.size) != 0) { + fail("error in %d: %s\n", __LINE__, oid); + exit(1); + } + gnutls_free(data.data); + + ret = gnutls_pkcs7_get_attr(info.signed_attrs, 3, &oid, &data, GNUTLS_PKCS7_ATTR_ENCODE_OCTET_STRING); + if (ret < 0) { + fail("error in %d: %s\n", __LINE__, gnutls_strerror(ret)); + exit(1); + } + if (strcmp(oid, "2.3.4") != 0 || data.size != data2.size || memcmp(data.data, data2.data, data.size) != 0) { fail("error in %d: %s\n", __LINE__, oid); exit(1); |