From d49b985157520c7fce17aa6944b8214676f7e357 Mon Sep 17 00:00:00 2001
From: obemu
Date: Tue, 30 Jul 2024 15:34:20 +0200
Subject: [PATCH 1/3] Bug fix in SftpFileWriter and increased version
constraints
---
CHANGELOG.md | 17 +++++++++++++++++
lib/src/sftp/sftp_stream_io.dart | 7 ++++++-
pubspec.yaml | 2 +-
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3d61807..7cbefc0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,20 @@
+## [2.9.2-pre] - 2023-04-02
+- Bumped SDK constraints from `">=2.17.0 <3.0.0"` up to `">=2.17.0 <4.0.0"`
+
+- Bug fix in `SftpFileWriter`:
+
+ When the input stream contains only one event and that event has fewer bytes than `maxBytesOnTheWire`, then the `SftpFileWriter._doneCompleter` never got completed. This happened because the completer got only completed in the `_handleLocalData` event handler if the `_streamDone` flag was already true, the problem is that if the stream only has one small event, then `_handleLocalData` will only be called once with the event and afterward `_handleLocalDone` will be called once, which sets `_streamDone` to true. At this point the `_doneCompleter` cannot be completed anymore because the `_handleLocalData` will not get called anymore. This problem causes never ending `await` statements when opening and writing a file.
+
+ This issue has been fixed by checking if all sent bytes have already been acknowledged in the `_handleLocalDone` event handler and subsequently completing the `_doneCompleter`.
+ ```dart
+ void _handleLocalDone() {
+ _streamDone = true;
+ if (_bytesSent == _bytesAcked) {
+ _doneCompleter.complete();
+ }
+ }
+ ```
+
## [2.9.1-pre] - 2023-04-02
- Make the type of `SSHForwardChannel.sink` to `StreamSink>` to match
its super class.
diff --git a/lib/src/sftp/sftp_stream_io.dart b/lib/src/sftp/sftp_stream_io.dart
index 03ca0ea..818f392 100644
--- a/lib/src/sftp/sftp_stream_io.dart
+++ b/lib/src/sftp/sftp_stream_io.dart
@@ -108,13 +108,18 @@ class SftpFileWriter with DoneFuture {
_subscription.resume();
}
- if (_streamDone && _bytesSent == _bytesAcked) {
+ if (!_doneCompleter.isCompleted &&
+ _streamDone &&
+ _bytesSent == _bytesAcked) {
_doneCompleter.complete();
}
}
void _handleLocalDone() {
_streamDone = true;
+ if (_bytesSent == _bytesAcked) {
+ _doneCompleter.complete();
+ }
}
}
diff --git a/pubspec.yaml b/pubspec.yaml
index f6a433b..c334f40 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -4,7 +4,7 @@ description: SSH and SFTP client written in pure Dart, aiming to be feature-rich
homepage: https://github.com/TerminalStudio/dartssh2
environment:
- sdk: ">=2.17.0 <3.0.0"
+ sdk: ">=2.17.0 <4.0.0"
dependencies:
asn1lib: ^1.0.0
From 587af0066130d2839f052dd7b2543158d50d25ff Mon Sep 17 00:00:00 2001
From: obemu
Date: Tue, 30 Jul 2024 15:48:41 +0200
Subject: [PATCH 2/3] Fixed
[#80](https://github.com/TerminalStudio/dartssh2/issues/80), also updated
CHANGELOG.md
---
CHANGELOG.md | 4 +++-
lib/src/sftp/sftp_file_open_mode.dart | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7cbefc0..e751fd8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,7 @@
## [2.9.2-pre] - 2023-04-02
- Bumped SDK constraints from `">=2.17.0 <3.0.0"` up to `">=2.17.0 <4.0.0"`
-- Bug fix in `SftpFileWriter`:
+- Bug fix in `SftpFileWriter` for [#50](https://github.com/TerminalStudio/dartssh2/issues/50), [#71](https://github.com/TerminalStudio/dartssh2/issues/71), [#100](https://github.com/TerminalStudio/dartssh2/issues/100):
When the input stream contains only one event and that event has fewer bytes than `maxBytesOnTheWire`, then the `SftpFileWriter._doneCompleter` never got completed. This happened because the completer got only completed in the `_handleLocalData` event handler if the `_streamDone` flag was already true, the problem is that if the stream only has one small event, then `_handleLocalData` will only be called once with the event and afterward `_handleLocalDone` will be called once, which sets `_streamDone` to true. At this point the `_doneCompleter` cannot be completed anymore because the `_handleLocalData` will not get called anymore. This problem causes never ending `await` statements when opening and writing a file.
@@ -15,6 +15,8 @@
}
```
+- Added return type `SftpFileOpenMode` to operator `|` in class `SftpFileOpenMode`. Fix for [#80](https://github.com/TerminalStudio/dartssh2/issues/80).
+
## [2.9.1-pre] - 2023-04-02
- Make the type of `SSHForwardChannel.sink` to `StreamSink>` to match
its super class.
diff --git a/lib/src/sftp/sftp_file_open_mode.dart b/lib/src/sftp/sftp_file_open_mode.dart
index 859ab18..6632c9a 100644
--- a/lib/src/sftp/sftp_file_open_mode.dart
+++ b/lib/src/sftp/sftp_file_open_mode.dart
@@ -28,5 +28,6 @@ class SftpFileOpenMode {
const SftpFileOpenMode._(this.flag);
- operator |(SftpFileOpenMode other) => SftpFileOpenMode._(flag | other.flag);
+ SftpFileOpenMode operator |(SftpFileOpenMode other) =>
+ SftpFileOpenMode._(flag | other.flag);
}
From ae443a5a841d99d65bf324f73a3825944d80839c Mon Sep 17 00:00:00 2001
From: obemu
Date: Tue, 13 Aug 2024 16:30:02 +0200
Subject: [PATCH 3/3] * Renamed dartssh2 to dartssh3
* Updated pubspec.yaml and README.md to point to new github repository
* Edited README.md
---
CHANGELOG.md | 5 +-
LICENSE | 1 +
README.md | 29 ++++++-----
TODO.md | 3 ++
example/example.dart | 2 +-
example/execute.dart | 2 +-
example/forward_local.dart | 2 +-
example/forward_remote.dart | 2 +-
example/pubkey.dart | 2 +-
example/sftp_filetype.dart | 2 +-
example/sftp_list.dart | 2 +-
example/sftp_read.dart | 2 +-
example/sftp_stat.dart | 2 +-
example/sftp_upload.dart | 2 +-
example/sftp_write.dart | 2 +-
example/shell.dart | 2 +-
example/ssh_http.dart | 2 +-
example/ssh_jump.dart | 2 +-
lib/{dartssh2.dart => dartssh3.dart} | 0
lib/src/algorithm/ssh_cipher_type.dart | 2 +-
lib/src/algorithm/ssh_hostkey_type.dart | 2 +-
lib/src/algorithm/ssh_kex_type.dart | 2 +-
lib/src/algorithm/ssh_mac_type.dart | 2 +-
lib/src/hostkey/hostkey_ecdsa.dart | 4 +-
lib/src/hostkey/hostkey_ed25519.dart | 4 +-
lib/src/hostkey/hostkey_rsa.dart | 4 +-
lib/src/http/http_client.dart | 12 ++---
lib/src/http/http_content_type.dart | 4 +-
lib/src/http/http_headers.dart | 2 +-
lib/src/kex/kex_dh.dart | 6 +--
lib/src/kex/kex_nist.dart | 6 +--
lib/src/kex/kex_x25519.dart | 6 +--
lib/src/message/msg_channel.dart | 2 +-
lib/src/message/msg_debug.dart | 2 +-
lib/src/message/msg_disconnect.dart | 2 +-
lib/src/message/msg_ignore.dart | 2 +-
lib/src/message/msg_kex.dart | 4 +-
lib/src/message/msg_kex_dh.dart | 2 +-
lib/src/message/msg_kex_ecdh.dart | 2 +-
lib/src/message/msg_request.dart | 2 +-
lib/src/message/msg_service.dart | 2 +-
lib/src/message/msg_userauth.dart | 4 +-
lib/src/sftp/sftp_client.dart | 26 +++++-----
lib/src/sftp/sftp_errors.dart | 4 +-
lib/src/sftp/sftp_file_attrs.dart | 4 +-
lib/src/sftp/sftp_name.dart | 4 +-
lib/src/sftp/sftp_packet.dart | 6 +--
lib/src/sftp/sftp_packet_ext.dart | 4 +-
lib/src/sftp/sftp_statvfs.dart | 2 +-
lib/src/sftp/sftp_stream_io.dart | 4 +-
lib/src/socket/ssh_socket.dart | 4 +-
lib/src/socket/ssh_socket_io.dart | 2 +-
lib/src/socket/ssh_socket_js.dart | 2 +-
lib/src/ssh_algorithm.dart | 8 +--
lib/src/ssh_channel.dart | 12 ++---
lib/src/ssh_client.dart | 38 +++++++-------
lib/src/ssh_forward.dart | 4 +-
lib/src/ssh_hostkey.dart | 2 +-
lib/src/ssh_kex_utils.dart | 6 +--
lib/src/ssh_key_pair.dart | 36 +++++++-------
lib/src/ssh_message.dart | 6 +--
lib/src/ssh_session.dart | 6 +--
lib/src/ssh_transport.dart | 52 ++++++++++----------
pubspec.yaml | 8 +--
test/src/algorithm/ssh_cipher_type_test.dart | 4 +-
test/src/kex/kex_dh_test.dart | 2 +-
test/src/kex/kex_nist_test.dart | 2 +-
test/src/kex/kex_x25519_test.dart | 2 +-
test/src/sftp/sftp_client_test.dart | 2 +-
test/src/sftp/sftp_stream_io_test.dart | 2 +-
test/src/socket/ssh_socket_io_test.dart | 2 +-
test/src/ssh_client_test.dart | 2 +-
test/src/ssh_key_pair_test.dart | 2 +-
test/src/ssh_pem_test.dart | 2 +-
test/src/utils/bcrypt_test.dart | 2 +-
test/src/utils/stream_test.dart | 2 +-
test/test_utils.dart | 2 +-
77 files changed, 210 insertions(+), 204 deletions(-)
create mode 100644 TODO.md
rename lib/{dartssh2.dart => dartssh3.dart} (100%)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e751fd8..2b3c51f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,7 @@
-## [2.9.2-pre] - 2023-04-02
+## [3.0.0] - 2024-08-13
+
+- Changed version constraints for package `pinenacl` from `^0.5.0` to `">=0.5.0 <1.0.0"` to support Dart SDK `>= 3.5.0`. See Dart SDK [Changelog](https://github.com/dart-lang/sdk/blob/3ccadc5c277a6c70f207d14600524578f4c527ad/CHANGELOG.md?plain=1#L106).
+
- Bumped SDK constraints from `">=2.17.0 <3.0.0"` up to `">=2.17.0 <4.0.0"`
- Bug fix in `SftpFileWriter` for [#50](https://github.com/TerminalStudio/dartssh2/issues/50), [#71](https://github.com/TerminalStudio/dartssh2/issues/71), [#100](https://github.com/TerminalStudio/dartssh2/issues/100):
diff --git a/LICENSE b/LICENSE
index 3754132..71b2557 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,7 @@
MIT License
Copyright (c) 2022 xuty
+Copyright (c) 2024 Emanuel Oberholzer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 4410f98..a4bbfb7 100644
--- a/README.md
+++ b/README.md
@@ -1,32 +1,29 @@
-
DartSSH 2
+ DartSSH 3
-
-
+
+
-
-
+
+
-
-
+
+
-
+
SSH and SFTP client written in pure Dart, aiming to be feature-rich as well as easy to use.
-> **dartssh2** is now a complete rewrite of [dartssh].
+> **dartssh3** is a fork of [dartssh2](https://pub.dev/packages/dartssh2), because the original author stopped development.
## ✨ Features
@@ -426,8 +423,10 @@ print('free: ${statvfs.blockSize * statvfs.freeBlocks}');
https://github.com/GreenAppers/dartssh by GreenAppers
+https://github.com/TerminalStudio/dartssh2 by TerminalStudio
+
## License
-dartssh is released under the terms of the MIT license. See [LICENSE](LICENSE).
+[dartssh](https://github.com/GreenAppers/dartssh) is released under the terms of the MIT license. See [LICENSE](https://github.com/GreenAppers/dartssh/blob/d209ba2015937f0605d5eb254dc16baebbdab30f/LICENSE).
-[dartssh]: https://github.com/GreenAppers/dartssh
\ No newline at end of file
+[dartssh2](https://github.com/TerminalStudio/dartssh2) is released under the terms of the MIT license. See [LICENSE](https://github.com/TerminalStudio/dartssh2/blob/9e7d3eafb02de28e080be92a5db1761d8251aa66/LICENSE).
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..ac9875f
--- /dev/null
+++ b/TODO.md
@@ -0,0 +1,3 @@
+- [ ] Fix test cases from old dev TerminalStudio
+
+- [ ] Reimplement GitHub workflows
diff --git a/example/example.dart b/example/example.dart
index 935cd1d..4cbf424 100644
--- a/example/example.dart
+++ b/example/example.dart
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/execute.dart b/example/execute.dart
index b4df8f7..86cf32b 100644
--- a/example/execute.dart
+++ b/example/execute.dart
@@ -1,7 +1,7 @@
import 'dart:io';
import 'dart:typed_data';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final client = SSHClient(
diff --git a/example/forward_local.dart b/example/forward_local.dart
index 75257d0..54d1519 100644
--- a/example/forward_local.dart
+++ b/example/forward_local.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/forward_remote.dart b/example/forward_remote.dart
index 25a13c4..76dfd12 100644
--- a/example/forward_remote.dart
+++ b/example/forward_remote.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/pubkey.dart b/example/pubkey.dart
index 950e0ee..cfbb335 100644
--- a/example/pubkey.dart
+++ b/example/pubkey.dart
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/sftp_filetype.dart b/example/sftp_filetype.dart
index 5399b49..32464cb 100644
--- a/example/sftp_filetype.dart
+++ b/example/sftp_filetype.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/sftp_list.dart b/example/sftp_list.dart
index 8e74df7..22675f6 100644
--- a/example/sftp_list.dart
+++ b/example/sftp_list.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/sftp_read.dart b/example/sftp_read.dart
index 98b09d3..d530829 100644
--- a/example/sftp_read.dart
+++ b/example/sftp_read.dart
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/sftp_stat.dart b/example/sftp_stat.dart
index d7cb3f8..33ddca8 100644
--- a/example/sftp_stat.dart
+++ b/example/sftp_stat.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/sftp_upload.dart b/example/sftp_upload.dart
index 68f3c18..2634e5d 100644
--- a/example/sftp_upload.dart
+++ b/example/sftp_upload.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final client = SSHClient(
diff --git a/example/sftp_write.dart b/example/sftp_write.dart
index 98ea7a3..fbe19d1 100644
--- a/example/sftp_write.dart
+++ b/example/sftp_write.dart
@@ -1,7 +1,7 @@
import 'dart:convert';
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/shell.dart b/example/shell.dart
index c715585..4afc097 100644
--- a/example/shell.dart
+++ b/example/shell.dart
@@ -1,7 +1,7 @@
import 'dart:io';
import 'dart:typed_data';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final socket = await SSHSocket.connect('localhost', 22);
diff --git a/example/ssh_http.dart b/example/ssh_http.dart
index b2c4394..f0fe25c 100644
--- a/example/ssh_http.dart
+++ b/example/ssh_http.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main(List args) async {
final client = SSHClient(
diff --git a/example/ssh_jump.dart b/example/ssh_jump.dart
index c19178b..bb989e4 100644
--- a/example/ssh_jump.dart
+++ b/example/ssh_jump.dart
@@ -1,6 +1,6 @@
import 'dart:convert';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
void main() async {
final jumpServer = SSHClient(
diff --git a/lib/dartssh2.dart b/lib/dartssh3.dart
similarity index 100%
rename from lib/dartssh2.dart
rename to lib/dartssh3.dart
diff --git a/lib/src/algorithm/ssh_cipher_type.dart b/lib/src/algorithm/ssh_cipher_type.dart
index 2553ca6..dad77fa 100644
--- a/lib/src/algorithm/ssh_cipher_type.dart
+++ b/lib/src/algorithm/ssh_cipher_type.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
import 'package:pointycastle/export.dart';
class SSHCipherType with SSHAlgorithm {
diff --git a/lib/src/algorithm/ssh_hostkey_type.dart b/lib/src/algorithm/ssh_hostkey_type.dart
index 307ef7d..aaffe18 100644
--- a/lib/src/algorithm/ssh_hostkey_type.dart
+++ b/lib/src/algorithm/ssh_hostkey_type.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
class SSHHostkeyType with SSHAlgorithm {
static const rsaSha1 = SSHHostkeyType._('ssh-rsa');
diff --git a/lib/src/algorithm/ssh_kex_type.dart b/lib/src/algorithm/ssh_kex_type.dart
index 9110230..141d5af 100644
--- a/lib/src/algorithm/ssh_kex_type.dart
+++ b/lib/src/algorithm/ssh_kex_type.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
import 'package:pointycastle/export.dart';
class SSHKexType with SSHAlgorithm {
diff --git a/lib/src/algorithm/ssh_mac_type.dart b/lib/src/algorithm/ssh_mac_type.dart
index 0d1f59b..95bcbed 100644
--- a/lib/src/algorithm/ssh_mac_type.dart
+++ b/lib/src/algorithm/ssh_mac_type.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
import 'package:pointycastle/export.dart';
class SSHMacType with SSHAlgorithm {
diff --git a/lib/src/hostkey/hostkey_ecdsa.dart b/lib/src/hostkey/hostkey_ecdsa.dart
index 4770bd4..16c9af6 100644
--- a/lib/src/hostkey/hostkey_ecdsa.dart
+++ b/lib/src/hostkey/hostkey_ecdsa.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/ssh_hostkey.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_hostkey.dart';
+import 'package:dartssh3/src/ssh_message.dart';
import 'package:pointycastle/export.dart';
class SSHEcdsaPublicKey implements SSHHostKey {
diff --git a/lib/src/hostkey/hostkey_ed25519.dart b/lib/src/hostkey/hostkey_ed25519.dart
index 4b61a86..b3e1737 100644
--- a/lib/src/hostkey/hostkey_ed25519.dart
+++ b/lib/src/hostkey/hostkey_ed25519.dart
@@ -1,6 +1,6 @@
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/ssh_hostkey.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_hostkey.dart';
+import 'package:dartssh3/src/ssh_message.dart';
import 'package:pinenacl/ed25519.dart';
class SSHEd25519PublicKey implements SSHHostKey {
diff --git a/lib/src/hostkey/hostkey_rsa.dart b/lib/src/hostkey/hostkey_rsa.dart
index f34022d..adef177 100644
--- a/lib/src/hostkey/hostkey_rsa.dart
+++ b/lib/src/hostkey/hostkey_rsa.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/ssh_hostkey.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_hostkey.dart';
+import 'package:dartssh3/src/ssh_message.dart';
import 'package:pinenacl/ed25519.dart';
import 'package:pointycastle/api.dart' hide Signature;
diff --git a/lib/src/http/http_client.dart b/lib/src/http/http_client.dart
index be3f972..3423892 100644
--- a/lib/src/http/http_client.dart
+++ b/lib/src/http/http_client.dart
@@ -1,12 +1,12 @@
import 'dart:convert';
import 'dart:typed_data';
-import 'package:dartssh2/src/http/http_exception.dart';
-import 'package:dartssh2/src/http/line_decoder.dart';
-import 'package:dartssh2/src/http/http_content_type.dart';
-import 'package:dartssh2/src/http/http_headers.dart';
-import 'package:dartssh2/src/socket/ssh_socket.dart';
-import 'package:dartssh2/src/ssh_client.dart';
+import 'package:dartssh3/src/http/http_exception.dart';
+import 'package:dartssh3/src/http/line_decoder.dart';
+import 'package:dartssh3/src/http/http_content_type.dart';
+import 'package:dartssh3/src/http/http_headers.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/ssh_client.dart';
/// A HTTP client that works over SSH port forwarding.
///
diff --git a/lib/src/http/http_content_type.dart b/lib/src/http/http_content_type.dart
index 74e6d34..0b15655 100644
--- a/lib/src/http/http_content_type.dart
+++ b/lib/src/http/http_content_type.dart
@@ -1,7 +1,7 @@
import 'dart:collection';
-import 'package:dartssh2/src/http/http_exception.dart';
-import 'package:dartssh2/src/http/http_headers.dart';
+import 'package:dartssh3/src/http/http_exception.dart';
+import 'package:dartssh3/src/http/http_headers.dart';
/// A MIME/IANA media type used as the value of the
/// [SSHHttpHeaders.contentTypeHeader] header.
diff --git a/lib/src/http/http_headers.dart b/lib/src/http/http_headers.dart
index 55851a5..8b2db47 100644
--- a/lib/src/http/http_headers.dart
+++ b/lib/src/http/http_headers.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/http/http_content_type.dart';
+import 'package:dartssh3/src/http/http_content_type.dart';
/// Headers for HTTP requests and responses.
///
diff --git a/lib/src/kex/kex_dh.dart b/lib/src/kex/kex_dh.dart
index bf83cd4..bb51bc8 100644
--- a/lib/src/kex/kex_dh.dart
+++ b/lib/src/kex/kex_dh.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_kex.dart';
-import 'package:dartssh2/src/utils/bigint.dart';
-import 'package:dartssh2/src/utils/list.dart';
+import 'package:dartssh3/src/ssh_kex.dart';
+import 'package:dartssh3/src/utils/bigint.dart';
+import 'package:dartssh3/src/utils/list.dart';
/// The Diffie-Hellman (DH) key exchange provides a shared secret that
/// cannot be determined by either party alone.
diff --git a/lib/src/kex/kex_nist.dart b/lib/src/kex/kex_nist.dart
index 23df1a8..6d523eb 100644
--- a/lib/src/kex/kex_nist.dart
+++ b/lib/src/kex/kex_nist.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_kex.dart';
-import 'package:dartssh2/src/utils/bigint.dart';
-import 'package:dartssh2/src/utils/list.dart';
+import 'package:dartssh3/src/ssh_kex.dart';
+import 'package:dartssh3/src/utils/bigint.dart';
+import 'package:dartssh3/src/utils/list.dart';
import 'package:pointycastle/ecc/curves/secp256r1.dart';
import 'package:pointycastle/ecc/curves/secp384r1.dart';
import 'package:pointycastle/ecc/curves/secp521r1.dart';
diff --git a/lib/src/kex/kex_x25519.dart b/lib/src/kex/kex_x25519.dart
index 77a8ff6..f61ba25 100644
--- a/lib/src/kex/kex_x25519.dart
+++ b/lib/src/kex/kex_x25519.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_kex.dart';
-import 'package:dartssh2/src/utils/bigint.dart';
-import 'package:dartssh2/src/utils/list.dart';
+import 'package:dartssh3/src/ssh_kex.dart';
+import 'package:dartssh3/src/utils/bigint.dart';
+import 'package:dartssh3/src/utils/list.dart';
import 'package:pinenacl/tweetnacl.dart';
class SSHKexX25519 implements SSHKexECDH {
diff --git a/lib/src/message/msg_channel.dart b/lib/src/message/msg_channel.dart
index cab4111..b9da5f5 100644
--- a/lib/src/message/msg_channel.dart
+++ b/lib/src/message/msg_channel.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
/// Message to request opening a channel to remote host.
class SSH_Message_Channel_Open implements SSHMessage {
diff --git a/lib/src/message/msg_debug.dart b/lib/src/message/msg_debug.dart
index be8ded0..4e3ded0 100644
--- a/lib/src/message/msg_debug.dart
+++ b/lib/src/message/msg_debug.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_Debug implements SSHMessage {
static const messageId = 4;
diff --git a/lib/src/message/msg_disconnect.dart b/lib/src/message/msg_disconnect.dart
index c3922b6..5f1fc2c 100644
--- a/lib/src/message/msg_disconnect.dart
+++ b/lib/src/message/msg_disconnect.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_Disconnect extends SSHMessage {
static const messageId = 1;
diff --git a/lib/src/message/msg_ignore.dart b/lib/src/message/msg_ignore.dart
index 82a2bbf..2028a28 100644
--- a/lib/src/message/msg_ignore.dart
+++ b/lib/src/message/msg_ignore.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_Ignore extends SSHMessage {
static const messageId = 2;
diff --git a/lib/src/message/msg_kex.dart b/lib/src/message/msg_kex.dart
index 57ca7a6..fb2bb02 100644
--- a/lib/src/message/msg_kex.dart
+++ b/lib/src/message/msg_kex.dart
@@ -2,8 +2,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
-import 'package:dartssh2/src/utils/list.dart';
+import 'package:dartssh3/src/ssh_message.dart';
+import 'package:dartssh3/src/utils/list.dart';
class SSH_Message_KexInit implements SSHMessage {
static const messageId = 20;
diff --git a/lib/src/message/msg_kex_dh.dart b/lib/src/message/msg_kex_dh.dart
index 60d83b5..61cd4a5 100644
--- a/lib/src/message/msg_kex_dh.dart
+++ b/lib/src/message/msg_kex_dh.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_KexDH_Init implements SSHMessage {
static const messageId = 30;
diff --git a/lib/src/message/msg_kex_ecdh.dart b/lib/src/message/msg_kex_ecdh.dart
index 3ecd55f..e6e5705 100644
--- a/lib/src/message/msg_kex_ecdh.dart
+++ b/lib/src/message/msg_kex_ecdh.dart
@@ -3,7 +3,7 @@
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_KexECDH_Init implements SSHMessage {
static const messageId = 30;
diff --git a/lib/src/message/msg_request.dart b/lib/src/message/msg_request.dart
index c18029b..41005b0 100644
--- a/lib/src/message/msg_request.dart
+++ b/lib/src/message/msg_request.dart
@@ -3,7 +3,7 @@
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_Global_Request extends SSHMessage {
static const messageId = 80;
diff --git a/lib/src/message/msg_service.dart b/lib/src/message/msg_service.dart
index 62e66a1..c0d7104 100644
--- a/lib/src/message/msg_service.dart
+++ b/lib/src/message/msg_service.dart
@@ -2,7 +2,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SSH_Message_Service_Request implements SSHMessage {
static const messageId = 5;
diff --git a/lib/src/message/msg_userauth.dart b/lib/src/message/msg_userauth.dart
index 42b23f9..3416b5d 100644
--- a/lib/src/message/msg_userauth.dart
+++ b/lib/src/message/msg_userauth.dart
@@ -2,8 +2,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
-import 'package:dartssh2/src/ssh_userauth.dart';
+import 'package:dartssh3/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_userauth.dart';
class SSH_Message_Userauth_Request extends SSHMessage {
static const messageId = 50;
diff --git a/lib/src/sftp/sftp_client.dart b/lib/src/sftp/sftp_client.dart
index 981b8ce..ad6d28f 100644
--- a/lib/src/sftp/sftp_client.dart
+++ b/lib/src/sftp/sftp_client.dart
@@ -3,19 +3,19 @@ import 'dart:math';
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/sftp/sftp_errors.dart';
-import 'package:dartssh2/src/sftp/sftp_file_attrs.dart';
-import 'package:dartssh2/src/sftp/sftp_file_open_mode.dart';
-import 'package:dartssh2/src/sftp/sftp_name.dart';
-import 'package:dartssh2/src/sftp/sftp_packet.dart';
-import 'package:dartssh2/src/sftp/sftp_packet_ext.dart';
-import 'package:dartssh2/src/sftp/sftp_request_id.dart';
-import 'package:dartssh2/src/sftp/sftp_statvfs.dart';
-import 'package:dartssh2/src/sftp/sftp_stream_io.dart';
-import 'package:dartssh2/src/ssh_channel.dart';
-import 'package:dartssh2/src/ssh_transport.dart';
-import 'package:dartssh2/src/utils/chunk_buffer.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/sftp/sftp_errors.dart';
+import 'package:dartssh3/src/sftp/sftp_file_attrs.dart';
+import 'package:dartssh3/src/sftp/sftp_file_open_mode.dart';
+import 'package:dartssh3/src/sftp/sftp_name.dart';
+import 'package:dartssh3/src/sftp/sftp_packet.dart';
+import 'package:dartssh3/src/sftp/sftp_packet_ext.dart';
+import 'package:dartssh3/src/sftp/sftp_request_id.dart';
+import 'package:dartssh3/src/sftp/sftp_statvfs.dart';
+import 'package:dartssh3/src/sftp/sftp_stream_io.dart';
+import 'package:dartssh3/src/ssh_channel.dart';
+import 'package:dartssh3/src/ssh_transport.dart';
+import 'package:dartssh3/src/utils/chunk_buffer.dart';
+import 'package:dartssh3/src/ssh_message.dart';
const _kVersion = 3;
diff --git a/lib/src/sftp/sftp_errors.dart b/lib/src/sftp/sftp_errors.dart
index 74f5a38..3bf2db7 100644
--- a/lib/src/sftp/sftp_errors.dart
+++ b/lib/src/sftp/sftp_errors.dart
@@ -1,5 +1,5 @@
-import 'package:dartssh2/src/sftp/sftp_packet.dart';
-import 'package:dartssh2/src/sftp/sftp_status_code.dart';
+import 'package:dartssh3/src/sftp/sftp_packet.dart';
+import 'package:dartssh3/src/sftp/sftp_status_code.dart';
class SftpError {
final String message;
diff --git a/lib/src/sftp/sftp_file_attrs.dart b/lib/src/sftp/sftp_file_attrs.dart
index 44e4bc2..8207d11 100644
--- a/lib/src/sftp/sftp_file_attrs.dart
+++ b/lib/src/sftp/sftp_file_attrs.dart
@@ -1,5 +1,5 @@
-import 'package:dartssh2/src/utils/int.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/utils/int.dart';
+import 'package:dartssh3/src/ssh_message.dart';
abstract class _Flags {
static const size = 0x00000001;
diff --git a/lib/src/sftp/sftp_name.dart b/lib/src/sftp/sftp_name.dart
index 7620c63..30de0c2 100644
--- a/lib/src/sftp/sftp_name.dart
+++ b/lib/src/sftp/sftp_name.dart
@@ -1,5 +1,5 @@
-import 'package:dartssh2/src/sftp/sftp_file_attrs.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/sftp/sftp_file_attrs.dart';
+import 'package:dartssh3/src/ssh_message.dart';
class SftpName {
final String filename;
diff --git a/lib/src/sftp/sftp_packet.dart b/lib/src/sftp/sftp_packet.dart
index 7e81877..f8b6593 100644
--- a/lib/src/sftp/sftp_packet.dart
+++ b/lib/src/sftp/sftp_packet.dart
@@ -1,9 +1,9 @@
import 'dart:typed_data';
import 'package:convert/convert.dart';
-import 'package:dartssh2/src/sftp/sftp_file_attrs.dart';
-import 'package:dartssh2/src/sftp/sftp_name.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/sftp/sftp_file_attrs.dart';
+import 'package:dartssh3/src/sftp/sftp_name.dart';
+import 'package:dartssh3/src/ssh_message.dart';
// SSH_FXP_INIT 1 init
// SSH_FXP_VERSION 2 init-reply
diff --git a/lib/src/sftp/sftp_packet_ext.dart b/lib/src/sftp/sftp_packet_ext.dart
index 9808d67..55a49aa 100644
--- a/lib/src/sftp/sftp_packet_ext.dart
+++ b/lib/src/sftp/sftp_packet_ext.dart
@@ -1,7 +1,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/sftp/sftp_packet.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/sftp/sftp_packet.dart';
+import 'package:dartssh3/src/ssh_message.dart';
/// Represents the payload of an extended request. Should be wrapped in a
/// [SftpExtendedPacket] before being sent.
diff --git a/lib/src/sftp/sftp_statvfs.dart b/lib/src/sftp/sftp_statvfs.dart
index d3b4a37..2f7fa50 100644
--- a/lib/src/sftp/sftp_statvfs.dart
+++ b/lib/src/sftp/sftp_statvfs.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/sftp/sftp_packet_ext.dart';
+import 'package:dartssh3/src/sftp/sftp_packet_ext.dart';
/// Information about the file system. Corresponds to the `statvfs` system call
/// on POSIX systems.
diff --git a/lib/src/sftp/sftp_stream_io.dart b/lib/src/sftp/sftp_stream_io.dart
index 818f392..0b9920c 100644
--- a/lib/src/sftp/sftp_stream_io.dart
+++ b/lib/src/sftp/sftp_stream_io.dart
@@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:typed_data';
-import 'package:dartssh2/src/sftp/sftp_client.dart';
-import 'package:dartssh2/src/utils/stream.dart';
+import 'package:dartssh3/src/sftp/sftp_client.dart';
+import 'package:dartssh3/src/utils/stream.dart';
/// The amount of data to send in a single SFTP packet.
///
diff --git a/lib/src/socket/ssh_socket.dart b/lib/src/socket/ssh_socket.dart
index 764d882..cf37bcc 100644
--- a/lib/src/socket/ssh_socket.dart
+++ b/lib/src/socket/ssh_socket.dart
@@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:typed_data';
-import 'package:dartssh2/src/socket/ssh_socket_io.dart'
- if (dart.library.js) 'package:dartssh2/src/socket/ssh_socket_js.dart';
+import 'package:dartssh3/src/socket/ssh_socket_io.dart'
+ if (dart.library.js) 'package:dartssh3/src/socket/ssh_socket_js.dart';
abstract class SSHSocket {
static Future connect(
diff --git a/lib/src/socket/ssh_socket_io.dart b/lib/src/socket/ssh_socket_io.dart
index a8f155b..3e0138e 100644
--- a/lib/src/socket/ssh_socket_io.dart
+++ b/lib/src/socket/ssh_socket_io.dart
@@ -2,7 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
-import 'package:dartssh2/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
Future connectNativeSocket(
String host,
diff --git a/lib/src/socket/ssh_socket_js.dart b/lib/src/socket/ssh_socket_js.dart
index 8a6a817..c0d8b17 100644
--- a/lib/src/socket/ssh_socket_js.dart
+++ b/lib/src/socket/ssh_socket_js.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
Future connectNativeSocket(
String host,
diff --git a/lib/src/ssh_algorithm.dart b/lib/src/ssh_algorithm.dart
index 35d3c7d..1a34f5d 100644
--- a/lib/src/ssh_algorithm.dart
+++ b/lib/src/ssh_algorithm.dart
@@ -1,7 +1,7 @@
-import 'package:dartssh2/src/algorithm/ssh_cipher_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_hostkey_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_kex_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_mac_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_cipher_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_hostkey_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_kex_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_mac_type.dart';
abstract class SSHAlgorithm {
/// The name of the algorithm.
diff --git a/lib/src/ssh_channel.dart b/lib/src/ssh_channel.dart
index 29c3ca2..dcfda81 100644
--- a/lib/src/ssh_channel.dart
+++ b/lib/src/ssh_channel.dart
@@ -3,12 +3,12 @@ import 'dart:math';
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_channel_id.dart';
-import 'package:dartssh2/src/ssh_transport.dart';
-import 'package:dartssh2/src/utils/async_queue.dart';
-import 'package:dartssh2/src/message/msg_channel.dart';
-import 'package:dartssh2/src/ssh_message.dart';
-import 'package:dartssh2/src/utils/stream.dart';
+import 'package:dartssh3/src/ssh_channel_id.dart';
+import 'package:dartssh3/src/ssh_transport.dart';
+import 'package:dartssh3/src/utils/async_queue.dart';
+import 'package:dartssh3/src/message/msg_channel.dart';
+import 'package:dartssh3/src/ssh_message.dart';
+import 'package:dartssh3/src/utils/stream.dart';
/// Handler of channel requests. Return true if the request was handled, false
/// if the request was not recognized or could not be handled.
diff --git a/lib/src/ssh_client.dart b/lib/src/ssh_client.dart
index 9ddc183..b4078ca 100644
--- a/lib/src/ssh_client.dart
+++ b/lib/src/ssh_client.dart
@@ -2,25 +2,25 @@ import 'dart:async';
import 'dart:collection';
import 'dart:typed_data';
-import 'package:dartssh2/src/http/http_client.dart';
-import 'package:dartssh2/src/sftp/sftp_client.dart';
-import 'package:dartssh2/src/ssh_algorithm.dart';
-import 'package:dartssh2/src/ssh_channel.dart';
-import 'package:dartssh2/src/ssh_channel_id.dart';
-import 'package:dartssh2/src/ssh_errors.dart';
-import 'package:dartssh2/src/ssh_forward.dart';
-import 'package:dartssh2/src/ssh_keepalive.dart';
-import 'package:dartssh2/src/ssh_key_pair.dart';
-import 'package:dartssh2/src/ssh_session.dart';
-import 'package:dartssh2/src/ssh_transport.dart';
-import 'package:dartssh2/src/utils/async_queue.dart';
-import 'package:dartssh2/src/message/msg_channel.dart';
-import 'package:dartssh2/src/message/msg_request.dart';
-import 'package:dartssh2/src/message/msg_service.dart';
-import 'package:dartssh2/src/message/msg_userauth.dart';
-import 'package:dartssh2/src/ssh_message.dart';
-import 'package:dartssh2/src/socket/ssh_socket.dart';
-import 'package:dartssh2/src/ssh_userauth.dart';
+import 'package:dartssh3/src/http/http_client.dart';
+import 'package:dartssh3/src/sftp/sftp_client.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_channel.dart';
+import 'package:dartssh3/src/ssh_channel_id.dart';
+import 'package:dartssh3/src/ssh_errors.dart';
+import 'package:dartssh3/src/ssh_forward.dart';
+import 'package:dartssh3/src/ssh_keepalive.dart';
+import 'package:dartssh3/src/ssh_key_pair.dart';
+import 'package:dartssh3/src/ssh_session.dart';
+import 'package:dartssh3/src/ssh_transport.dart';
+import 'package:dartssh3/src/utils/async_queue.dart';
+import 'package:dartssh3/src/message/msg_channel.dart';
+import 'package:dartssh3/src/message/msg_request.dart';
+import 'package:dartssh3/src/message/msg_service.dart';
+import 'package:dartssh3/src/message/msg_userauth.dart';
+import 'package:dartssh3/src/ssh_message.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/ssh_userauth.dart';
/// https://datatracker.ietf.org/doc/html/rfc4252#section-8
typedef SSHPasswordRequestHandler = FutureOr Function();
diff --git a/lib/src/ssh_forward.dart b/lib/src/ssh_forward.dart
index 2494df3..b062dc6 100644
--- a/lib/src/ssh_forward.dart
+++ b/lib/src/ssh_forward.dart
@@ -1,8 +1,8 @@
import 'dart:async';
import 'dart:typed_data';
-import 'package:dartssh2/src/socket/ssh_socket.dart';
-import 'package:dartssh2/src/ssh_channel.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/ssh_channel.dart';
class SSHForwardChannel implements SSHSocket {
final SSHChannel _channel;
diff --git a/lib/src/ssh_hostkey.dart b/lib/src/ssh_hostkey.dart
index 81fa4d2..609fdb9 100644
--- a/lib/src/ssh_hostkey.dart
+++ b/lib/src/ssh_hostkey.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/ssh_message.dart';
abstract class SSHHostKey {
/// Encode the host key to SSH encoded data.
diff --git a/lib/src/ssh_kex_utils.dart b/lib/src/ssh_kex_utils.dart
index 1ab3fca..1cc8ac3 100644
--- a/lib/src/ssh_kex_utils.dart
+++ b/lib/src/ssh_kex_utils.dart
@@ -1,8 +1,8 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/kex/kex_dh.dart';
-import 'package:dartssh2/src/ssh_algorithm.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/kex/kex_dh.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_message.dart';
import 'package:pointycastle/export.dart';
abstract class SSHKexUtils {
diff --git a/lib/src/ssh_key_pair.dart b/lib/src/ssh_key_pair.dart
index cbfae46..6496370 100644
--- a/lib/src/ssh_key_pair.dart
+++ b/lib/src/ssh_key_pair.dart
@@ -4,15 +4,15 @@ import 'dart:typed_data';
import 'package:asn1lib/asn1lib.dart';
import 'package:convert/convert.dart';
-import 'package:dartssh2/dartssh2.dart';
-import 'package:dartssh2/src/hostkey/hostkey_ecdsa.dart';
-import 'package:dartssh2/src/hostkey/hostkey_ed25519.dart';
-import 'package:dartssh2/src/hostkey/hostkey_rsa.dart';
-import 'package:dartssh2/src/ssh_hostkey.dart';
-import 'package:dartssh2/src/ssh_message.dart';
-import 'package:dartssh2/src/utils/bcrypt.dart';
-import 'package:dartssh2/src/utils/cipher_ext.dart';
-import 'package:dartssh2/src/utils/list.dart';
+import 'package:dartssh3/dartssh3.dart';
+import 'package:dartssh3/src/hostkey/hostkey_ecdsa.dart';
+import 'package:dartssh3/src/hostkey/hostkey_ed25519.dart';
+import 'package:dartssh3/src/hostkey/hostkey_rsa.dart';
+import 'package:dartssh3/src/ssh_hostkey.dart';
+import 'package:dartssh3/src/ssh_message.dart';
+import 'package:dartssh3/src/utils/bcrypt.dart';
+import 'package:dartssh3/src/utils/cipher_ext.dart';
+import 'package:dartssh3/src/utils/list.dart';
import 'package:pinenacl/ed25519.dart' as ed25519;
import 'package:pointycastle/export.dart';
@@ -663,15 +663,15 @@ class RsaPrivateKey implements SSHKeyPair {
final coefficient = (sequence.elements[8] as ASN1Integer).valueAsBigInteger;
return RsaPrivateKey(
- version!,
- n!,
- e!,
- d!,
- p!,
- q!,
- exponent1!,
- exponent2!,
- coefficient!,
+ version,
+ n,
+ e,
+ d,
+ p,
+ q,
+ exponent1,
+ exponent2,
+ coefficient,
);
}
diff --git a/lib/src/ssh_message.dart b/lib/src/ssh_message.dart
index 10f9398..0a8c99b 100644
--- a/lib/src/ssh_message.dart
+++ b/lib/src/ssh_message.dart
@@ -1,9 +1,9 @@
import 'dart:convert';
import 'dart:typed_data';
-import 'package:dartssh2/src/utils/int.dart';
-import 'package:dartssh2/src/utils/bigint.dart';
-import 'package:dartssh2/src/utils/utf8.dart';
+import 'package:dartssh3/src/utils/int.dart';
+import 'package:dartssh3/src/utils/bigint.dart';
+import 'package:dartssh3/src/utils/utf8.dart';
abstract class SSHMessage {
/// Encode the message to SSH encoded data.
diff --git a/lib/src/ssh_session.dart b/lib/src/ssh_session.dart
index f22d2bc..54d7176 100644
--- a/lib/src/ssh_session.dart
+++ b/lib/src/ssh_session.dart
@@ -1,9 +1,9 @@
import 'dart:async';
import 'dart:typed_data';
-import 'package:dartssh2/src/ssh_channel.dart';
-import 'package:dartssh2/src/ssh_signal.dart';
-import 'package:dartssh2/src/message/msg_channel.dart';
+import 'package:dartssh3/src/ssh_channel.dart';
+import 'package:dartssh3/src/ssh_signal.dart';
+import 'package:dartssh3/src/message/msg_channel.dart';
/// A [SSHSession] represents a remote execution of a program.
class SSHSession {
diff --git a/lib/src/ssh_transport.dart b/lib/src/ssh_transport.dart
index 2abeb82..b178a96 100644
--- a/lib/src/ssh_transport.dart
+++ b/lib/src/ssh_transport.dart
@@ -3,32 +3,32 @@ import 'dart:convert';
import 'dart:math' show max;
import 'dart:typed_data';
-import 'package:dartssh2/src/algorithm/ssh_cipher_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_hostkey_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_kex_type.dart';
-import 'package:dartssh2/src/algorithm/ssh_mac_type.dart';
-import 'package:dartssh2/src/hostkey/hostkey_ecdsa.dart';
-import 'package:dartssh2/src/hostkey/hostkey_rsa.dart';
-import 'package:dartssh2/src/kex/kex_dh.dart';
-import 'package:dartssh2/src/kex/kex_nist.dart';
-import 'package:dartssh2/src/kex/kex_x25519.dart';
-import 'package:dartssh2/src/message/msg_userauth.dart';
-import 'package:dartssh2/src/socket/ssh_socket.dart';
-import 'package:dartssh2/src/ssh_algorithm.dart';
-import 'package:dartssh2/src/ssh_kex.dart';
-import 'package:dartssh2/src/utils/bigint.dart';
-import 'package:dartssh2/src/utils/cipher_ext.dart';
-import 'package:dartssh2/src/utils/chunk_buffer.dart';
-import 'package:dartssh2/src/ssh_errors.dart';
-import 'package:dartssh2/src/ssh_kex_utils.dart';
-import 'package:dartssh2/src/ssh_packet.dart';
-import 'package:dartssh2/src/utils/int.dart';
-import 'package:dartssh2/src/hostkey/hostkey_ed25519.dart';
-import 'package:dartssh2/src/utils/list.dart';
-import 'package:dartssh2/src/message/msg_kex.dart';
-import 'package:dartssh2/src/message/msg_kex_dh.dart';
-import 'package:dartssh2/src/message/msg_kex_ecdh.dart';
-import 'package:dartssh2/src/ssh_message.dart';
+import 'package:dartssh3/src/algorithm/ssh_cipher_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_hostkey_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_kex_type.dart';
+import 'package:dartssh3/src/algorithm/ssh_mac_type.dart';
+import 'package:dartssh3/src/hostkey/hostkey_ecdsa.dart';
+import 'package:dartssh3/src/hostkey/hostkey_rsa.dart';
+import 'package:dartssh3/src/kex/kex_dh.dart';
+import 'package:dartssh3/src/kex/kex_nist.dart';
+import 'package:dartssh3/src/kex/kex_x25519.dart';
+import 'package:dartssh3/src/message/msg_userauth.dart';
+import 'package:dartssh3/src/socket/ssh_socket.dart';
+import 'package:dartssh3/src/ssh_algorithm.dart';
+import 'package:dartssh3/src/ssh_kex.dart';
+import 'package:dartssh3/src/utils/bigint.dart';
+import 'package:dartssh3/src/utils/cipher_ext.dart';
+import 'package:dartssh3/src/utils/chunk_buffer.dart';
+import 'package:dartssh3/src/ssh_errors.dart';
+import 'package:dartssh3/src/ssh_kex_utils.dart';
+import 'package:dartssh3/src/ssh_packet.dart';
+import 'package:dartssh3/src/utils/int.dart';
+import 'package:dartssh3/src/hostkey/hostkey_ed25519.dart';
+import 'package:dartssh3/src/utils/list.dart';
+import 'package:dartssh3/src/message/msg_kex.dart';
+import 'package:dartssh3/src/message/msg_kex_dh.dart';
+import 'package:dartssh3/src/message/msg_kex_ecdh.dart';
+import 'package:dartssh3/src/ssh_message.dart';
import 'package:pointycastle/export.dart';
typedef SSHPrintHandler = void Function(String?);
diff --git a/pubspec.yaml b/pubspec.yaml
index c334f40..1efc40a 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
-name: dartssh2
-version: 2.9.1-pre
+name: dartssh3
+version: 3.0.0
description: SSH and SFTP client written in pure Dart, aiming to be feature-rich as well as easy to use.
-homepage: https://github.com/TerminalStudio/dartssh2
+homepage: https://github.com/obemu/dartssh3
environment:
sdk: ">=2.17.0 <4.0.0"
@@ -11,7 +11,7 @@ dependencies:
convert: ^3.0.0
meta: ^1.1.6
pointycastle: ^3.0.0
- pinenacl: ^0.5.0
+ pinenacl: ">=0.5.0 <1.0.0"
dev_dependencies:
build_runner: ^2.1.1
diff --git a/test/src/algorithm/ssh_cipher_type_test.dart b/test/src/algorithm/ssh_cipher_type_test.dart
index ab88e8c..2eea1e0 100644
--- a/test/src/algorithm/ssh_cipher_type_test.dart
+++ b/test/src/algorithm/ssh_cipher_type_test.dart
@@ -1,7 +1,7 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/algorithm/ssh_cipher_type.dart';
-import 'package:dartssh2/src/utils/cipher_ext.dart';
+import 'package:dartssh3/src/algorithm/ssh_cipher_type.dart';
+import 'package:dartssh3/src/utils/cipher_ext.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/kex/kex_dh_test.dart b/test/src/kex/kex_dh_test.dart
index 75dfded..145bd20 100644
--- a/test/src/kex/kex_dh_test.dart
+++ b/test/src/kex/kex_dh_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/kex/kex_dh.dart';
+import 'package:dartssh3/src/kex/kex_dh.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/kex/kex_nist_test.dart b/test/src/kex/kex_nist_test.dart
index 8125d37..7d3ea2c 100644
--- a/test/src/kex/kex_nist_test.dart
+++ b/test/src/kex/kex_nist_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/kex/kex_nist.dart';
+import 'package:dartssh3/src/kex/kex_nist.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/kex/kex_x25519_test.dart b/test/src/kex/kex_x25519_test.dart
index b4fbd03..556cfdc 100644
--- a/test/src/kex/kex_x25519_test.dart
+++ b/test/src/kex/kex_x25519_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/src/kex/kex_x25519.dart';
+import 'package:dartssh3/src/kex/kex_x25519.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/sftp/sftp_client_test.dart b/test/src/sftp/sftp_client_test.dart
index ea04faa..2ee1918 100644
--- a/test/src/sftp/sftp_client_test.dart
+++ b/test/src/sftp/sftp_client_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
import '../../test_utils.dart';
diff --git a/test/src/sftp/sftp_stream_io_test.dart b/test/src/sftp/sftp_stream_io_test.dart
index 04e1aaa..90d5a04 100644
--- a/test/src/sftp/sftp_stream_io_test.dart
+++ b/test/src/sftp/sftp_stream_io_test.dart
@@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:typed_data';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
import '../../test_utils.dart';
diff --git a/test/src/socket/ssh_socket_io_test.dart b/test/src/socket/ssh_socket_io_test.dart
index 15a8e5d..f636fa2 100644
--- a/test/src/socket/ssh_socket_io_test.dart
+++ b/test/src/socket/ssh_socket_io_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/ssh_client_test.dart b/test/src/ssh_client_test.dart
index 0e2c63b..8ba2145 100644
--- a/test/src/ssh_client_test.dart
+++ b/test/src/ssh_client_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
import '../test_utils.dart';
diff --git a/test/src/ssh_key_pair_test.dart b/test/src/ssh_key_pair_test.dart
index 7045819..2fa10fc 100644
--- a/test/src/ssh_key_pair_test.dart
+++ b/test/src/ssh_key_pair_test.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
import '../test_utils.dart';
diff --git a/test/src/ssh_pem_test.dart b/test/src/ssh_pem_test.dart
index 563afe9..041d8fc 100644
--- a/test/src/ssh_pem_test.dart
+++ b/test/src/ssh_pem_test.dart
@@ -1,4 +1,4 @@
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
import 'package:test/test.dart';
diff --git a/test/src/utils/bcrypt_test.dart b/test/src/utils/bcrypt_test.dart
index e9ec7ec..3409f24 100644
--- a/test/src/utils/bcrypt_test.dart
+++ b/test/src/utils/bcrypt_test.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/utils/bcrypt.dart';
+import 'package:dartssh3/src/utils/bcrypt.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/src/utils/stream_test.dart b/test/src/utils/stream_test.dart
index 0de8774..2765939 100644
--- a/test/src/utils/stream_test.dart
+++ b/test/src/utils/stream_test.dart
@@ -1,6 +1,6 @@
import 'dart:typed_data';
-import 'package:dartssh2/src/utils/stream.dart';
+import 'package:dartssh3/src/utils/stream.dart';
import 'package:test/test.dart';
void main() {
diff --git a/test/test_utils.dart b/test/test_utils.dart
index aa198df..82e3e67 100644
--- a/test/test_utils.dart
+++ b/test/test_utils.dart
@@ -1,6 +1,6 @@
import 'dart:io';
-import 'package:dartssh2/dartssh2.dart';
+import 'package:dartssh3/dartssh3.dart';
/// A honeypot that accepts all passwords and public-keys
Future getHoneypotClient() async {