diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-03-07 22:45:58 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-16 11:17:33 +0200 |
commit | c5ebfcab713a82a1d46a51c8c2668c419425b387 (patch) | |
tree | ca8da99a90b24c37c37ce417ad02c1f35e1e1735 /include | |
parent | Small MSVC build fixes. (diff) | |
download | openssl-c5ebfcab713a82a1d46a51c8c2668c419425b387.tar.xz openssl-c5ebfcab713a82a1d46a51c8c2668c419425b387.zip |
Unify <TYPE>_up_ref methods signature and behaviour.
Add a status return value instead of void.
Add some sanity checks on reference counter value.
Update the docs.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/openssl/evp.h | 2 | ||||
-rw-r--r-- | include/openssl/ssl.h | 4 | ||||
-rw-r--r-- | include/openssl/x509.h | 4 | ||||
-rw-r--r-- | include/openssl/x509_vfy.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 250730f4a0..bfb5dc8988 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -976,7 +976,7 @@ struct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); # endif EVP_PKEY *EVP_PKEY_new(void); -void EVP_PKEY_up_ref(EVP_PKEY *pkey); +int EVP_PKEY_up_ref(EVP_PKEY *pkey); void EVP_PKEY_free(EVP_PKEY *pkey); EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h index 0ab0df2749..cf02047d67 100644 --- a/include/openssl/ssl.h +++ b/include/openssl/ssl.h @@ -1379,7 +1379,7 @@ void BIO_ssl_shutdown(BIO *ssl_bio); __owur int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str); __owur SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth); -void SSL_CTX_up_ref(SSL_CTX *ctx); +int SSL_CTX_up_ref(SSL_CTX *ctx); void SSL_CTX_free(SSL_CTX *); __owur long SSL_CTX_set_timeout(SSL_CTX *ctx, long t); __owur long SSL_CTX_get_timeout(const SSL_CTX *ctx); @@ -1554,7 +1554,7 @@ __owur int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid unsigned int sid_ctx_len); SSL *SSL_new(SSL_CTX *ctx); -void SSL_up_ref(SSL *s); +int SSL_up_ref(SSL *s); __owur int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx, unsigned int sid_ctx_len); diff --git a/include/openssl/x509.h b/include/openssl/x509.h index 009ee6aa4c..febe621b5b 100644 --- a/include/openssl/x509.h +++ b/include/openssl/x509.h @@ -674,7 +674,7 @@ int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); ASN1_TIME *X509_get_notAfter(X509 *x); int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); -void X509_up_ref(X509 *x); +int X509_up_ref(X509 *x); int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in @@ -731,7 +731,7 @@ int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); int X509_CRL_sort(X509_CRL *crl); -void X509_CRL_up_ref(X509_CRL *crl); +int X509_CRL_up_ref(X509_CRL *crl); long X509_CRL_get_version(X509_CRL *crl); ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl); diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h index 1c86d3148c..ae93c7b33c 100644 --- a/include/openssl/x509_vfy.h +++ b/include/openssl/x509_vfy.h @@ -277,7 +277,7 @@ X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, int type, X509_NAME *name); X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); -void X509_OBJECT_up_ref_count(X509_OBJECT *a); +int X509_OBJECT_up_ref_count(X509_OBJECT *a); void X509_OBJECT_free(X509_OBJECT *a); int X509_OBJECT_get_type(X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(X509_OBJECT *a); |