Skip to content

Commit

Permalink
Replace NIOSendable with Sendable (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadoba authored Oct 12, 2022
1 parent c9e8889 commit 9fcdd00
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions Sources/NIOSSL/SSLCallbacks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Glibc
#endif

/// The result of an attempt to verify an X.509 certificate.
public enum NIOSSLVerificationResult: NIOSendable {
public enum NIOSSLVerificationResult: Sendable {
/// The certificate was successfully verified.
case certificateVerified

Expand Down Expand Up @@ -159,7 +159,7 @@ extension KeyLogCallbackManager {
}

/// PSK Server Identity response type used in the callback.
public struct PSKServerIdentityResponse: NIOSendable {
public struct PSKServerIdentityResponse: Sendable {
/// The negotiated PSK.
public var key: NIOSSLSecureBytes

Expand All @@ -171,7 +171,7 @@ public struct PSKServerIdentityResponse: NIOSendable {
}
}
/// PSK Client Identity response type used in the callback.
public struct PSKClientIdentityResponse: NIOSendable {
public struct PSKClientIdentityResponse: Sendable {
/// The negotiated PSK.
public var key: NIOSSLSecureBytes

Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOSSL/SSLErrors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import NIOCore

/// Wraps a single error from BoringSSL.
public struct BoringSSLInternalError: Equatable, CustomStringConvertible, NIOSendable {
public struct BoringSSLInternalError: Equatable, CustomStringConvertible, Sendable {
private enum Backing: Hashable {
case boringSSLErrorInfo(UInt32, String, UInt)
case synthetic(String)
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOSSL/SubjectAlternativeName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ extension _SubjectAlternativeNames: RandomAccessCollection {

public struct _SubjectAlternativeName {

public struct NameType: Hashable, NIOSendable {
public struct NameType: Hashable, Sendable {
public var rawValue: Int

public init(_ rawCode: Int) {
Expand Down
18 changes: 9 additions & 9 deletions Sources/NIOSSL/TLSConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
import NIOCore

/// Known and supported TLS versions.
public enum TLSVersion: NIOSendable {
public enum TLSVersion: Sendable {
case tlsv1
case tlsv11
case tlsv12
case tlsv13
}

/// Places NIOSSL can obtain certificates from.
public enum NIOSSLCertificateSource: Hashable, NIOSendable {
public enum NIOSSLCertificateSource: Hashable, Sendable {
@available(*, deprecated, message: "Use 'NIOSSLCertificate.fromPEMFile(_:)' to load the certificate(s) and use the '.certificate(NIOSSLCertificate)' case to provide them as a source")
case file(String)
case certificate(NIOSSLCertificate)
Expand All @@ -41,7 +41,7 @@ extension NIOSSLPrivateKeySource: Sendable {}
#endif

/// Places NIOSSL can obtain a trust store from.
public enum NIOSSLTrustRoots: Hashable, NIOSendable {
public enum NIOSSLTrustRoots: Hashable, Sendable {
/// Path to either a file of CA certificates in PEM format, or a directory containing CA certificates in PEM format.
///
/// If a path to a file is provided, the file can contain several CA certificates identified by
Expand Down Expand Up @@ -73,7 +73,7 @@ public enum NIOSSLTrustRoots: Hashable, NIOSendable {
}

/// Places NIOSSL can obtain additional trust roots from.
public enum NIOSSLAdditionalTrustRoots: Hashable, NIOSendable {
public enum NIOSSLAdditionalTrustRoots: Hashable, Sendable {
/// See ``NIOSSLTrustRoots/file(_:)``
case file(String)

Expand All @@ -82,7 +82,7 @@ public enum NIOSSLAdditionalTrustRoots: Hashable, NIOSendable {
}

/// Available ciphers to use for TLS instead of a string based representation.
public struct NIOTLSCipher: RawRepresentable, Hashable, NIOSendable {
public struct NIOTLSCipher: RawRepresentable, Hashable, Sendable {
/// Construct a ``NIOTLSCipher`` from the RFC code point for that cipher.
public init(rawValue: UInt16) {
self.rawValue = rawValue
Expand Down Expand Up @@ -126,13 +126,13 @@ public struct NIOTLSCipher: RawRepresentable, Hashable, NIOSendable {
}

/// Formats NIOSSL supports for serializing keys and certificates.
public enum NIOSSLSerializationFormats: NIOSendable {
public enum NIOSSLSerializationFormats: Sendable {
case pem
case der
}

/// Certificate verification modes.
public enum CertificateVerification: NIOSendable {
public enum CertificateVerification: Sendable {
/// All certificate verification disabled.
case none

Expand All @@ -151,7 +151,7 @@ public enum CertificateVerification: NIOSendable {
/// Renegotiation is only supported in TLS 1.2 and earlier, and generally does not work very well. NIOSSL will
/// disallow most uses of renegotiation: the only supported use-case is to perform post-connection authentication
/// *as a client*. There is no way to initiate a TLS renegotiation in NIOSSL.
public enum NIORenegotiationSupport: NIOSendable {
public enum NIORenegotiationSupport: Sendable {
/// No support for TLS renegotiation. The default and recommended setting.
case none

Expand All @@ -163,7 +163,7 @@ public enum NIORenegotiationSupport: NIOSendable {
}

/// Signature algorithms. The values are defined as in TLS 1.3
public struct SignatureAlgorithm : RawRepresentable, Hashable, NIOSendable {
public struct SignatureAlgorithm : RawRepresentable, Hashable, Sendable {

public typealias RawValue = UInt16
public var rawValue: UInt16
Expand Down

0 comments on commit 9fcdd00

Please sign in to comment.