summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-07-24 19:25:37 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-07-24 19:25:37 +0000
commit6d62e4e94df33757fb1ce8c2f0a27094185fa185 (patch)
tree82afe4cca1229edee48d5670f00f22ff768f1631 /lib
parent863d3fe57dfca1078966017b2a4db8f1fb45244e (diff)
Prepare to provide various TS_STATUS_INFO accessors
This adds TS_STATUS_get0_{failure_info,text,status}() as well as TS_STATUS_INFO_set_status(). These will be needed by Ruby and openssl(1) when we make the structs in ts.h opaque. ok kn jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ts/ts.h10
-rw-r--r--lib/libcrypto/ts/ts_rsp_utils.c26
2 files changed, 34 insertions, 2 deletions
diff --git a/lib/libcrypto/ts/ts.h b/lib/libcrypto/ts/ts.h
index 31b916983ed..3c6baf82e07 100644
--- a/lib/libcrypto/ts/ts.h
+++ b/lib/libcrypto/ts/ts.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ts.h,v 1.15 2022/07/24 08:16:47 tb Exp $ */
+/* $OpenBSD: ts.h,v 1.16 2022/07/24 19:25:36 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL
* project 2002, 2003, 2004.
*/
@@ -398,6 +398,14 @@ int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);
TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);
+#if defined(LIBRESSL_INTERNAL)
+const ASN1_UTF8STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *si);
+const STACK_OF(ASN1_UTF8STRING) *
+ TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *si);
+const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *si);
+int TS_STATUS_INFO_set_status(TS_STATUS_INFO *si, int i);
+#endif
+
/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);
PKCS7 *TS_RESP_get_token(TS_RESP *a);
diff --git a/lib/libcrypto/ts/ts_rsp_utils.c b/lib/libcrypto/ts/ts_rsp_utils.c
index 995dbb80358..2e37f26fdae 100644
--- a/lib/libcrypto/ts/ts_rsp_utils.c
+++ b/lib/libcrypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ts_rsp_utils.c,v 1.8 2022/07/24 08:16:47 tb Exp $ */
+/* $OpenBSD: ts_rsp_utils.c,v 1.9 2022/07/24 19:25:36 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
* project 2002.
*/
@@ -91,6 +91,30 @@ TS_RESP_get_status_info(TS_RESP *a)
return a->status_info;
}
+const ASN1_UTF8STRING *
+TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *si)
+{
+ return si->failure_info;
+}
+
+const STACK_OF(ASN1_UTF8STRING) *
+TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *si)
+{
+ return si->text;
+}
+
+const ASN1_INTEGER *
+TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *si)
+{
+ return si->status;
+}
+
+int
+TS_STATUS_INFO_set_status(TS_STATUS_INFO *si, int i)
+{
+ return ASN1_INTEGER_set(si->status, i);
+}
+
/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
void
TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info)