Patchwork Remove obsolete keystore path

login
register
mail settings
Submitter Kenny Root
Date June 26, 2013, 9:57 p.m.
Message ID <20131106004232.A452013FAD3@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/288693/
State Superseded
Headers show

Comments

Kenny Root - June 26, 2013, 9:57 p.m.
It's not possible to get a raw private key from keystore anymore, so
this would fail every time anyway. Remove it so it doesn't confuse
anyone that looks at this code.

Change-Id: I021fc1707b16474d8698c85055a6fcc4095cd215
---
 src/crypto/tls_openssl.c | 20 --------------------
 1 file changed, 20 deletions(-)
Johannes Berg - Nov. 6, 2013, 7:57 a.m.
On Wed, 2013-06-26 at 14:57 -0700, Kenny Root wrote:
> It's not possible to get a raw private key from keystore anymore, so
> this would fail every time anyway. Remove it so it doesn't confuse
> anyone that looks at this code.
> 
> Change-Id: I021fc1707b16474d8698c85055a6fcc4095cd215

You want a signed-hostap (see the readme etc.) and no change-id :)

What version of android changed this? Some people are still working
against older ones.

johannes

Patch

diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index 2bf47c7..e226f1a 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -2035,26 +2035,6 @@  static int tls_connection_private_key(void *_ssl_ctx,
 		break;
 	}
 
-#ifdef ANDROID
-	if (!ok && private_key &&
-	    os_strncmp("keystore://", private_key, 11) == 0) {
-		BIO *bio = BIO_from_keystore(&private_key[11]);
-		EVP_PKEY *pkey = NULL;
-		if (bio) {
-			pkey = PEM_read_bio_PrivateKey(bio, NULL, NULL, NULL);
-			BIO_free(bio);
-		}
-		if (pkey) {
-			if (SSL_use_PrivateKey(conn->ssl, pkey) == 1) {
-				wpa_printf(MSG_DEBUG, "OpenSSL: Private key "
-					   "from keystore");
-				ok = 1;
-			}
-			EVP_PKEY_free(pkey);
-		}
-	}
-#endif /* ANDROID */
-
 	while (!ok && private_key) {
 #ifndef OPENSSL_NO_STDIO
 		if (SSL_use_PrivateKey_file(conn->ssl, private_key,