Remove CRYPTO_ex_data_new_class.

It's unused and requires ex_data support a class number per type.

Change-Id: Ie1fb55053631ef00c3318f3253f7c9501988f522
Reviewed-on: https://boringssl-review.googlesource.com/4371
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index 6702152..8f54a90 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -139,10 +139,6 @@
     CRYPTO_STATIC_MUTEX_INIT;
 static LHASH_OF(EX_CLASS_ITEM) *global_classes = NULL;
 
-static struct CRYPTO_STATIC_MUTEX global_next_class_lock =
-    CRYPTO_STATIC_MUTEX_INIT;
-static int global_next_class = 100;
-
 /* class_hash is a hash function used by an LHASH of |EX_CLASS_ITEM|
  * structures. */
 static uint32_t class_hash(const EX_CLASS_ITEM *a) {
@@ -319,14 +315,6 @@
   return 1;
 }
 
-int CRYPTO_ex_data_new_class(void) {
-  CRYPTO_STATIC_MUTEX_lock_write(&global_next_class_lock);
-  const int ret = global_next_class++;
-  CRYPTO_STATIC_MUTEX_unlock(&global_next_class_lock);
-
-  return ret;
-}
-
 int CRYPTO_new_ex_data(int class_value, void *obj, CRYPTO_EX_DATA *ad) {
   STACK_OF(CRYPTO_EX_DATA_FUNCS) *func_pointers;
   size_t i;
diff --git a/include/openssl/ex_data.h b/include/openssl/ex_data.h
index 777eea8..abf96a3 100644
--- a/include/openssl/ex_data.h
+++ b/include/openssl/ex_data.h
@@ -171,8 +171,7 @@
  * each class of object should provide a wrapper function that sets
  * |class_value| correctly.
  *
- * The |class_value| argument should be one of |CRYPTO_EX_INDEX_*| or a
- * user-defined class value returned from |CRYPTO_ex_data_new_class|.
+ * The |class_value| argument should be one of |CRYPTO_EX_INDEX_*|.
  *
  * See the descriptions of the callback typedefs for details of when they are
  * called. Any of the callback arguments may be NULL. The |argl| and |argp|
@@ -210,8 +209,6 @@
 
 /* CRYPTO_EX_INDEX_* are the built-in classes of objects.
  *
- * User defined classes start at 100.
- *
  * TODO(fork): WARNING: these are called "INDEX", but they aren't! */
 enum {
   CRYPTO_EX_INDEX_BIO,
@@ -228,19 +225,6 @@
 };
 
 
-/* User-defined classes of objects.
- *
- * Core OpenSSL code has predefined class values given above (the
- * |CRYPTO_EX_INDEX_*| values). It's possible to get dynamic class values
- * assigned for user-defined objects. */
-
-/* CRYPTO_ex_data_new_class returns a fresh class value for a user-defined type
- * that wishes to use ex_data.
- *
- * TODO(fork): hopefully remove this. */
-OPENSSL_EXPORT int CRYPTO_ex_data_new_class(void);
-
-
 /* Embedding, allocating and freeing |CRYPTO_EX_DATA| structures for objects
  * that embed them. */