apple / swift-nio-ssl

TLS Support for SwiftNIO, based on BoringSSL.
https://swiftpackageindex.com/apple/swift-nio-ssl/main/documentation/niossl
Apache License 2.0
392 stars 142 forks source link

Add TLS-PSK Support #360

Closed agnosticdev closed 2 years ago

agnosticdev commented 2 years ago

Add TLS-PSK Support

Motivation:

Add TLS-PSK Support to address #230.

Modifications:

This is a large PR so I can understand if it needs to be broken up. This PR includes the addition of SecureBytes from SwiftCrypto, to which I had to alter to make work. To add SecureBytes I also had to rearrange the Package.swift file based on what I seen from the SwiftCrypto project. Please let me know if this is correct. I altered the access level on SecureBytes to be used in the return value for the callback. Please let me know your thoughts on this.

Result:

TLS-PSK support for TLS 1.2. TLS 1.3 is not addressed due to API support in BoringSSL.

agnosticdev commented 2 years ago

It looks like I broke the soundness check. Do I just need to add the testThrowingInitialization back to the SecureBytesTests?

+                ("testThrowingInitialization", testThrowingInitialization),
agnosticdev commented 2 years ago

Thank you for the feedback @Lukasa. I will start on the migration of SecureBytes to NIOSSLSecureBytes and will close this PR once that is ready for review.

agnosticdev commented 2 years ago

Closing to submit a new PR for NIOSSLSecureBytes as a first step here.