-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* tests/client-server.scm ("userauth-public-key!, success"): Skip when libssh has version older than 0.8.3. ("userauth-public-key!, success (RSA)"): New test case.
- Loading branch information
1 parent
88f655e
commit e2ccb81
Showing
1 changed file
with
33 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
;;; client-server.scm -- Guile-SSH client is SUT. | ||
|
||
;; Copyright (C) 2014, 2015, 2016 Artyom V. Poptsov <[email protected]> | ||
;; Copyright (C) 2014, 2015, 2016, 2024 Artyom V. Poptsov <[email protected]> | ||
;; | ||
;; This file is a part of Guile-SSH. | ||
;; | ||
|
@@ -34,6 +34,7 @@ | |
(ssh channel) | ||
(ssh log) | ||
(ssh tunnel) | ||
(ssh version) | ||
(srfi srfi-4) | ||
(tests common)) | ||
|
||
|
@@ -396,6 +397,16 @@ | |
(userauth-public-key! session (public-key-from-file %rsakey-pub))))))) | ||
|
||
|
||
(let* ((version (get-libssh-version)) | ||
(version (map string->number (string-split version #\.)))) | ||
(when (and (zero? (car version)) | ||
(or (= (cadr version) 7) | ||
(and (= (cadr version) 8) | ||
(< (caddr version) 3)))) | ||
;; XXX: This test fails because of the problems with ECDSA public key | ||
;; authentication in libssh versions prior 0.8.3. | ||
(test-skip "userauth-public-key!, success"))) | ||
|
||
(test-equal-with-log "userauth-public-key!, success" | ||
'success | ||
(run-client-test | ||
|
@@ -417,6 +428,27 @@ | |
(let ((prvkey (private-key-from-file %ecdsakey))) | ||
(userauth-public-key! session prvkey))))))) | ||
|
||
(test-equal-with-log "userauth-public-key!, success (RSA)" | ||
'success | ||
(run-client-test | ||
|
||
;; server | ||
(lambda (server) | ||
(server-listen server) | ||
(let ((session (server-accept server))) | ||
(server-handle-key-exchange session) | ||
(start-session-loop session | ||
(lambda (msg) | ||
(message-reply-success msg))))) | ||
|
||
;; client | ||
(lambda () | ||
(call-with-connected-session | ||
(lambda (session) | ||
(authenticate-server session) | ||
(let ((prvkey (private-key-from-file %rsakey))) | ||
(userauth-public-key! session prvkey))))))) | ||
|
||
|
||
;;; 'userauth-public-key/auto!' | ||
|
||
|