forked from wolfSSL/wolfssh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCP on the server side would get an EAGAIN around the 128KB mark, which would trigger an error. That error in-turn would cause two attempts to close the file, which would segfault. Also fix inverted error return status on scpclient.
- Loading branch information
Showing
9 changed files
with
98 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
# sshd local test | ||
|
||
PWD=`pwd` | ||
cd ../../.. | ||
|
||
TEST_SCP_CLIENT="./examples/scpclient/wolfscp" | ||
USER=`whoami` | ||
PRIVATE_KEY="./keys/hansel-key-ecc.der" | ||
PUBLIC_KEY="./keys/hansel-key-ecc.pub" | ||
|
||
if [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "expecting host and port as arguments" | ||
echo "./sshd_exec_test.sh 127.0.0.1 22222" | ||
exit 1 | ||
fi | ||
|
||
mkdir test-$$ | ||
|
||
OUTDIR="`pwd`/test-$$" | ||
|
||
dd if=/dev/random of=$OUTDIR/test.dat bs=1024 count=512 | ||
|
||
echo "$TEST_SCP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -S$OUTDIR/test.dat:. -H $1 -p $2" | ||
$TEST_SCP_CLIENT -u $USER -i $PRIVATE_KEY -j $PUBLIC_KEY -S$OUTDIR/test.dat:. -H $1 -p $2 | ||
|
||
RESULT=$? | ||
if [ "$RESULT" != "0" ]; then | ||
echo "Expecting to pass transfer" | ||
exit 1 | ||
fi | ||
|
||
MD5SOURCE=`md5sum $OUTDIR/test.dat | awk '{ print $1 }'` | ||
MD5DEST=`md5sum test.dat | awk '{ print $1 }'` | ||
|
||
if [ "$MD5SOURCE" != "$MD5DEST" ]; then | ||
echo "Files do not match $MD5SOURCE != $MD5DEST" | ||
exit 1 | ||
fi | ||
|
||
rm -rf test-$$ | ||
rm testout.dat | ||
|
||
cd $PWD | ||
exit 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ Certificate: | |
Version: 3 (0x2) | ||
Serial Number: 6 (0x6) | ||
Signature Algorithm: ecdsa-with-SHA256 | ||
Issuer: C = US, ST = Washington, L = Seattle, O = wolfSSL, OU = Development, CN = www.wolfssl.com, emailAddress = [email protected] | ||
Issuer: C=US, ST=Washington, L=Seattle, O=wolfSSL, OU=Development, CN=www.wolfssl.com, emailAddress=[email protected] | ||
Validity | ||
Not Before: Oct 1 05:54:44 2022 GMT | ||
Not After : Sep 28 05:54:44 2032 GMT | ||
Subject: C = US, ST = Washington, L = Seattle, O = wolfSSL, OU = Development, CN = www.wolfssl.com, emailAddress = [email protected] | ||
Not Before: Feb 19 10:16:58 2025 GMT | ||
Not After : Feb 17 10:16:58 2035 GMT | ||
Subject: C=US, ST=Washington, L=Seattle, O=wolfSSL, OU=Development, CN=www.wolfssl.com, emailAddress=[email protected] | ||
Subject Public Key Info: | ||
Public Key Algorithm: id-ecPublicKey | ||
Public-Key: (256 bit) | ||
|
@@ -26,22 +26,22 @@ Certificate: | |
keyid:56:8E:9A:C3:F0:42:DE:18:B9:45:55:6E:F9:93:CF:EA:C3:F3:A5:21 | ||
DirName:/C=US/ST=Washington/L=Seattle/O=wolfSSL/OU=Development/CN=www.wolfssl.com/[email protected] | ||
serial:06 | ||
|
||
X509v3 Basic Constraints: critical | ||
CA:TRUE | ||
X509v3 Key Usage: critical | ||
Digital Signature, Certificate Sign, CRL Sign | ||
Signature Algorithm: ecdsa-with-SHA256 | ||
30:45:02:20:18:bc:74:fd:d9:26:f2:f5:c2:f3:f5:cd:99:38: | ||
9d:85:7d:8b:67:c8:f5:51:4a:5a:88:b6:3f:61:38:6b:9f:11: | ||
02:21:00:f1:95:08:34:2b:47:32:93:8c:10:4b:4b:fd:6e:22: | ||
f2:48:3b:5d:8a:74:46:24:7d:30:eb:65:15:06:e4:38:e0 | ||
Signature Value: | ||
30:46:02:21:00:89:3c:83:7d:39:e1:f5:dd:48:f4:c0:f7:16: | ||
ba:64:28:8d:9c:1f:f2:96:97:48:c9:31:ca:75:c0:13:d4:3d: | ||
0c:02:21:00:f2:21:8a:3d:45:5d:cc:2a:22:11:e0:11:b3:54: | ||
3f:7f:99:ea:ab:85:28:31:7c:c2:3f:50:d8:42:f2:23:e6:d2 | ||
-----BEGIN CERTIFICATE----- | ||
MIIDJjCCAsygAwIBAgIBBjAKBggqhkjOPQQDAjCBlTELMAkGA1UEBhMCVVMxEzAR | ||
MIIDJzCCAsygAwIBAgIBBjAKBggqhkjOPQQDAjCBlTELMAkGA1UEBhMCVVMxEzAR | ||
BgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAoMB3dv | ||
bGZTU0wxFDASBgNVBAsMC0RldmVsb3BtZW50MRgwFgYDVQQDDA93d3cud29sZnNz | ||
bC5jb20xHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tMB4XDTIyMTAwMTA1 | ||
NTQ0NFoXDTMyMDkyODA1NTQ0NFowgZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApX | ||
bC5jb20xHTAbBgkqhkiG9w0BCQEWDmNhQGV4YW1wbGUuY29tMB4XDTI1MDIxOTEw | ||
MTY1OFoXDTM1MDIxNzEwMTY1OFowgZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApX | ||
YXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMRAwDgYDVQQKDAd3b2xmU1NMMRQw | ||
EgYDVQQLDAtEZXZlbG9wbWVudDEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR0w | ||
GwYJKoZIhvcNAQkBFg5jYUBleGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49 | ||
|
@@ -52,6 +52,6 @@ pSGhgZukgZgwgZUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApXYXNoaW5ndG9uMRAw | |
DgYDVQQHDAdTZWF0dGxlMRAwDgYDVQQKDAd3b2xmU1NMMRQwEgYDVQQLDAtEZXZl | ||
bG9wbWVudDEYMBYGA1UEAwwPd3d3LndvbGZzc2wuY29tMR0wGwYJKoZIhvcNAQkB | ||
Fg5jYUBleGFtcGxlLmNvbYIBBjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE | ||
AwIBhjAKBggqhkjOPQQDAgNIADBFAiAYvHT92Sby9cLz9c2ZOJ2FfYtnyPVRSlqI | ||
tj9hOGufEQIhAPGVCDQrRzKTjBBLS/1uIvJIO12KdEYkfTDrZRUG5Djg | ||
AwIBhjAKBggqhkjOPQQDAgNJADBGAiEAiTyDfTnh9d1I9MD3FrpkKI2cH/KWl0jJ | ||
Mcp1wBPUPQwCIQDyIYo9RV3MKiIR4BGzVD9/meqrhSgxfMI/UNhC8iPm0g== | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ Certificate: | |
Version: 3 (0x2) | ||
Serial Number: 8 (0x8) | ||
Signature Algorithm: ecdsa-with-SHA256 | ||
Issuer: C = US, ST = Washington, L = Seattle, O = wolfSSL, OU = Development, CN = www.wolfssl.com, emailAddress = [email protected] | ||
Issuer: C=US, ST=Washington, L=Seattle, O=wolfSSL, OU=Development, CN=www.wolfssl.com, emailAddress=[email protected] | ||
Validity | ||
Not Before: Oct 1 05:54:44 2022 GMT | ||
Not After : Sep 28 05:54:44 2032 GMT | ||
Subject: C = US, ST = Washington, L = Seattle, O = Eliptic, OU = ECC, CN = www.wolfssl.com, emailAddress = [email protected] | ||
Not Before: Feb 19 10:16:59 2025 GMT | ||
Not After : Feb 17 10:16:59 2035 GMT | ||
Subject: C=US, ST=Washington, L=Seattle, O=Eliptic, OU=ECC, CN=www.wolfssl.com, emailAddress=[email protected] | ||
Subject Public Key Info: | ||
Public Key Algorithm: id-ecPublicKey | ||
Public-Key: (256 bit) | ||
|
@@ -26,20 +26,20 @@ Certificate: | |
keyid:56:8E:9A:C3:F0:42:DE:18:B9:45:55:6E:F9:93:CF:EA:C3:F3:A5:21 | ||
DirName:/C=US/ST=Washington/L=Seattle/O=wolfSSL/OU=Development/CN=www.wolfssl.com/[email protected] | ||
serial:06 | ||
|
||
X509v3 Subject Alternative Name: | ||
DNS:example, IP Address:127.0.0.1 | ||
Signature Algorithm: ecdsa-with-SHA256 | ||
30:45:02:20:42:d8:a0:95:e7:aa:4e:63:fd:50:6e:6b:f9:98: | ||
90:be:3d:44:53:68:1b:66:dd:22:a3:12:77:70:94:56:db:82: | ||
02:21:00:ce:18:b2:10:b2:2d:2a:b9:79:d4:76:64:df:28:91: | ||
23:8d:93:22:e9:4b:ea:7f:49:4e:eb:65:ce:c8:86:ba:fb | ||
Signature Value: | ||
30:44:02:20:75:7f:24:0a:80:3c:90:38:3a:a1:16:86:ba:44: | ||
43:0a:75:34:52:a0:d0:2e:29:b1:a1:92:e3:85:d2:b4:24:be: | ||
02:20:63:d5:b8:eb:3c:cf:19:3e:60:78:7b:01:f1:e4:94:d6: | ||
fd:3a:73:f1:05:a1:74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hbXBsZYcEfwAAATAKBggqhkjO | ||
PQQDAgNIADBFAiBC2KCV56pOY/1Qbmv5mJC+PURTaBtm3SKjEndwlFbbggIhAM4Y | ||
shCyLSq5edR2ZN8okSONkyLpS+p/SU7rZc7Ihrr7 | ||
PQQDAgNHADBEAiB1fyQKgDyQODqhFoa6REMKdTRSoNAuKbGhkuOF0rQkvgIgY9W4 | ||
6zzPGT5geHsB8eSU1v06c/EFoXQH/ctVWfwsGXI= | ||
-----END CERTIFICATE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters