summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-07-24 19:25:36 +0000
committertb <>2022-07-24 19:25:36 +0000
commit6b0d6b3789b6b50cd891b1a4664051804e6a7af5 (patch)
tree87d39a04bd95aafd1498f5fd6ca37d3d058bfb9b /src
parent253d04f7d013245a265e3648df7a6953628b67a3 (diff)
downloadopenbsd-6b0d6b3789b6b50cd891b1a4664051804e6a7af5.tar.gz
openbsd-6b0d6b3789b6b50cd891b1a4664051804e6a7af5.tar.bz2
openbsd-6b0d6b3789b6b50cd891b1a4664051804e6a7af5.zip
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 'src')
-rw-r--r--src/lib/libcrypto/ts/ts.h10
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_utils.c26
2 files changed, 34 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ts/ts.h b/src/lib/libcrypto/ts/ts.h
index 31b916983e..3c6baf82e0 100644
--- a/src/lib/libcrypto/ts/ts.h
+++ b/src/lib/libcrypto/ts/ts.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts.h,v 1.15 2022/07/24 08:16:47 tb Exp $ */ 1/* $OpenBSD: ts.h,v 1.16 2022/07/24 19:25:36 tb Exp $ */
2/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL
3 * project 2002, 2003, 2004. 3 * project 2002, 2003, 2004.
4 */ 4 */
@@ -398,6 +398,14 @@ int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
398int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info); 398int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);
399TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a); 399TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);
400 400
401#if defined(LIBRESSL_INTERNAL)
402const ASN1_UTF8STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *si);
403const STACK_OF(ASN1_UTF8STRING) *
404 TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *si);
405const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *si);
406int TS_STATUS_INFO_set_status(TS_STATUS_INFO *si, int i);
407#endif
408
401/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ 409/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
402void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info); 410void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);
403PKCS7 *TS_RESP_get_token(TS_RESP *a); 411PKCS7 *TS_RESP_get_token(TS_RESP *a);
diff --git a/src/lib/libcrypto/ts/ts_rsp_utils.c b/src/lib/libcrypto/ts/ts_rsp_utils.c
index 995dbb8035..2e37f26fda 100644
--- a/src/lib/libcrypto/ts/ts_rsp_utils.c
+++ b/src/lib/libcrypto/ts/ts_rsp_utils.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ts_rsp_utils.c,v 1.8 2022/07/24 08:16:47 tb Exp $ */ 1/* $OpenBSD: ts_rsp_utils.c,v 1.9 2022/07/24 19:25:36 tb Exp $ */
2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL 2/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
3 * project 2002. 3 * project 2002.
4 */ 4 */
@@ -91,6 +91,30 @@ TS_RESP_get_status_info(TS_RESP *a)
91 return a->status_info; 91 return a->status_info;
92} 92}
93 93
94const ASN1_UTF8STRING *
95TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *si)
96{
97 return si->failure_info;
98}
99
100const STACK_OF(ASN1_UTF8STRING) *
101TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *si)
102{
103 return si->text;
104}
105
106const ASN1_INTEGER *
107TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *si)
108{
109 return si->status;
110}
111
112int
113TS_STATUS_INFO_set_status(TS_STATUS_INFO *si, int i)
114{
115 return ASN1_INTEGER_set(si->status, i);
116}
117
94/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ 118/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
95void 119void
96TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info) 120TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info)