From aa320774ed162f9d0d8190672644a3f792521778 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Fri, 30 Sep 2016 17:02:01 +0200 Subject: [PATCH] [BTLS]: Remove some debugging methods. --- mcs/class/System/Mono.Btls/MonoBtlsKey.cs | 8 ------ mcs/class/System/Mono.Btls/MonoBtlsSsl.cs | 9 ------- mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs | 3 --- .../System/Mono.Btls/MonoBtlsX509StoreCtx.cs | 8 ------ .../System/Mono.Btls/X509ChainImplBtls.cs | 4 --- mono/btls/btls-key.c | 21 --------------- mono/btls/btls-key.h | 3 --- mono/btls/btls-ssl.c | 26 ------------------- mono/btls/btls-ssl.h | 3 --- mono/btls/btls-x509-store-ctx.c | 12 --------- mono/btls/btls-x509-store-ctx.h | 3 --- mono/metadata/icall-def.h | 11 +++----- 12 files changed, 4 insertions(+), 107 deletions(-) diff --git a/mcs/class/System/Mono.Btls/MonoBtlsKey.cs b/mcs/class/System/Mono.Btls/MonoBtlsKey.cs index d7c802df359..e3e3defe7ff 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsKey.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsKey.cs @@ -63,9 +63,6 @@ namespace Mono.Btls [MethodImpl (MethodImplOptions.InternalCall)] extern static int mono_btls_key_is_rsa (IntPtr handle); - [MethodImpl (MethodImplOptions.InternalCall)] - extern static int mono_btls_key_test (IntPtr handle); - new internal BoringKeyHandle Handle { get { return (BoringKeyHandle)base.Handle; } } @@ -89,11 +86,6 @@ namespace Mono.Btls return buffer; } - public void Test () - { - mono_btls_key_test (Handle.DangerousGetHandle ()); - } - public MonoBtlsKey Copy () { CheckThrow (); diff --git a/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs b/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs index a9b5d87e935..933239de69b 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsSsl.cs @@ -94,9 +94,6 @@ namespace Mono.Btls [MethodImpl (MethodImplOptions.InternalCall)] extern static int mono_btls_ssl_get_error (IntPtr handle, int ret_code); - [MethodImpl (MethodImplOptions.InternalCall)] - extern static void mono_btls_ssl_test (IntPtr handle); - [MethodImpl (MethodImplOptions.InternalCall)] extern static int mono_btls_ssl_get_version (IntPtr handle); @@ -394,12 +391,6 @@ namespace Mono.Btls CheckError (ret); } - public void Test () - { - CheckThrow (); - mono_btls_ssl_test (Handle.DangerousGetHandle ()); - } - protected override void Close () { mono_btls_ssl_close (Handle.DangerousGetHandle ()); diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs index 9b8a64f67b9..7b4ab7d8c9a 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsX509Crl.cs @@ -70,9 +70,6 @@ namespace Mono.Btls [MethodImpl (MethodImplOptions.InternalCall)] extern static IntPtr mono_btls_x509_crl_ref (IntPtr handle); - [MethodImpl (MethodImplOptions.InternalCall)] - extern static void mono_btls_x509_crl_test (IntPtr handle); - [MethodImpl (MethodImplOptions.InternalCall)] extern static IntPtr mono_btls_x509_crl_from_data (IntPtr data, int len, MonoBtlsX509Format format); diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs index affb9883a02..41df1298f9c 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreCtx.cs @@ -87,9 +87,6 @@ namespace Mono.Btls [MethodImpl (MethodImplOptions.InternalCall)] extern static int mono_btls_x509_store_ctx_set_param (IntPtr handle, IntPtr param); - [MethodImpl (MethodImplOptions.InternalCall)] - extern static void mono_btls_x509_store_ctx_test (IntPtr handle); - [MethodImpl (MethodImplOptions.InternalCall)] extern static int mono_btls_x509_store_ctx_verify_cert (IntPtr handle); @@ -172,11 +169,6 @@ namespace Mono.Btls return new MonoBtlsX509Chain (new MonoBtlsX509Chain.BoringX509ChainHandle (chain)); } - public void Test () - { - mono_btls_x509_store_ctx_test (Handle.DangerousGetHandle ()); - } - public void Initialize (MonoBtlsX509Store store, MonoBtlsX509Chain chain) { var ret = mono_btls_x509_store_ctx_init ( diff --git a/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs b/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs index 81fe569645b..79a985ce674 100644 --- a/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs +++ b/mcs/class/System/Mono.Btls/X509ChainImplBtls.cs @@ -55,9 +55,6 @@ namespace Mono.Btls this.chain = storeCtx.GetChain (); policy = new X509ChainPolicy (); - using (var test = (IDisposable)null) { - ; - } untrustedChain = storeCtx.GetUntrusted (); @@ -70,7 +67,6 @@ namespace Mono.Btls untrusted.Add (new X509Certificate2 (impl)); } } - storeCtx.Test (); } internal X509ChainImplBtls () diff --git a/mono/btls/btls-key.c b/mono/btls/btls-key.c index 708abe4cfbb..756f9c75649 100644 --- a/mono/btls/btls-key.c +++ b/mono/btls/btls-key.c @@ -60,24 +60,3 @@ mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int includ *size = (int)len; return 1; } - -int -mono_btls_key_test (EVP_PKEY *pkey) -{ - RSA *rsa; - unsigned char *p = NULL; - int ret; - - if (pkey->type != EVP_PKEY_RSA) - return 0; - - rsa = EVP_PKEY_get1_RSA (pkey); - if (!rsa) - return 0; - - ret = i2d_RSA_PUBKEY (rsa, &p); - - RSA_free (rsa); - return ret; - -} diff --git a/mono/btls/btls-key.h b/mono/btls/btls-key.h index a262d6a0906..85ee5b2f58a 100644 --- a/mono/btls/btls-key.h +++ b/mono/btls/btls-key.h @@ -25,9 +25,6 @@ mono_btls_key_get_bits (EVP_PKEY *pkey); int mono_btls_key_is_rsa (EVP_PKEY *pkey); -int -mono_btls_key_test (EVP_PKEY *pkey); - int mono_btls_key_get_bytes (EVP_PKEY *pkey, uint8_t **buffer, int *size, int include_private_bits); diff --git a/mono/btls/btls-ssl.c b/mono/btls/btls-ssl.c index ddb88d6710a..f3e3f491464 100644 --- a/mono/btls/btls-ssl.c +++ b/mono/btls/btls-ssl.c @@ -201,29 +201,3 @@ mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam { return SSL_set1_param (ptr->ssl, mono_btls_x509_verify_param_peek_param (param)); } - -void -mono_btls_ssl_test (MonoBtlsSsl *ptr) -{ - SSL_SESSION *session; - const char *version; - const SSL_CIPHER *cipher; - int test; - -// SSL_get_ciphers(<#const SSL *ssl#>) - - test = SSL_version (ptr->ssl); - debug_printf(ptr, "TEST: %d\n", test); - session = SSL_get_session(ptr->ssl); - if (session) { - version = SSL_SESSION_get_version(session); - debug_printf (ptr, "SESSION: %p - %s\n", session, version); - } - - cipher = SSL_get_current_cipher (ptr->ssl); - if (cipher) { - test = SSL_CIPHER_get_id (cipher); - version = SSL_CIPHER_get_name (cipher); - debug_printf (ptr, "CIPHER: %p - %x:%s\n", cipher, test, version); - } -} diff --git a/mono/btls/btls-ssl.h b/mono/btls/btls-ssl.h index 1557995b22d..7abaeea56f4 100644 --- a/mono/btls/btls-ssl.h +++ b/mono/btls/btls-ssl.h @@ -77,7 +77,4 @@ mono_btls_ssl_set_verify_param (MonoBtlsSsl *ptr, const MonoBtlsX509VerifyParam void mono_btls_ssl_destroy (MonoBtlsSsl *ptr); -void -mono_btls_ssl_test (MonoBtlsSsl *ptr); - #endif /* defined(__btls__btls_ssl__) */ diff --git a/mono/btls/btls-x509-store-ctx.c b/mono/btls/btls-x509-store-ctx.c index 8ed77d01ba3..f023e31a848 100644 --- a/mono/btls/btls-x509-store-ctx.c +++ b/mono/btls/btls-x509-store-ctx.c @@ -124,18 +124,6 @@ mono_btls_x509_store_ctx_get_untrusted (MonoBtlsX509StoreCtx *ctx) return mono_btls_x509_chain_from_certs (untrusted); } -void -mono_btls_x509_store_ctx_test (MonoBtlsX509StoreCtx *ctx) -{ - X509_VERIFY_PARAM *param; - char *peer; - - fprintf (stderr, "TEST: %p!\n", ctx); - param = X509_STORE_CTX_get0_param (ctx->ctx); - peer = X509_VERIFY_PARAM_get0_peername(param); - fprintf (stderr, "TEST #1: %s\n", peer); -} - int mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509Store *store, MonoBtlsX509Chain *chain) diff --git a/mono/btls/btls-x509-store-ctx.h b/mono/btls/btls-x509-store-ctx.h index c5ed499612a..188092e0cd7 100644 --- a/mono/btls/btls-x509-store-ctx.h +++ b/mono/btls/btls-x509-store-ctx.h @@ -43,9 +43,6 @@ mono_btls_x509_store_ctx_get_current_cert (MonoBtlsX509StoreCtx *ctx); X509 * mono_btls_x509_store_ctx_get_current_issuer (MonoBtlsX509StoreCtx *ctx); -void -mono_btls_x509_store_ctx_test (MonoBtlsX509StoreCtx *ctx); - int mono_btls_x509_store_ctx_init (MonoBtlsX509StoreCtx *ctx, MonoBtlsX509Store *store, MonoBtlsX509Chain *chain); diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h index f86eac1c6b7..c5a9528eb6c 100644 --- a/mono/metadata/icall-def.h +++ b/mono/metadata/icall-def.h @@ -107,8 +107,7 @@ ICALL(BTLS_KEY_1, "mono_btls_key_free", mono_btls_key_free) ICALL(BTLS_KEY_2, "mono_btls_key_get_bits", mono_btls_key_get_bits) ICALL(BTLS_KEY_3, "mono_btls_key_get_bytes", mono_btls_key_get_bytes) ICALL(BTLS_KEY_4, "mono_btls_key_is_rsa", mono_btls_key_is_rsa) -ICALL(BTLS_KEY_5, "mono_btls_key_test", mono_btls_key_test) -ICALL(BTLS_KEY_6, "mono_btls_key_up_ref", mono_btls_key_up_ref) +ICALL(BTLS_KEY_5, "mono_btls_key_up_ref", mono_btls_key_up_ref) ICALL_TYPE(BTLS_OBJECT, "Mono.Btls.MonoBtlsObject", BTLS_OBJECT_1) ICALL(BTLS_OBJECT_1, "mono_btls_free", mono_btls_free) @@ -148,10 +147,9 @@ ICALL(BTLS_SSL_16, "mono_btls_ssl_set_cipher_list", mono_btls_ssl_set_cipher_lis ICALL(BTLS_SSL_17, "mono_btls_ssl_set_max_version", mono_btls_ssl_set_max_version) ICALL(BTLS_SSL_18, "mono_btls_ssl_set_min_version", mono_btls_ssl_set_min_version) ICALL(BTLS_SSL_19, "mono_btls_ssl_set_verify_param", mono_btls_ssl_set_verify_param) -ICALL(BTLS_SSL_20, "mono_btls_ssl_test", mono_btls_ssl_test) -ICALL(BTLS_SSL_21, "mono_btls_ssl_use_certificate", mono_btls_ssl_use_certificate) -ICALL(BTLS_SSL_22, "mono_btls_ssl_use_private_key", mono_btls_ssl_use_private_key) -ICALL(BTLS_SSL_23, "mono_btls_ssl_write", mono_btls_ssl_write) +ICALL(BTLS_SSL_20, "mono_btls_ssl_use_certificate", mono_btls_ssl_use_certificate) +ICALL(BTLS_SSL_21, "mono_btls_ssl_use_private_key", mono_btls_ssl_use_private_key) +ICALL(BTLS_SSL_22, "mono_btls_ssl_write", mono_btls_ssl_write) ICALL_TYPE(BTLS_SSL_CTX, "Mono.Btls.MonoBtlsSslCtx", BTLS_SSL_CTX_1) ICALL(BTLS_SSL_CTX_1, "mono_btls_ssl_ctx_debug_printf", mono_btls_ssl_ctx_debug_printf) @@ -291,7 +289,6 @@ ICALL(BTLS_X509_STORE_CTX_10, "mono_btls_x509_store_ctx_get_verify_param", mono_ ICALL(BTLS_X509_STORE_CTX_11, "mono_btls_x509_store_ctx_init", mono_btls_x509_store_ctx_init) ICALL(BTLS_X509_STORE_CTX_12, "mono_btls_x509_store_ctx_new", mono_btls_x509_store_ctx_new) ICALL(BTLS_X509_STORE_CTX_13, "mono_btls_x509_store_ctx_set_param", mono_btls_x509_store_ctx_set_param) -ICALL(BTLS_X509_STORE_CTX_14, "mono_btls_x509_store_ctx_test", mono_btls_x509_store_ctx_test) ICALL(BTLS_X509_STORE_CTX_15, "mono_btls_x509_store_ctx_up_ref", mono_btls_x509_store_ctx_up_ref) ICALL(BTLS_X509_STORE_CTX_16, "mono_btls_x509_store_ctx_verify_cert", mono_btls_x509_store_ctx_verify_cert) -- 2.25.1