From ef5b2ba6fb112ea1e433952ed81030bfe9dcc3f4 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Tue, 27 Oct 2015 18:39:07 +0000 Subject: [PATCH] move ECDSA_SIG prototypes Reviewed-by: Richard Levitte --- include/openssl/ec.h | 27 +++++++++++++++++++++++++++ include/openssl/ecdsa.h | 27 --------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/include/openssl/ec.h b/include/openssl/ec.h index 2493f20bc5..5810e36ef8 100644 --- a/include/openssl/ec.h +++ b/include/openssl/ec.h @@ -1001,6 +1001,33 @@ int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, typedef struct ECDSA_SIG_st ECDSA_SIG; +/** Allocates and initialize a ECDSA_SIG structure + * \return pointer to a ECDSA_SIG structure or NULL if an error occurred + */ +ECDSA_SIG *ECDSA_SIG_new(void); + +/** frees a ECDSA_SIG structure + * \param sig pointer to the ECDSA_SIG structure + */ +void ECDSA_SIG_free(ECDSA_SIG *sig); + +/** DER encode content of ECDSA_SIG object (note: this function modifies *pp + * (*pp += length of the DER encoded signature)). + * \param sig pointer to the ECDSA_SIG object + * \param pp pointer to a unsigned char pointer for the output or NULL + * \return the length of the DER encoded ECDSA_SIG object or 0 + */ +int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); + +/** Decodes a DER encoded ECDSA signature (note: this function changes *pp + * (*pp += len)). + * \param sig pointer to ECDSA_SIG pointer (may be NULL) + * \param pp memory buffer with the DER encoded signature + * \param len length of the buffer + * \return pointer to the decoded ECDSA_SIG structure (or NULL) + */ +ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); + # define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x) # ifndef __cplusplus diff --git a/include/openssl/ecdsa.h b/include/openssl/ecdsa.h index fb6813585f..37d2a5a5c2 100644 --- a/include/openssl/ecdsa.h +++ b/include/openssl/ecdsa.h @@ -75,33 +75,6 @@ extern "C" { #endif -/** Allocates and initialize a ECDSA_SIG structure - * \return pointer to a ECDSA_SIG structure or NULL if an error occurred - */ -ECDSA_SIG *ECDSA_SIG_new(void); - -/** frees a ECDSA_SIG structure - * \param sig pointer to the ECDSA_SIG structure - */ -void ECDSA_SIG_free(ECDSA_SIG *sig); - -/** DER encode content of ECDSA_SIG object (note: this function modifies *pp - * (*pp += length of the DER encoded signature)). - * \param sig pointer to the ECDSA_SIG object - * \param pp pointer to a unsigned char pointer for the output or NULL - * \return the length of the DER encoded ECDSA_SIG object or 0 - */ -int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp); - -/** Decodes a DER encoded ECDSA signature (note: this function changes *pp - * (*pp += len)). - * \param sig pointer to ECDSA_SIG pointer (may be NULL) - * \param pp memory buffer with the DER encoded signature - * \param len length of the buffer - * \return pointer to the decoded ECDSA_SIG structure (or NULL) - */ -ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); - /** Computes the ECDSA signature of the given hash value using * the supplied private key and returns the created signature. * \param dgst pointer to the hash value -- 2.40.0