Finish aligning up_ref functions with OpenSSL 1.1.0.
All external callers should be resolved now.
BUG=89
Change-Id: I6055450e8202c59cca49e4a824be3ec11c32a15a
Reviewed-on: https://boringssl-review.googlesource.com/10285
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 5416c65..9622f96 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -96,8 +96,8 @@
* TODO(fork): remove. */
OPENSSL_EXPORT void BIO_vfree(BIO *bio);
-/* BIO_up_ref increments the reference count of |bio| and returns it. */
-OPENSSL_EXPORT BIO *BIO_up_ref(BIO *bio);
+/* BIO_up_ref increments the reference count of |bio| and returns one. */
+OPENSSL_EXPORT int BIO_up_ref(BIO *bio);
/* Basic I/O. */
diff --git a/include/openssl/dh.h b/include/openssl/dh.h
index 8758413..4025656 100644
--- a/include/openssl/dh.h
+++ b/include/openssl/dh.h
@@ -81,7 +81,7 @@
* count drops to zero. */
OPENSSL_EXPORT void DH_free(DH *dh);
-/* DH_up_ref increments the reference count of |dh|. */
+/* DH_up_ref increments the reference count of |dh| and returns one. */
OPENSSL_EXPORT int DH_up_ref(DH *dh);
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h
index d25bfaa..1e1ff65 100644
--- a/include/openssl/dsa.h
+++ b/include/openssl/dsa.h
@@ -84,7 +84,7 @@
* reference count drops to zero. */
OPENSSL_EXPORT void DSA_free(DSA *dsa);
-/* DSA_up_ref increments the reference count of |dsa|. */
+/* DSA_up_ref increments the reference count of |dsa| and returns one. */
OPENSSL_EXPORT int DSA_up_ref(DSA *dsa);
diff --git a/include/openssl/ec_key.h b/include/openssl/ec_key.h
index 63554a7..0658deb 100644
--- a/include/openssl/ec_key.h
+++ b/include/openssl/ec_key.h
@@ -105,8 +105,7 @@
/* EC_KEY_dup returns a fresh copy of |src| or NULL on error. */
OPENSSL_EXPORT EC_KEY *EC_KEY_dup(const EC_KEY *src);
-/* EC_KEY_up_ref increases the reference count of |key|. It returns one on
- * success and zero otherwise. */
+/* EC_KEY_up_ref increases the reference count of |key| and returns one. */
OPENSSL_EXPORT int EC_KEY_up_ref(EC_KEY *key);
/* EC_KEY_is_opaque returns one if |key| is opaque and doesn't expose its key
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
index a656d6c..b4c7653 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -83,7 +83,7 @@
* reference count drops to zero. */
OPENSSL_EXPORT void RSA_free(RSA *rsa);
-/* RSA_up_ref increments the reference count of |rsa|. */
+/* RSA_up_ref increments the reference count of |rsa| and returns one. */
OPENSSL_EXPORT int RSA_up_ref(RSA *rsa);
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index 6e062f2..5bbf651 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -781,9 +781,8 @@
DECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)
-/* X509_up_ref adds one to the reference count of |x| and returns
- * |x|. */
-OPENSSL_EXPORT X509 *X509_up_ref(X509 *x);
+/* X509_up_ref adds one to the reference count of |x| and returns one. */
+OPENSSL_EXPORT int X509_up_ref(X509 *x);
OPENSSL_EXPORT int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
@@ -894,7 +893,7 @@
OPENSSL_EXPORT int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
OPENSSL_EXPORT int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
OPENSSL_EXPORT int X509_CRL_sort(X509_CRL *crl);
-OPENSSL_EXPORT void X509_CRL_up_ref(X509_CRL *crl);
+OPENSSL_EXPORT int X509_CRL_up_ref(X509_CRL *crl);
OPENSSL_EXPORT int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);
OPENSSL_EXPORT int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);
diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h
index 7ecd981..50ded0d 100644
--- a/include/openssl/x509_vfy.h
+++ b/include/openssl/x509_vfy.h
@@ -437,10 +437,10 @@
X509_NAME *name);
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name);
OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x);
-OPENSSL_EXPORT void X509_OBJECT_up_ref_count(X509_OBJECT *a);
+OPENSSL_EXPORT int X509_OBJECT_up_ref_count(X509_OBJECT *a);
OPENSSL_EXPORT void X509_OBJECT_free_contents(X509_OBJECT *a);
OPENSSL_EXPORT X509_STORE *X509_STORE_new(void );
-OPENSSL_EXPORT void X509_STORE_up_ref(X509_STORE *store);
+OPENSSL_EXPORT int X509_STORE_up_ref(X509_STORE *store);
OPENSSL_EXPORT void X509_STORE_free(X509_STORE *v);
OPENSSL_EXPORT STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm);