]> git.sesse.net Git - ffmpeg/commitdiff
lavf/tls_securetransport: build on iOS
authorAman Gupta <aman@tmm1.net>
Wed, 25 Oct 2017 18:03:14 +0000 (11:03 -0700)
committerAman Gupta <aman@tmm1.net>
Sun, 12 Nov 2017 22:37:12 +0000 (14:37 -0800)
This works as expected on iOS, except for the ca_file feature which
is disabled because SecItemImport is not available.

Signed-off-by: Aman Gupta <aman@tmm1.net>
configure
libavformat/tls_securetransport.c

index 2f026c45bc49954d15c7cde72a22c9db806144e3..c6fb3449292e1ae307a0c5b1176a9c532dc91bbd 100755 (executable)
--- a/configure
+++ b/configure
@@ -2035,6 +2035,7 @@ SYSTEM_FUNCS="
     posix_memalign
     pthread_cancel
     sched_getaffinity
+    SecItemImport
     SetConsoleTextAttribute
     SetConsoleCtrlHandler
     setmode
@@ -6032,9 +6033,12 @@ fi
 
 enabled securetransport &&
     check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
-    check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext SecItemImport" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
+    check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
         disable securetransport
 
+enabled securetransport &&
+    check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
+
 enabled schannel &&
     check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
     check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
index 9958931b0cc564f0bbb604caa930bc079095cb68..b862e0003a0d4f7f8c24c9fb0443d77ad3eec73b 100644 (file)
@@ -69,6 +69,9 @@ static int print_tls_error(URLContext *h, int ret)
 
 static int import_pem(URLContext *h, char *path, CFArrayRef *array)
 {
+#if !HAVE_SECITEMIMPORT
+    return AVERROR_PATCHWELCOME;
+#else
     AVIOContext *s = NULL;
     CFDataRef data = NULL;
     int64_t ret = 0;
@@ -124,6 +127,7 @@ end:
     if (s)
         avio_close(s);
     return ret;
+#endif
 }
 
 static int load_ca(URLContext *h)