diff options
author | David Benjamin <davidben@google.com> | 2021-06-20 00:12:23 -0400 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2021-06-23 01:44:11 +0000 |
commit | 87be6592255359481390f7ac90cd1401ecca35e8 (patch) | |
tree | dd7d4958c5415a213ff759d8ac14b957c395dd91 /include | |
parent | 5f8c681d7897a6a7dea5daa8ab361b73e2dd7500 (diff) | |
download | boringssl-87be6592255359481390f7ac90cd1401ecca35e8.zip boringssl-87be6592255359481390f7ac90cd1401ecca35e8.tar.gz boringssl-87be6592255359481390f7ac90cd1401ecca35e8.tar.bz2 |
Document ASN1_STRING_to_UTF8.
We already had a test, but move it to asn1_test.cc since it's part of
the ASN.1 library. Also, since it's easy, test it using public APIs
rather than stack-allocating an ASN1_STRING.
Change-Id: Ic77494e6c8f74584d159a600e334416197761475
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/48227
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/asn1.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h index fe2f29d..4d2368a 100644 --- a/include/openssl/asn1.h +++ b/include/openssl/asn1.h @@ -302,6 +302,13 @@ OPENSSL_EXPORT int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); // |OPENSSL_malloc|. OPENSSL_EXPORT void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); +// ASN1_STRING_to_UTF8 converts |in| to UTF-8. On success, sets |*out| to a +// newly-allocated buffer containing the resulting string and returns the length +// of the string. The caller must call |OPENSSL_free| to release |*out| when +// done. On error, it returns a negative number. +OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, + const ASN1_STRING *in); + // TODO(davidben): Expand and document function prototypes generated in macros. @@ -987,8 +994,6 @@ OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags); #endif -OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); - OPENSSL_EXPORT void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); OPENSSL_EXPORT int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); |