| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_MACOS) |
| 7 |
| 8 #include "bin/secure_socket.h" |
| 9 #include "bin/secure_socket_macos.h" |
| 10 |
| 11 #include <CoreFoundation/CoreFoundation.h> |
| 12 #include <Security/SecureTransport.h> |
| 13 #include <Security/Security.h> |
| 14 |
| 5 #include "bin/builtin.h" | 15 #include "bin/builtin.h" |
| 6 #include "bin/dartutils.h" | 16 #include "bin/dartutils.h" |
| 7 | |
| 8 #include "include/dart_api.h" | 17 #include "include/dart_api.h" |
| 9 | 18 |
| 10 | |
| 11 namespace dart { | 19 namespace dart { |
| 12 namespace bin { | 20 namespace bin { |
| 13 | 21 |
| 14 void FUNCTION_NAME(SecureSocket_Init)(Dart_NativeArguments args) { | 22 void FUNCTION_NAME(SecureSocket_Init)(Dart_NativeArguments args) { |
| 15 Dart_ThrowException(DartUtils::NewDartArgumentError( | 23 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 16 "Secure Sockets unsupported on this platform")); | 24 "Secure Sockets unsupported on this platform")); |
| 17 } | 25 } |
| 18 | 26 |
| 19 | 27 |
| 20 void FUNCTION_NAME(SecureSocket_Connect)(Dart_NativeArguments args) { | 28 void FUNCTION_NAME(SecureSocket_Connect)(Dart_NativeArguments args) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Dart_ThrowException(DartUtils::NewDartArgumentError( | 100 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 93 "Secure Sockets unsupported on this platform")); | 101 "Secure Sockets unsupported on this platform")); |
| 94 } | 102 } |
| 95 | 103 |
| 96 | 104 |
| 97 void FUNCTION_NAME(SecureSocket_NewServicePort)(Dart_NativeArguments args) { | 105 void FUNCTION_NAME(SecureSocket_NewServicePort)(Dart_NativeArguments args) { |
| 98 Dart_ThrowException(DartUtils::NewDartArgumentError( | 106 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 99 "Secure Sockets unsupported on this platform")); | 107 "Secure Sockets unsupported on this platform")); |
| 100 } | 108 } |
| 101 | 109 |
| 110 |
| 102 void FUNCTION_NAME(SecurityContext_Allocate)(Dart_NativeArguments args) { | 111 void FUNCTION_NAME(SecurityContext_Allocate)(Dart_NativeArguments args) { |
| 103 Dart_ThrowException(DartUtils::NewDartArgumentError( | 112 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 104 "Secure Sockets unsupported on this platform")); | 113 "Secure Sockets unsupported on this platform")); |
| 105 } | 114 } |
| 106 | 115 |
| 116 |
| 107 void FUNCTION_NAME(SecurityContext_UsePrivateKeyBytes)( | 117 void FUNCTION_NAME(SecurityContext_UsePrivateKeyBytes)( |
| 108 Dart_NativeArguments args) { | 118 Dart_NativeArguments args) { |
| 109 Dart_ThrowException(DartUtils::NewDartArgumentError( | 119 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 110 "Secure Sockets unsupported on this platform")); | 120 "Secure Sockets unsupported on this platform")); |
| 111 } | 121 } |
| 112 | 122 |
| 123 |
| 113 void FUNCTION_NAME(SecurityContext_SetAlpnProtocols)( | 124 void FUNCTION_NAME(SecurityContext_SetAlpnProtocols)( |
| 114 Dart_NativeArguments args) { | 125 Dart_NativeArguments args) { |
| 115 Dart_ThrowException(DartUtils::NewDartArgumentError( | 126 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 116 "Secure Sockets unsupported on this platform")); | 127 "Secure Sockets unsupported on this platform")); |
| 117 } | 128 } |
| 118 | 129 |
| 130 |
| 119 void FUNCTION_NAME(SecurityContext_SetClientAuthoritiesBytes)( | 131 void FUNCTION_NAME(SecurityContext_SetClientAuthoritiesBytes)( |
| 120 Dart_NativeArguments args) { | 132 Dart_NativeArguments args) { |
| 121 Dart_ThrowException(DartUtils::NewDartArgumentError( | 133 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 122 "Secure Sockets unsupported on this platform")); | 134 "Secure Sockets unsupported on this platform")); |
| 123 } | 135 } |
| 124 | 136 |
| 137 |
| 125 void FUNCTION_NAME(SecurityContext_SetTrustedCertificatesBytes)( | 138 void FUNCTION_NAME(SecurityContext_SetTrustedCertificatesBytes)( |
| 126 Dart_NativeArguments args) { | 139 Dart_NativeArguments args) { |
| 127 Dart_ThrowException(DartUtils::NewDartArgumentError( | 140 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 128 "Secure Sockets unsupported on this platform")); | 141 "Secure Sockets unsupported on this platform")); |
| 129 } | 142 } |
| 130 | 143 |
| 144 |
| 145 void FUNCTION_NAME(SecurityContext_AlpnSupported)(Dart_NativeArguments args) { |
| 146 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 147 "Secure Sockets unsupported on this platform")); |
| 148 } |
| 149 |
| 150 |
| 131 void FUNCTION_NAME(SecurityContext_TrustBuiltinRoots)( | 151 void FUNCTION_NAME(SecurityContext_TrustBuiltinRoots)( |
| 132 Dart_NativeArguments args) { | 152 Dart_NativeArguments args) { |
| 133 Dart_ThrowException(DartUtils::NewDartArgumentError( | 153 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 134 "Secure Sockets unsupported on this platform")); | 154 "Secure Sockets unsupported on this platform")); |
| 135 } | 155 } |
| 136 | 156 |
| 157 |
| 137 void FUNCTION_NAME(SecurityContext_UseCertificateChainBytes)( | 158 void FUNCTION_NAME(SecurityContext_UseCertificateChainBytes)( |
| 138 Dart_NativeArguments args) { | 159 Dart_NativeArguments args) { |
| 139 Dart_ThrowException(DartUtils::NewDartArgumentError( | 160 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 140 "Secure Sockets unsupported on this platform")); | 161 "Secure Sockets unsupported on this platform")); |
| 141 } | 162 } |
| 142 | 163 |
| 164 |
| 143 void FUNCTION_NAME(X509_Subject)(Dart_NativeArguments args) { | 165 void FUNCTION_NAME(X509_Subject)(Dart_NativeArguments args) { |
| 144 Dart_ThrowException(DartUtils::NewDartArgumentError( | 166 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 145 "Secure Sockets unsupported on this platform")); | 167 "Secure Sockets unsupported on this platform")); |
| 146 } | 168 } |
| 147 | 169 |
| 170 |
| 148 void FUNCTION_NAME(X509_Issuer)(Dart_NativeArguments args) { | 171 void FUNCTION_NAME(X509_Issuer)(Dart_NativeArguments args) { |
| 149 Dart_ThrowException(DartUtils::NewDartArgumentError( | 172 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 150 "Secure Sockets unsupported on this platform")); | 173 "Secure Sockets unsupported on this platform")); |
| 151 } | 174 } |
| 152 | 175 |
| 176 |
| 153 void FUNCTION_NAME(X509_StartValidity)(Dart_NativeArguments args) { | 177 void FUNCTION_NAME(X509_StartValidity)(Dart_NativeArguments args) { |
| 154 Dart_ThrowException(DartUtils::NewDartArgumentError( | 178 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 155 "Secure Sockets unsupported on this platform")); | 179 "Secure Sockets unsupported on this platform")); |
| 156 } | 180 } |
| 157 | 181 |
| 182 |
| 158 void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) { | 183 void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) { |
| 159 Dart_ThrowException(DartUtils::NewDartArgumentError( | 184 Dart_ThrowException(DartUtils::NewDartArgumentError( |
| 160 "Secure Sockets unsupported on this platform")); | 185 "Secure Sockets unsupported on this platform")); |
| 161 } | 186 } |
| 162 | 187 |
| 163 class SSLFilter { | |
| 164 public: | |
| 165 static CObject* ProcessFilterRequest(const CObjectArray& request); | |
| 166 }; | |
| 167 | 188 |
| 168 CObject* SSLFilter::ProcessFilterRequest(const CObjectArray& request) { | 189 CObject* SSLFilter::ProcessFilterRequest(const CObjectArray& request) { |
| 169 return CObject::IllegalArgumentError(); | 190 return CObject::IllegalArgumentError(); |
| 170 } | 191 } |
| 171 | 192 |
| 172 } // namespace bin | 193 } // namespace bin |
| 173 } // namespace dart | 194 } // namespace dart |
| 195 |
| 196 #endif // defined(TARGET_OS_MACOS) |
| OLD | NEW |