[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Tue Mar 22 19:49:39 UTC 2016


The branch master has been updated
       via  d577a69a0f3a56146f644fda010e7efb2c0e693d (commit)
      from  38186bfd4e5be7f212d8e460420e081e0ad852e7 (commit)


- Log -----------------------------------------------------------------
commit d577a69a0f3a56146f644fda010e7efb2c0e693d
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Tue Mar 22 15:26:36 2016 +0000

    remove unused references field
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/asn1/x_info.c   | 17 -----------------
 crypto/asn1/x_pkey.c   | 15 ---------------
 include/openssl/x509.h |  4 ----
 3 files changed, 36 deletions(-)

diff --git a/crypto/asn1/x_info.c b/crypto/asn1/x_info.c
index 4b3b7de..b49c787 100644
--- a/crypto/asn1/x_info.c
+++ b/crypto/asn1/x_info.c
@@ -71,34 +71,17 @@ X509_INFO *X509_INFO_new(void)
         return NULL;
     }
 
-    ret->references = 1;
-
-    ret->lock = CRYPTO_THREAD_lock_new();
-    if (ret->lock == NULL) {
-        X509_INFO_free(ret);
-        return NULL;
-    }
-
     return ret;
 }
 
 void X509_INFO_free(X509_INFO *x)
 {
-    int i;
-
     if (x == NULL)
         return;
 
-    CRYPTO_atomic_add(&x->references, -1, &i, x->lock);
-    REF_PRINT_COUNT("X509_INFO", x);
-    if (i > 0)
-        return;
-    REF_ASSERT_ISNT(i < 0);
-
     X509_free(x->x509);
     X509_CRL_free(x->crl);
     X509_PKEY_free(x->x_pkey);
     OPENSSL_free(x->enc_data);
-    CRYPTO_THREAD_lock_free(x->lock);
     OPENSSL_free(x);
 }
diff --git a/crypto/asn1/x_pkey.c b/crypto/asn1/x_pkey.c
index d8960d1..1e80d9e 100644
--- a/crypto/asn1/x_pkey.c
+++ b/crypto/asn1/x_pkey.c
@@ -69,12 +69,6 @@ X509_PKEY *X509_PKEY_new(void)
     if (ret == NULL)
         goto err;
 
-    ret->references = 1;
-    ret->lock = CRYPTO_THREAD_lock_new();
-    if (ret->lock == NULL) {
-        OPENSSL_free(ret);
-        return NULL;
-    }
     ret->enc_algor = X509_ALGOR_new();
     ret->enc_pkey = ASN1_OCTET_STRING_new();
     if (ret->enc_algor == NULL || ret->enc_pkey == NULL)
@@ -89,22 +83,13 @@ err:
 
 void X509_PKEY_free(X509_PKEY *x)
 {
-    int i;
-
     if (x == NULL)
         return;
 
-    CRYPTO_atomic_add(&x->references, -1, &i, x->lock);
-    REF_PRINT_COUNT("X509_PKEY", x);
-    if (i > 0)
-        return;
-    REF_ASSERT_ISNT(i < 0);
-
     X509_ALGOR_free(x->enc_algor);
     ASN1_OCTET_STRING_free(x->enc_pkey);
     EVP_PKEY_free(x->dec_pkey);
     if (x->key_free)
         OPENSSL_free(x->key_data);
-    CRYPTO_THREAD_lock_free(x->lock);
     OPENSSL_free(x);
 }
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index af9ab82..0ad753c 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -292,8 +292,6 @@ typedef struct private_key_st {
     int key_free;               /* true if we should auto free key_data */
     /* expanded version of 'enc_algor' */
     EVP_CIPHER_INFO cipher;
-    int references;
-    CRYPTO_RWLOCK *lock;
 } X509_PKEY;
 
 typedef struct X509_info_st {
@@ -303,8 +301,6 @@ typedef struct X509_info_st {
     EVP_CIPHER_INFO enc_cipher;
     int enc_len;
     char *enc_data;
-    int references;
-    CRYPTO_RWLOCK *lock;
 } X509_INFO;
 
 DEFINE_STACK_OF(X509_INFO)


More information about the openssl-commits mailing list