]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Switch keystore to binder
authorKenny Root <kroot@google.com>
Tue, 13 Nov 2012 00:33:36 +0000 (16:33 -0800)
committerJouni Malinen <j@w1.fi>
Fri, 1 Nov 2013 14:35:03 +0000 (16:35 +0200)
Change-Id: Idfcff5f2799863075160cc6c2565f2fe774c2552

src/crypto/tls_openssl.c
wpa_supplicant/Android.mk

index a89e4d1a49f9aa84c58c1fd4be06c834061aefb6..f8ba34e64705ebc410598b33ed03a66028eba26d 100644 (file)
 #include <openssl/engine.h>
 #endif /* OPENSSL_NO_ENGINE */
 
-#ifdef ANDROID
-#include <openssl/pem.h>
-#include "keystore_get.h"
-#endif /* ANDROID */
-
 #include "common.h"
 #include "crypto.h"
 #include "tls.h"
 #endif
 #endif
 
+#ifdef ANDROID
+#include <openssl/pem.h>
+#include <keystore/keystore_get.h>
+
+static BIO * BIO_from_keystore(const char *key)
+{
+    BIO *bio = NULL;
+    uint8_t *value = NULL;
+    int length = keystore_get(key, strlen(key), &value);
+    if (length != -1 && (bio = BIO_new(BIO_s_mem())) != NULL) {
+        BIO_write(bio, value, length);
+    }
+    free(value);
+    return bio;
+}
+#endif /* ANDROID */
+
 #ifdef SSL_set_tlsext_status_type
 #ifndef OPENSSL_NO_TLSEXT
 #define HAVE_OCSP
@@ -1389,19 +1401,6 @@ static int tls_load_ca_der(void *_ssl_ctx, const char *ca_cert)
 #endif /* OPENSSL_NO_STDIO */
 
 
-#ifdef ANDROID
-static BIO * BIO_from_keystore(const char *key)
-{
-       BIO *bio = NULL;
-       char value[KEYSTORE_MESSAGE_SIZE];
-       int length = keystore_get(key, strlen(key), value);
-       if (length != -1 && (bio = BIO_new(BIO_s_mem())) != NULL)
-               BIO_write(bio, value, length);
-       return bio;
-}
-#endif /* ANDROID */
-
-
 static int tls_connection_ca_cert(void *_ssl_ctx, struct tls_connection *conn,
                                  const char *ca_cert, const u8 *ca_cert_blob,
                                  size_t ca_cert_blob_len, const char *ca_path)
index 5a6d6b36d3912577ba18c6bc113d72bce0cfcfb8..6947fa8f1df2991c7d11f502d7a67ccd10ab15e5 100644 (file)
@@ -1534,7 +1534,7 @@ include $(LOCAL_PATH)/eap_proxy_$(CONFIG_EAP_PROXY).mk
 endif
 
 ifeq ($(CONFIG_TLS), openssl)
-LOCAL_SHARED_LIBRARIES += libcrypto libssl
+LOCAL_SHARED_LIBRARIES += libcrypto libssl libkeystore_binder
 endif
 ifdef CONFIG_DRIVER_NL80211
 LOCAL_STATIC_LIBRARIES += libnl_2