Skip to content

Commit 4b1fe9f

Browse files
committed
分离libssh2
1 parent 81ce8ed commit 4b1fe9f

File tree

927 files changed

+28
-319226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

927 files changed

+28
-319226
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 sshterm
3+
Copyright (c) 2024 ssh2.app
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ SSH Term APP [ssh2.app](https://ssh2.app/) 的 SSH2连接核心
66
# 使用 OpenSSL 版
77

88
```
9+
pod 'CSSH/OpenSSL', :git => 'https://github.com/sshterm/cssh.git'
910
pod 'SSH/OpenSSL', :git => 'https://github.com/sshterm/ssh.git'
1011
```
1112

1213
# 使用 wolfSSL 版
1314

1415
```
16+
pod 'CSSH/wolfSSL', :git => 'https://github.com/sshterm/cssh.git'
1517
pod 'SSH/wolfSSL', :git => 'https://github.com/sshterm/ssh.git'
1618
```
1719

SSH.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Pod::Spec.new do |s|
1212
s.osx.deployment_target = '13.0'
1313
s.default_subspecs = :none
1414
s.subspec 'OpenSSL' do |cs|
15-
cs.source_files = 'src/**/*.{swift,c,h}'
16-
cs.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -DOPEN_SSL -DV010b01' }
17-
cs.vendored_frameworks = ["xcframework/CSSH-OpenSSL.xcframework"]
15+
cs.dependency 'CSSH'
16+
cs.source_files = 'src/**/*.{swift}'
17+
cs.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DOPEN_SSL -DV010b01' }
1818
cs.libraries = 'z'
1919
end
2020
s.subspec 'wolfSSL' do |cs|
21+
cs.dependency 'CSSH'
2122
cs.source_files = 'src/**/*.{swift}'
22-
cs.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '$(inherited) -DWOLF_SSL' }
23-
cs.vendored_frameworks = ["xcframework/CSSH-wolfSSL.xcframework"]
23+
cs.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DWOLF_SSL -DV010b01' }
2424
cs.libraries = 'z'
2525
end
2626
end

src/Crypto/Algorithm.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Copyright (c) 2024 ssh2.app
33
// Created by [email protected] 2024/8/19.
44

5-
import CSSH
5+
#if OPEN_SSL
6+
import OpenSSL
7+
#else
8+
import wolfSSL
9+
#endif
610
import Foundation
711

812
public enum ShaAlgorithm: String, CaseIterable {

src/Crypto/Crypto.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Copyright (c) 2024 ssh2.app
33
// Created by [email protected] 2024/8/18.
44

5-
import CSSH
5+
#if OPEN_SSL
6+
import OpenSSL
7+
#else
8+
import wolfSSL
9+
#endif
610
import Foundation
711

812
/// Crypto类提供了一个单例实例,用于表示当前使用的加密库。

src/Crypto/HMAC.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
// Copyright (c) 2024 ssh2.app
33
// Created by [email protected] 2024/8/18.
44

5-
import CSSH
5+
#if OPEN_SSL
6+
import OpenSSL
7+
#else
8+
import wolfSSL
9+
#endif
610
import Foundation
711

812
// 提供HMAC加密功能

src/Crypto/Sha.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
// Copyright (c) 2024 ssh2.app
33
// Created by [email protected] 2024/8/18.
44

5-
import CSSH
65
import Foundation
7-
6+
#if OPEN_SSL
7+
import OpenSSL
8+
#else
9+
import wolfSSL
10+
#endif
811
public extension Crypto {
912
/// 使用指定的算法对字符串进行SHA哈希计算
1013
/// - Parameters:

src/Crypto/sshkey.c

Lines changed: 0 additions & 221 deletions
This file was deleted.

src/Crypto/sshkey.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/Session.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public extension SSH {
9999
libssh2_session_flag(rawSession, LIBSSH2_FLAG_QUOTE_PATHS, 1)
100100

101101
libssh2_session_set_timeout(rawSession, timeout * 1000)
102-
// libssh2_session_set_timeout(self.rawSession, self.timeout)
103102

104103
libssh2_session_banner_set(rawSession, banner.isEmpty ? "SSH-2.0-libssh2_SSH2.app" : banner)
105104
#if V010b01

0 commit comments

Comments
 (0)