summaryrefslogtreecommitdiffstats
path: root/crypto/ct
diff options
context:
space:
mode:
authorRob Percival <robpercival@google.com>2016-08-23 18:27:35 +0200
committerMatt Caswell <matt@openssl.org>2016-08-23 21:23:28 +0200
commit63e27d4d0f3ff698013dd8f5c5b71f923366c288 (patch)
tree1e34043c774c0d98dcb5ed5d7c596c6902f13d8f /crypto/ct
parentPrevent double-free of CTLOG public key (diff)
downloadopenssl-63e27d4d0f3ff698013dd8f5c5b71f923366c288.tar.xz
openssl-63e27d4d0f3ff698013dd8f5c5b71f923366c288.zip
Removes {i2o,o2i}_SCT_signature from the CT public API
They may return if an SCT_signature struct is added in the future that allows them to be refactored to conform to the i2d/d2i function signature conventions. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/ct')
-rw-r--r--crypto/ct/ct_locl.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/ct/ct_locl.h b/crypto/ct/ct_locl.h
index 6b2fa3ef0c..b65df5a57d 100644
--- a/crypto/ct/ct_locl.h
+++ b/crypto/ct/ct_locl.h
@@ -171,6 +171,29 @@ __owur int SCT_is_complete(const SCT *sct);
*/
__owur int SCT_signature_is_complete(const SCT *sct);
+/*
+ * TODO(RJPercival): Create an SCT_signature struct and make i2o_SCT_signature
+ * and o2i_SCT_signature conform to the i2d/d2i conventions.
+ */
+
+/*
+* Serialize (to TLS format) an |sct| signature and write it to |out|.
+* If |out| is null, no signature will be output but the length will be returned.
+* If |out| points to a null pointer, a string will be allocated to hold the
+* TLS-format signature. It is the responsibility of the caller to free it.
+* If |out| points to an allocated string, the signature will be written to it.
+* The length of the signature in TLS format will be returned.
+*/
+__owur int i2o_SCT_signature(const SCT *sct, unsigned char **out);
+
+/*
+* Parses an SCT signature in TLS format and populates the |sct| with it.
+* |in| should be a pointer to a string containing the TLS-format signature.
+* |in| will be advanced to the end of the signature if parsing succeeds.
+* |len| should be the length of the signature in |in|.
+* Returns the number of bytes parsed, or a negative integer if an error occurs.
+*/
+__owur int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len);
/*
* Handlers for Certificate Transparency X509v3/OCSP extensions