Skip to content

Commit c9dcfe8

Browse files
Have public protocols refine SendableMetatype on Swift >= 6.2
1 parent 0a5ad8e commit c9dcfe8

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

Sources/NIOSSH/Connection State Machine/Operations/AcceptsUserAuthMessages.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import NIOCore
1616

17-
protocol AcceptsUserAuthMessages {
17+
protocol AcceptsUserAuthMessages: _NIOSSHSendableMetatype {
1818
var userAuthStateMachine: UserAuthenticationStateMachine { get set }
1919

2020
var role: SSHConnectionRole { get }

Sources/NIOSSH/Key Exchange/EllipticCurveKeyExchange.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import Foundation
2424

2525
/// This protocol defines a container used by the key exchange state machine to manage key exchange.
2626
/// This type erases the specific key exchanger.
27-
protocol EllipticCurveKeyExchangeProtocol {
27+
protocol EllipticCurveKeyExchangeProtocol: _NIOSSHSendableMetatype {
2828
init(ourRole: SSHConnectionRole, previousSessionIdentifier: ByteBuffer?)
2929

3030
func initiateKeyExchangeClientSide(allocator: ByteBufferAllocator) -> SSHMessage.KeyExchangeECDHInitMessage

Sources/NIOSSH/TransportProtection/SSHTransportProtection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import NIOCore
4444
/// Implementers of this protocol **must not** expose unauthenticated plaintext, except for the length field. This
4545
/// is required by the SSH protocol, and swift-nio-ssh does its best to treat the length field as fundamentally
4646
/// untrusted information.
47-
public protocol NIOSSHTransportProtection: AnyObject {
47+
public protocol NIOSSHTransportProtection: AnyObject, _NIOSSHSendableMetatype {
4848
/// The name of the cipher portion of this transport protection scheme as negotiated on the wire.
4949
static var cipherName: String { get }
5050

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the SwiftNIO open source project
4+
//
5+
// Copyright (c) 2019-2020 Apple Inc. and the SwiftNIO project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#if compiler(>=6.2)
16+
public typealias _NIOSSHSendableMetatype = SendableMetatype
17+
#else
18+
public typealias _NIOSSHSendableMetatype = Any
19+
#endif

0 commit comments

Comments
 (0)