summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2021-11-01 08:28:31 +0000
committertb <>2021-11-01 08:28:31 +0000
commita70e39e12d0c283caba589c494e6ab2aad779422 (patch)
tree0cd70e33d4a31d216c77f302210d8a4102257b27
parent9e4ccc5228dcbfa0dfefbcb77f4fbc4409e63949 (diff)
downloadopenbsd-a70e39e12d0c283caba589c494e6ab2aad779422.tar.gz
openbsd-a70e39e12d0c283caba589c494e6ab2aad779422.tar.bz2
openbsd-a70e39e12d0c283caba589c494e6ab2aad779422.zip
Rework x509attribute regress test in such a way that it doesn't need
to reach into opaque structs.
Diffstat (limited to '')
-rw-r--r--src/regress/lib/libcrypto/x509/x509attribute.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/regress/lib/libcrypto/x509/x509attribute.c b/src/regress/lib/libcrypto/x509/x509attribute.c
index 4f98114458..908935cb6e 100644
--- a/src/regress/lib/libcrypto/x509/x509attribute.c
+++ b/src/regress/lib/libcrypto/x509/x509attribute.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509attribute.c,v 1.2 2021/10/31 08:27:15 tb Exp $ */ 1/* $OpenBSD: x509attribute.c,v 1.3 2021/11/01 08:28:31 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org> 3 * Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4 * 4 *
@@ -15,8 +15,6 @@
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */ 16 */
17 17
18#define LIBRESSL_CRYPTO_INTERNAL
19
20#include <errno.h> 18#include <errno.h>
21#include <stdio.h> 19#include <stdio.h>
22#include <string.h> 20#include <string.h>
@@ -85,14 +83,12 @@ main(void)
85 if ((attrib = X509_ATTRIBUTE_create(NID_pkcs9_contentType, 83 if ((attrib = X509_ATTRIBUTE_create(NID_pkcs9_contentType,
86 V_ASN1_OBJECT, coid)) == NULL) 84 V_ASN1_OBJECT, coid)) == NULL)
87 fail_str("X509_ATTRIBUTE_create", "NULL"); 85 fail_str("X509_ATTRIBUTE_create", "NULL");
88 else if (attrib->object == NULL) 86 else if (X509_ATTRIBUTE_get0_object(attrib) == NULL)
89 fail_str("attrib->object", "NULL"); 87 fail_str("X509_ATTRIBUTE_get0_object", "NULL");
90 else if (attrib->single) 88 else if ((num = X509_ATTRIBUTE_count(attrib)) != 1)
91 fail_int("attrib->single", attrib->single); 89 fail_int("X509_ATTRIBUTE_count", num);
92 else if ((num = sk_ASN1_TYPE_num(attrib->value.set)) != 1) 90 else if ((any = X509_ATTRIBUTE_get0_type(attrib, 0)) == NULL)
93 fail_int("num", num); 91 fail_str("X509_ATTRIBUTE_get0_type", "NULL");
94 else if ((any = sk_ASN1_TYPE_value(attrib->value.set, 0)) == NULL)
95 fail_str("any", "NULL");
96 else if (any->type != V_ASN1_OBJECT) 92 else if (any->type != V_ASN1_OBJECT)
97 fail_int("any->type", any->type); 93 fail_int("any->type", any->type);
98 else if (any->value.object != coid) 94 else if (any->value.object != coid)