37 Commits
Author SHA1 Message Date
Fabian MückeandTanner Bennett 69538b08f0 Fix a rare crash in TSKSPKIHashCache (#348)
* Use serial lock queue

* isProtectedDataAvailable() should block

* Fix a crash in TSKSPKIHashCache caused by concurrent read write operations

* Refactor hashSubjectPublicKeyInfoFromCertificate:

---------

Co-authored-by: Tanner Bennett <tb@datatheorem.io>
2026-03-24 13:58:11 -05:00
Ethan Arbuckle eb973a7388 Improve SPKI cache thread safety and handle protected data availability 2024-10-21 12:49:08 -07:00
Stephen Perona 84508a8813 Adds support for RSA with 3072 bit length.
Updates expired cloudflare CA PK hash to resolve test failure.
2024-03-07 12:07:32 -08:00
Mohammad Porooshani 5807890220 Fixed Tests and pod support
Signed-off-by: Mohammad Porooshani <porooshani@gmail.com>
2020-01-21 09:48:17 +03:30
Alban Diquet bbc8ffab2c Fix remaining tests 2019-11-05 15:42:01 -08:00
Alban Diquet 71878dce8c Remove TSKPublicKeyAlgorithms and switch to SecKeyCopyAttributes 2018-07-09 12:46:27 -07:00
Alban Diquet 5442d9483c Rename TSKPinValidationResult to TSKTrustEvaluationResult to clarify purpose 2017-06-21 19:09:33 -07:00
Alban Diquet 52c28bdcc7 Make internal or test methods private 2017-06-21 12:01:26 -07:00
Adam Kaplan 7fd91ce180 PR comments from #109.
A bunch of minor code cleanup and de-duplication.
2017-06-05 18:32:00 -04:00
Adam Kaplan c972b130ac Hash cache now requires a unique label for the cache files. Prevents
multiple instances from stepping on each other.
2017-04-07 13:29:22 -04:00
Adam Kaplan d73d2e19c7 Lots of small changes to fix annoying warnings/errors
- Fixed the random but frequent error about "Redefinition of module
  TrustKit" because the tests were also configured to create the app's
  module map. Whoops!
In the process of finding that, changed lots of other things:
- Removed the TrustKit+Private.h header. There is no more private header
  for test support. Test support is entirely within the test target.
- Moved the #defines out of the precompiled header and into TSKCommon.h.
  This didn't end up helping any issue but i think its cleaner anyway.
- Added const to all statics
- Removed the shared background session and greatly simplified the
  background session creation.
2017-04-06 12:58:27 -04:00
Adam Kaplan 7d29aa7a72 Improved test expressiveness by switching out the last remaining tests
that used comparison methods with regular XCTAssert, for the more
suitable XCT test method
2017-04-06 10:28:00 -04:00
Adam Kaplan 86d78fe5e6 All tests pass
(still did not re-add swizzling tests)
2017-03-28 00:05:48 -07:00
Adam Kaplan c8fd2e0aff Fixed tests and more small changes:
- Streamlined logging and removed loggerBlock. We should switch to
  os_log if available (iOS 10) and perhaps reconsider providing
  a backwards compatible solution unless it's really compelling.
- Re-indented TrustKit.h
- Switched TrustKit to use GCD block callbacks for validation result
  instead of notifications. It's a lot more performant to not dispatch
  main thread notifications for every network requests unless they are
  actually needed. It's also cleaner to not support loose coupling – app
  can do whatever they want in the callback, including to send NSNotification.
2017-03-20 11:32:27 -04:00
Alban Diquet d3216a1639 Merge and simplify test for sec384r1 2017-01-13 10:01:29 -08:00
Alban Diquet 618d828ad3 Merge branch 'master' of github.com:datatheorem/TrustKit
# Conflicts:
#	TrustKit.xcodeproj/project.pbxproj
2017-01-13 09:56:01 -08:00
Adam Kaplan 03d74b26fb Add support and tests for secp384r1 pin validation 2017-01-13 12:12:31 -05:00
Alban Diquet 16f5274a3d Simplify public key algorithm tests and move test certificates to their own folders 2017-01-12 22:30:04 -08:00
Alban Diquet 6e7caa45f7 Disable Header Map to make the build more consistent 2017-01-12 17:43:10 -08:00
Alban Diquet ebd3c98cda Fix tests failing because of SSL keys being rotated 2017-01-11 19:35:29 -08:00
Alban Diquet 746d585926 Use a separate Spki cache for each supported key algorithm; fixes #50 2016-06-21 13:53:08 -07:00
Alban Diquet 6b5b3f4a14 Stricter testing of the SPKI cache 2016-06-21 12:52:10 -07:00
Alban Diquet dbd09b01d8 Add failing test for multiple key algorithm support issue described in #50 2016-06-21 12:46:35 -07:00
Alban Diquet 3dac606cca Make kTSKSwizzleNetworkDelegates a required setting and clarify documentation 2016-06-02 18:05:13 -07:00
Alban Diquet 79ec2c7814 Be stricter about the 2 pin minimum requirement 2016-06-01 22:08:54 -07:00
Alban Diquet 41a971417a Modify reporting mechanism to leverage notifications 2016-05-22 11:05:30 -07:00
Alban Diquet 12f58fe5b9 Fix ECDSA test by updating test certificate 2016-02-08 16:01:30 -08:00
Alban Diquet 00bd117d7e Update test certificates 2015-11-27 15:43:19 -08:00
Alban Diquet 13190edd30 Fix remaining failing test 2015-10-12 15:22:15 -07:00
Alban Diquet 844d4752c1 Add extra NSURLConnection tests 2015-10-12 14:36:45 -07:00
Alban Diquet 3361e83d2f Fix failing ECDSA test due to new certificates 2015-10-12 13:17:38 -07:00
Alban Diquet 88569f7aa4 Put all the domains' pinning policies under a TSKPinnedDomains key and add new global TSKSwizzleNetworkDelegates key 2015-10-07 16:44:27 -07:00
Alban Diquet 7a8b422216 Enforce 2-pin minimum configuration; fixes issue #13 2015-07-03 18:55:42 -07:00
Angela Chow 490dd20342 changing source header to be uniform, also add reference to LICENSE and AUTHORS files 2015-06-01 18:57:21 -07:00
Alban Diquet dca9f3221b Missing CFRelease() calls in tests 2015-06-01 00:11:26 +02:00
Alban Diquet 255a02cd3b Always force hostname validation in case the supplied trust has hostname validation disabled 2015-05-31 18:40:59 +02:00
Alban Diquet 1f8c840719 Fix support for ECDSA secp256r1 and add test case 2015-05-31 18:25:02 +02:00