Post

Replies

Boosts

Views

Activity

keychain query does not match against certificate's Subject Alternative Name ( 2.5.29.17 )
we have valid, not expired, trusted wildcard certificate in keychain with both Subject Alternative Names ( 2.5.29.17 ): DNS Name *.example.com DNS Name example.com our query does not match against example.com, it matches only against *.example.com. let exactHostname = "example.com" let keychainQuery = [ kSecClass : kSecClassCertificate, //kSecAttrLabel: exactHostname,//keychain label name, should not be used to query hostname //kSecAttrSubject: exactHostname, //also does not work kSecMatchSubjectWholeString: exactHostname, kSecMatchValidOnDate: kCFNull!,//date, kCFNull - current date kSecReturnRef: true] as NSDictionary var item : CFTypeRef? var identity: SecIdentity? let status = SecItemCopyMatching(keychainQuery as CFDictionary, &item) XCTAssert(status == errSecSuccess, "Failed to get certificate: \(status)") how to query against Subject Alternative Name DNS name ?
2
0
606
Jun ’23
presenting appropriate certificate according to client's SNI using NWListener
We're developing HTTP server which server multiple hostnames, thus we need to presenting certificates according to requested names. It all should be handled on same listening port(443). What are options to analyze client's TLS requested ServerName Identifier(SNI) and present certificate accordingly ? So far we were successful when using single certificate but all this is done when before starting listener. let parameters = NWParameters(tls: tlsOptions, tcp: tcpOptions ) if let secIdentity = getSecIdentity(), let identity = sec_identity_create(secIdentity) { sec_protocol_options_set_min_tls_protocol_version(tlsOptions.securityProtocolOptions, .TLSv13) sec_protocol_options_set_local_identity(tlsOptions.securityProtocolOptions, identity) sec_protocol_options_append_tls_ciphersuite( tlsOptions.securityProtocolOptions, tls_ciphersuite_t(rawValue: UInt16(TLS_AES_128_GCM_SHA256))! ) } } let listener = try NWListener(using: parameters, on: 443)
3
0
838
Mar ’22
Type 'ToggleStyle' has no member 'switch'
My big project started throwing errors: Type 'ToggleStyle' has no member 'switch' Made new test project: struct ContentView: View { @State var isOn = false     var body: some View {         Text("Hello, world!")             .padding() Toggle(isOn: $isOn) { Text("IPv6") } .toggleStyle(.switch)     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } } Throws the same error: Type 'ToggleStyle' has no member 'switch' what's wrong with this code ?
3
0
628
Oct ’21
Network token with CryptoTokenKit
As documentation states"Tokens are physical devices that can be built in to the system, located on attached hardware (like a smart card), or accessible through a network connection"We'd like to make token that would acquire TKTokenKeychainContents(certificates) through network(without smart card reader).What's would be the best approach for this ?What should we set for com.apple.ctk.token-type in Info.plist ?The only possible value i found is "smartcard".I have not found any documentation regarding other options.The only extension target that Xcode gives is "Smart Card Token Extension"
16
0
6.9k
Jul ’18