Notify the framework when TLS certificate
verification fails.
Notification can be sent using the existing
OpenSSL failure callback. See ag/17108489
for more information about the existing
callbacks.
Bug: 296398808
Test: Manual Test
1. Follow the Test Setup Instructions
doc to connect to WPA-Enterprise
using EAP-TTLS.
2. Set all fields correctly, but select
"Use system certificates" for the
CA Certificate field.
3. Check that the expected OpenSSL
failure event is generated.
Change-Id: I6c67240887ad5198c021689fe68f6ad1cd3d114d
diff --git a/src/crypto/tls.h b/src/crypto/tls.h
index c201dcd..82276c5 100644
--- a/src/crypto/tls.h
+++ b/src/crypto/tls.h
@@ -693,4 +693,14 @@
void tls_register_cert_callback(tls_get_certificate_cb cb);
+/**
+ * tls_register_openssl_failure_callback - Register a callback to indicate
+ * that an OpenSSL failure has occurred
+ * @cb: Callback object to register
+ */
+typedef void (*tls_openssl_failure_cb)
+(void* ctx, const char* msg);
+
+void tls_register_openssl_failure_callback(tls_openssl_failure_cb cb);
+
#endif /* TLS_H */