Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package guile-ssh for openSUSE:Factory checked in at 2023-06-26 18:16:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/guile-ssh (Old) and /work/SRC/openSUSE:Factory/.guile-ssh.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "guile-ssh" Mon Jun 26 18:16:00 2023 rev:7 rq:1095260 version:0.16.3 Changes: -------- --- /work/SRC/openSUSE:Factory/guile-ssh/guile-ssh.changes 2022-10-08 01:26:25.198394099 +0200 +++ /work/SRC/openSUSE:Factory/.guile-ssh.new.15902/guile-ssh.changes 2023-06-26 18:16:10.350491325 +0200 @@ -1,0 +2,10 @@ +Sun Jun 18 20:43:12 UTC 2023 - Jonathan Brielmaier <[email protected]> + +- Update to 0.16.3: + * Fix Guile-SSH/libssh channel leak + * Bugfix in test "string->public-key, ECDSA" + * Disable the tests that require DSA algorithm by default + * Add '--enable-dsa' Autoconf option + * (ssh version): 'dsa-support?': New procedure + +------------------------------------------------------------------- Old: ---- v0.16.0.tar.gz New: ---- v0.16.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ guile-ssh.spec ++++++ --- /var/tmp/diff_new_pack.5oJbdT/_old 2023-06-26 18:16:14.698510642 +0200 +++ /var/tmp/diff_new_pack.5oJbdT/_new 2023-06-26 18:16:14.702510660 +0200 @@ -1,7 +1,7 @@ # # spec file for package guile-ssh # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define libsoname lib%{name}14 Name: guile-ssh -Version: 0.16.0 +Version: 0.16.3 Release: 0 Summary: SSH protocol access from Guile License: GPL-3.0-or-later ++++++ v0.16.0.tar.gz -> v0.16.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/AUTHORS new/guile-ssh-0.16.3/AUTHORS --- old/guile-ssh-0.16.0/AUTHORS 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/AUTHORS 2023-01-29 18:08:45.000000000 +0100 @@ -85,3 +85,5 @@ Makefile.am common.scm sssh-ssshd.scm +* Andrew Tropin <[email protected]> + Bug reports. \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/NEWS new/guile-ssh-0.16.3/NEWS --- old/guile-ssh-0.16.0/NEWS 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/NEWS 2023-01-29 18:08:45.000000000 +0100 @@ -7,6 +7,47 @@ are permitted in any medium without royalty provided the copyright notice and this notice are preserved. +* Changes in version 0.16.3 (2023-01-29) +** Fix Guile-SSH/libssh channel leak +Guile-SSH channel would always "leak" the libssh channels when the remote side +issued the closing request. Now this bug is fixed by freeing libssh channel +when the remote side is closed. + +Reported by Andrew Tropin <[email protected]> in +<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58290> + +The test for reproducing the problem was provided by Ludovic Courtès +<[email protected]>. + +* Changes in version 0.16.2 (2023-01-02) +** Bugfix in test "string->public-key, ECDSA" +The test used to explicitly compare libssh version with "9" so it would always +fail on platforms with libssh 0.10. Now the test does numerical comparison +and uses "ecdsa-p256" on platforms that have libssh 0.9 or later version. + +Reported by Vagrant Cascadian, here: +<https://github.com/artyom-poptsov/guile-ssh/issues/34> + +* Changes in version 0.16.1 (2022-12-31) +** Disable the tests that require DSA algorithm by default +When DSA support is disabled in libssh (which is the default state since +libssh 0.10) all DSA-related Guile-SSH procedures will fail. Now Guile-SSH +disables by default all the tests that are require the DSA algorithm support +by default. + +Although those changes do not affect the Guile-SSH API directly, users should +be aware that DSA support will be removed altogether in the next major libssh +release. + +Reported by Vagrant Cascadian, here: +<https://github.com/artyom-poptsov/guile-ssh/issues/34> +** Add '--enable-dsa' Autoconf option +'configure.ac' now has '--enable-dsa' option that allows to enable DSA public +key algorithm support in Guile-SSH. +** (ssh version): 'dsa-support?': New procedure +** guix.scm: Use libssh 0.10.0 +The development GNU Guix environment now uses libssh 0.10.0. + * Changes in version 0.16.0 (2022-09-13) ** Fix Guile snarfer environment Fix a bug introduced in Guile-SSH 0.15.0 that breaks the cross-compilation. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/README new/guile-ssh-0.16.3/README --- old/guile-ssh-0.16.0/README 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/README 2023-01-29 18:08:45.000000000 +0100 @@ -17,7 +17,8 @@ - Several authentication methods are supported, including password authentication, public key and SSH agent authentication methods. - Key management procedures: you can make key pairs, read keys from files, - get key hashes, get public keys from private keys etc. DSS, RSA, RSA1 and + get key hashes, get public keys from private keys etc. DSS (only when + =--enable-dsa= option is passed to the =configure= script), RSA, RSA1 and ECDSA (by means of OpenSSL) are supported. - Port forwarding procedures and high-level API for creating of SSH tunnels. - Distributed forms (=dist-map=, =distribute=, ...) that allow to spread the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/THANKS new/guile-ssh-0.16.3/THANKS --- old/guile-ssh-0.16.0/THANKS 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/THANKS 2023-01-29 18:08:45.000000000 +0100 @@ -9,6 +9,7 @@ through bug reports or patches: * Aleix Conchillo Flaqué <[email protected]> +* Andrew Tropin <[email protected]> * David Kastrup <[email protected]> * David Thompson <[email protected]> * Ludovic Courtès <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/build-aux/compile new/guile-ssh-0.16.3/build-aux/compile --- old/guile-ssh-0.16.0/build-aux/compile 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/build-aux/compile 2023-01-29 18:08:45.000000000 +0100 @@ -1,9 +1,9 @@ -#! /bin/sh +#!/bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey <[email protected]>. # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/configure.ac new/guile-ssh-0.16.3/configure.ac --- old/guile-ssh-0.16.0/configure.ac 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/configure.ac 2023-01-29 18:08:45.000000000 +0100 @@ -3,7 +3,7 @@ dnl define(GUILE_SSH_CONFIGURE_COPYRIGHT, [[ -Copyright (C) 2013-2022 Artyom V. Poptsov <[email protected]> +Copyright (C) 2013-2023 Artyom V. Poptsov <[email protected]> This file is part of Guile-SSH. @@ -21,13 +21,13 @@ along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>. ]]) -AC_INIT([Guile-SSH], [0.16.0], [[email protected]], +AC_INIT([Guile-SSH], [0.16.3], [[email protected]], [guile-ssh], [https://github.com/artyom-poptsov/guile-ssh]) AC_COPYRIGHT(GUILE_SSH_CONFIGURE_COPYRIGHT) -LIBGUILE_SSH_INTERFACE="15:0:1" +LIBGUILE_SSH_INTERFACE="15:3:1" AC_SUBST(LIBGUILE_SSH_INTERFACE) AC_CONFIG_AUX_DIR([build-aux]) @@ -57,6 +57,19 @@ esac], [guilesitedir=""]) +AC_ARG_ENABLE([dsa], + [AS_HELP_STRING([--enable-dsa], + [Enable DSA support.])]) + +AS_IF([test "x$enable_dsa" = "xyes"], + [ + AC_DEFINE(ENABLE_DSA, 1, [Enable DSA support.]) + ], + [ + AC_DEFINE(ENABLE_DSA, 0, [Disable DSA support.]) + ]) +AM_CONDITIONAL(ENABLE_DSA, $ENABLE_DSA) + # ------------------------------------------------------------------------------- # Check for needed libraries # ------------------------------------------------------------------------------- @@ -95,6 +108,13 @@ AM_CONDITIONAL(HAVE_LIBSSH_0_9, $HAVE_LIBSSH_0_9) +PKG_CHECK_MODULES([LIBSSH_0_10], + [libssh >= 0.10.0], + [AC_DEFINE(HAVE_LIBSSH_0_10, 1, [Use libssh 0.10])], + [AC_DEFINE(HAVE_LIBSSH_0_10, 0, [Use libssh < 0.10])]) + +AM_CONDITIONAL(HAVE_LIBSSH_0_10, $HAVE_LIBSSH_0_10) + # ------------------------------------------------------------------------------- dnl These macros must be provided by guile.m4. @@ -153,3 +173,24 @@ [Otherwise, you will have to adjust the `GUILE_LOAD_PATH' environment] [variable.]) fi + + +AS_IF( + [test "x$enable_dsa" = "xyes"], + [ + AC_MSG_WARN( + [] + [Guile-SSH is configured with DSA public key algorithm support.] + [Note that DSA support is disabled by default in libssh 0.10.] + [<https://salsa.debian.org/debian/libssh/-/blob/debian/CHANGELOG#L37>] + [] + [If your version of libssh does not support DSA public key algorithm] + [it will lead to errors in Guile-SSH.] + ) + ], + [ + AC_MSG_NOTICE( + [Guile-SSH configured without DSA public key algorithm support.] + ) + ] +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/doc/api-version.texi new/guile-ssh-0.16.3/doc/api-version.texi --- old/guile-ssh-0.16.0/doc/api-version.texi 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/doc/api-version.texi 2023-01-29 18:08:45.000000000 +0100 @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This file is part of Guile-SSH Reference Manual. -@c Copyright (C) 2014 Artyom V. Poptsov +@c Copyright (C) 2014-2022 Artyom V. Poptsov @c See the file guile-ssh.texi for copying conditions. @node Version @@ -36,6 +36,11 @@ Return @code{#t} if libssh was compiled wit zlib support, @code{#f} otherwise. @end deffn +@deffn {Scheme Procedure} dsa-support? +Return @code{#t} if Guile-SSH was compiled with DSA public key algorithm +support, @code{#f} otherwise. +@end deffn + @deffn {Scheme Procedure} get-library-version Get version of the Guile-SSH. @end deffn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/guix.scm new/guile-ssh-0.16.3/guix.scm --- old/guile-ssh-0.16.0/guix.scm 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/guix.scm 2023-01-29 18:08:45.000000000 +0100 @@ -2,10 +2,15 @@ ((guix licenses) #:prefix license:) (guix packages) (guix git-download) + (guix download) + (guix utils) + (guix build-system cmake) (guix build-system gnu) (gnu packages autotools) (gnu packages guile) (gnu packages ssh) + (gnu packages compression) + (gnu packages kerberos) (gnu packages gnupg) (gnu packages texinfo) (gnu packages pkg-config) @@ -16,6 +21,35 @@ +(define-public libssh10 + (package + (name "libssh") + (version "0.10.0") + (source (origin + (method url-fetch) + (uri (string-append "https://www.libssh.org/files/" + (version-major+minor version) + "/libssh-" version ".tar.xz")) + (sha256 + (base32 + "0mqbmz97p6wcq3k3lllnw2khvr3db3n2va45nz88m0yd6k2mih8d")))) + (build-system cmake-build-system) + (outputs '("out" "debug")) + (arguments + '(#:configure-flags '("-DWITH_GCRYPT=ON") + + ;; TODO: Add 'CMockery' and '-DWITH_TESTING=ON' for the test suite. + #:tests? #f)) + (inputs (list zlib libgcrypt mit-krb5)) + (synopsis "SSH client library") + (description + "libssh is a C library implementing the SSHv2 and SSHv1 protocol for client +and server implementations. With libssh, you can remotely execute programs, +transfer files, and use a secure and transparent tunnel for your remote +applications.") + (home-page "https://www.libssh.org") + (license license:lgpl2.1+))) + (define-public guile-ssh (package (name "guile-ssh") @@ -75,7 +109,7 @@ pkg-config which guile-3.0)) ;needed when cross-compiling. - (inputs (list guile-3.0 libssh libgcrypt)) + (inputs (list guile-3.0 libssh10 libgcrypt)) (synopsis "Guile bindings to libssh") (description "Guile-SSH is a library that provides access to the SSH protocol for diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/libguile-ssh/channel-type.c new/guile-ssh-0.16.3/libguile-ssh/channel-type.c --- old/guile-ssh-0.16.0/libguile-ssh/channel-type.c 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/libguile-ssh/channel-type.c 2023-01-29 18:08:45.000000000 +0100 @@ -274,8 +274,11 @@ if (ch->is_remote_closed == 1) { _gssh_log_debug1 ("ptob_close", - "the channel is already freed" + "the channel is closed" " by the closing request from the remote side."); + _gssh_log_debug1 ("ptob_close", "Freeing the channel...") + ssh_channel_free (ch->ssh_channel); + _gssh_log_debug1 ("ptob_close", "Freeing the local channel... done"); } else if (sd && ssh_is_connected (sd->ssh_session)) { @@ -293,8 +296,10 @@ "the channel is already freed" " along with the parent session."); } + _gssh_log_debug1 ("ptob_close", "Freeing the channel callbacks..."); free (ch->callbacks); ch->callbacks = NULL; + _gssh_log_debug1 ("ptob_close", "Freeing the channel callbacks... done"); scm_gc_unprotect_object (ch->session); } else @@ -305,8 +310,10 @@ SCM_SETSTREAM (channel, NULL); #if USING_GUILE_BEFORE_2_2 + _gssh_log_debug1 ("ptob_close", "Freeing the channel buffers ..."); scm_gc_free (pt->write_buf, pt->write_buf_size, "port write buffer"); scm_gc_free (pt->read_buf, pt->read_buf_size, "port read buffer"); + _gssh_log_debug1 ("ptob_close", "Freeing the channel buffers ... done"); return 0; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/libguile-ssh/version.c new/guile-ssh-0.16.3/libguile-ssh/version.c --- old/guile-ssh-0.16.0/libguile-ssh/version.c 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/libguile-ssh/version.c 2023-01-29 18:08:45.000000000 +0100 @@ -1,6 +1,6 @@ /* version.c -- Get information about versions. * - * Copyright (C) 2013 Artyom V. Poptsov <[email protected]> + * Copyright (C) 2013-2022 Artyom V. Poptsov <[email protected]> * * This file is part of Guile-SSH. * @@ -23,6 +23,8 @@ #include <libguile.h> #include <libssh/libssh.h> +#include "config.h" + /* Get version of the libssh. */ SCM_DEFINE (guile_ssh_get_libssh_version, "%get-libssh-version", 0, 0, 0, (), @@ -43,6 +45,18 @@ } +SCM_DEFINE (gssh_dsa_supported_p, "dsa-support?", 0, 0, 0, + (), + "\ +Check if DSA keys are enabled.\ +") +#define FUNC_NAME s_gssh_dsa_supported_p +{ + return scm_from_bool (ENABLE_DSA); +} +#undef FUNC_NAME + + void init_version (void) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/modules/ssh/version.scm new/guile-ssh-0.16.3/modules/ssh/version.scm --- old/guile-ssh-0.16.0/modules/ssh/version.scm 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/modules/ssh/version.scm 2023-01-29 18:08:45.000000000 +0100 @@ -1,6 +1,6 @@ ;;; version.scm -- Get information about versions. -;; Copyright (C) 2013 Artyom V. Poptsov <[email protected]> +;; Copyright (C) 2013-2022 Artyom V. Poptsov <[email protected]> ;; ;; This file is a part of Guile-SSH. ;; @@ -47,6 +47,7 @@ get-library-version get-crypto-library zlib-support? + dsa-support? ;; Low-level procedures %get-libssh-version)) @@ -68,4 +69,4 @@ (and (not (null? (cddr version))) (string=? "zlib" (caddr version))))) -;;; session.scm ends here +;;; version.scm ends here diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/tests/Makefile.am new/guile-ssh-0.16.3/tests/Makefile.am --- old/guile-ssh-0.16.0/tests/Makefile.am 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/tests/Makefile.am 2023-01-29 18:08:45.000000000 +0100 @@ -23,6 +23,7 @@ SCM_TESTS = \ log.scm \ + version.scm \ server.scm \ session.scm \ client-server.scm \ @@ -108,7 +109,8 @@ tunnel \ server \ shell \ - sssh-ssshd + sssh-ssshd \ + version clean-local: -rm -rf $(LOG_DIRS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/tests/key.scm new/guile-ssh-0.16.3/tests/key.scm --- old/guile-ssh-0.16.0/tests/key.scm 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/tests/key.scm 2023-01-29 18:08:45.000000000 +0100 @@ -1,6 +1,6 @@ ;;; key.scm -- Testing of Guile-SSH keys -;; Copyright (C) 2014, 2015 Artyom V. Poptsov <[email protected]> +;; Copyright (C) 2014-2022 Artyom V. Poptsov <[email protected]> ;; ;; This file is a part of Guile-SSH. ;; @@ -33,77 +33,138 @@ (or (not %openssl?) test)) +(define-syntax-rule (unless-openssl expr) + (or %openssl? + expr)) + +(define-syntax-rule (unless-dsa-supported expr) + (unless (dsa-support?) + expr)) + (test-begin-with-log "key") -(test-assert-with-log "private-key-from-file" - (and (private-key-from-file %rsakey) - (private-key-from-file %dsakey) - (when-openssl - (private-key-from-file %ecdsakey)))) - -(test-assert-with-log "public-key-from-file" - (and (public-key-from-file %rsakey-pub) - (public-key-from-file %dsakey-pub) - (when-openssl - (public-key-from-file %ecdsakey-pub)))) - -(define *rsa-key* (private-key-from-file %rsakey)) -(define *dsa-key* (private-key-from-file %dsakey)) -(define *ecdsa-key* (when-openssl - (private-key-from-file %ecdsakey))) +(test-assert-with-log "public-key-from-file: RSA" + (public-key-from-file %rsakey-pub)) + +(unless-dsa-supported + (test-skip "public-key-from-file: DSA")) +(test-assert-with-log "public-key-from-file: DSA" + (public-key-from-file %dsakey-pub)) + +(unless-openssl + (test-skip "public-key-from-file: ECDSA")) +(test-assert-with-log "public-key-from-file: ECDSA" + (public-key-from-file %ecdsakey-pub)) + +(test-assert "private-key-from-file: RSA" + (private-key-from-file %rsakey)) + +(unless-dsa-supported + (test-skip "private-key-from-file: DSA")) +(test-assert "private-key-from-file: DSA" + (private-key-from-file %dsakey)) + +(unless-openssl + (test-skip "private-key-from-file: ECDSA")) +(test-assert "private-key-from-file: ECDSA" + (private-key-from-file %ecdsakey)) + (define *rsa-pub-key* (public-key-from-file %rsakey-pub)) (define *dsa-pub-key* (public-key-from-file %dsakey-pub)) (define *ecdsa-pub-key* (when-openssl (public-key-from-file %ecdsakey-pub))) -(test-assert "key?" - (and (not (key? "not a key")) - (key? *rsa-key*) - (key? *dsa-key*) - (when-openssl - (key? *ecdsa-key*)) - (key? *rsa-pub-key*) - (key? *dsa-pub-key*) - (when-openssl - (key? *ecdsa-pub-key*)))) - -(test-assert "private-key?" - (and (private-key? *rsa-key*) - (not (private-key? *rsa-pub-key*)) - (not (private-key? "not a key")))) - -(test-assert-with-log "public-key?" - (and (public-key? *rsa-pub-key*) - - ;; XXX: Currently a SSH key that has been read from a file - ;; has both public and private flags. - (public-key? *rsa-key*) - - (not (public-key? "not a key")))) - -(test-assert-with-log "private-key->public-key" - (and (private-key->public-key *rsa-key*) - (private-key->public-key *dsa-key*) - (when-openssl - (private-key->public-key *ecdsa-key*)))) - -(test-assert-with-log "get-key-type" - (and (eq? 'rsa (get-key-type *rsa-key*)) - (eq? 'dss (get-key-type *dsa-key*)) ;)) - (when-openssl - (or (eq? 'ecdsa-p256 (get-key-type *ecdsa-key*)) - ;; For libssh versions prior to 0.9 - (eq? 'ecdsa (get-key-type *ecdsa-key*)))))) +(test-equal "key?: not a key" + #f + (key? "not a key")) + +(test-assert "key?: RSA" + (key? (private-key-from-file %rsakey))) + +(unless-dsa-supported + (test-skip "key?: DSA")) +(test-assert "key?: DSA" + (key? (private-key-from-file %dsakey))) + +(unless-openssl + (test-skip "key?: ECDSA")) +(test-assert "key?: ECDSA" + (key? (private-key-from-file %ecdsakey))) + +(test-assert "key?: RSA (public)" + (key? *rsa-pub-key*)) + +(unless-dsa-supported + (test-skip "key?: DSA (public)")) +(test-assert "key?: DSA (public)" + (key? *dsa-pub-key*)) + +(unless-openssl + (test-skip "key?: ECDSA (public)")) +(test-assert "key?: ECDSA (public)" + (key? *ecdsa-pub-key*)) + +(test-assert "private-key?: RSA" + (private-key? (private-key-from-file %rsakey))) + +(test-equal "private-key?: RSA (public)" + #f + (private-key? *rsa-pub-key*)) + +(test-equal "private-key?: not a key" + #f + (private-key? "not a key")) + +(test-assert "public-key?: RSA (public)" + (public-key? *rsa-pub-key*)) + +(test-assert "public-key?: RSA" + (public-key? (private-key-from-file %rsakey))) + +(test-equal "public-key?: not a key" + #f + (public-key? "not a key")) + +(test-assert-with-log "private-key->public-key: RSA" + (private-key->public-key (private-key-from-file %rsakey))) + +(unless-dsa-supported + (test-skip "private-key->public-key: DSA")) +(test-assert-with-log "private-key->public-key: DSA" + (private-key->public-key (private-key-from-file %dsakey))) + +(unless-openssl + (test-skip "private-key->public-key: ECDSA")) +(test-assert-with-log "private-key->public-key: ECDSA" + (private-key->public-key (private-key-from-file %ecdsakey))) + + +(test-assert-with-log "get-key-type: RSA" + (equal? (eq? 'rsa (get-key-type (private-key-from-file %rsakey))))) + +(unless-dsa-supported + (test-skip "get-key-type: DSA")) +(test-assert-with-log "get-key-type: DSA" + (equal? (eq? 'rsa (get-key-type (private-key-from-file %dsakey))))) + +(unless-openssl + (test-skip "get-key-type: ECDSA")) +(test-assert-with-log "get-key-type: ECDSA" + (let ((key (private-key-from-file %ecdsakey))) + (or (eq? 'ecdsa-p256 (get-key-type key)) + ;; For libssh versions prior to 0.9 + (eq? 'ecdsa (get-key-type key))))) +(unless-openssl + (test-skip "private-key-to-file")) (test-assert-with-log "private-key-to-file" - (when-openssl - (let ((file-name "./tmp-rsa-key")) - (private-key-to-file *rsa-key* file-name) - (let ((key (private-key-from-file file-name))) - (delete-file file-name) - (and (key? key) - (private-key? key)))))) + (let ((file-name "./tmp-rsa-key")) + (private-key-to-file (private-key-from-file %rsakey) file-name) + (let ((key (private-key-from-file file-name))) + (delete-file file-name) + (and (key? key) + (private-key? key))))) ;;; Converting between strings and keys @@ -120,6 +181,8 @@ (public-key->string *rsa-pub-key*) %rsakey-pub-string) +(unless-dsa-supported + (test-skip "public-key->string, DSA")) (test-equal "public-key->string, DSA" (public-key->string *dsa-pub-key*) %dsakey-pub-string) @@ -134,16 +197,19 @@ (public-key->string (string->public-key %rsakey-pub-string 'rsa)) %rsakey-pub-string) +(unless-dsa-supported + (test-skip "string->public-key, DSA")) (test-equal "string->public-key, DSA" (public-key->string (string->public-key %dsakey-pub-string 'dss)) %dsakey-pub-string) -(when-openssl - (test-equal "string->public-key, ECDSA" - (if (string=? (cadr (string-split (get-libssh-version) #\.)) "9") - (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa-p256)) - (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa))) - %ecdsakey-pub-string)) +(unless-openssl + (test-skip "string->public-key, ECDSA")) +(test-equal "string->public-key, ECDSA" + (if (>= (string->number (cadr (string-split (get-libssh-version) #\.))) 9) + (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa-p256)) + (public-key->string (string->public-key %ecdsakey-pub-string 'ecdsa))) + %ecdsakey-pub-string) (test-assert-with-log "string->public-key, RSA, gc test" (let ((max-keys 1000)) @@ -156,18 +222,25 @@ #t)) -(test-assert-with-log "make-keypair" - (and (let ((key (make-keypair 'rsa 1024))) - (and (key? key) - (eq? (get-key-type key) 'rsa))) - (let ((key (make-keypair 'dss 1024))) - (and (key? key) - (eq? (get-key-type key) 'dss))) - (when-openssl - (let ((key (make-keypair 'ecdsa 256))) - (and (key? key) - (or (eq? (get-key-type key) 'ecdsa) ; libssh < 0.9 - (eq? (get-key-type key) 'ecdsa-p256))))))) +(test-assert-with-log "make-keypair: RSA" + (let ((key (make-keypair 'rsa 1024))) + (and (key? key) + (eq? (get-key-type key) 'rsa)))) + +(unless-dsa-supported + (test-skip "make-keypair: DSS")) +(test-assert-with-log "make-keypair: DSS" + (let ((key (make-keypair 'dss 1024))) + (and (key? key) + (eq? (get-key-type key) 'dss)))) + +(unless-openssl + (test-skip "make-keypair: ECDSA")) +(test-assert-with-log "make-keypair: ECDSA" + (let ((key (make-keypair 'ecdsa 256))) + (and (key? key) + (or (eq? (get-key-type key) 'ecdsa) ; libssh < 0.9 + (eq? (get-key-type key) 'ecdsa-p256))))) ;;; (define exit-status (test-runner-fail-count (test-runner-current))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/tests/manual/channel-leak.scm new/guile-ssh-0.16.3/tests/manual/channel-leak.scm --- old/guile-ssh-0.16.0/tests/manual/channel-leak.scm 1970-01-01 01:00:00.000000000 +0100 +++ new/guile-ssh-0.16.3/tests/manual/channel-leak.scm 2023-01-29 18:08:45.000000000 +0100 @@ -0,0 +1,36 @@ +;;; channel-leak.scm -- Check if libssh channels are not freed corretly. +;; +;; This test checks if the channel are properly freed; otherwise the OpenSSH +;; server will report "no more sessions" error when the maximum number of +;; sessions per a TCP connection (as specified by "MaxSessions" option) is +;; exhausted. +;; +;; Reported by Andrew Tropin <[email protected]> in +;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58290> +;; +;; The test for reproducing the problem was provided by Ludovic Courtès +;; <[email protected]>. This file contains its code with slight changes. + +(use-modules (ssh session) + (ssh popen) + (ssh auth) + (ssh log) + (rnrs io ports)) + +(define session + (make-session #:host "localhost")) + +(define (main args) + (session-parse-config! session) + (connect! session) + (userauth-public-key/auto! session) + (set-log-verbosity! 'functions) + + (let loop ((i 0)) + (format (current-error-port) "-- ~a --~%" i) + (let ((pipe (open-remote-pipe session "date" "r"))) + (pk 'x (get-string-all pipe)) + (close-port pipe) + (loop (+ 1 i))))) + +;;; channel-leak.scm ends here. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/tests/server.scm new/guile-ssh-0.16.3/tests/server.scm --- old/guile-ssh-0.16.0/tests/server.scm 2022-09-13 20:56:01.000000000 +0200 +++ new/guile-ssh-0.16.3/tests/server.scm 2023-01-29 18:08:45.000000000 +0100 @@ -22,6 +22,7 @@ (use-modules (srfi srfi-64) (ssh server) (ssh version) + (ssh key) ;; Helper procedures (tests common)) @@ -53,16 +54,21 @@ (options `((bindaddr "127.0.0.1") (bindport 22) ,(if (>= %libssh-minor-version 7) - (list 'hostkey %rsakey %dsakey) + (if (dsa-support?) + (list 'hostkey %rsakey %dsakey) + (list 'hostkey %rsakey)) '(hostkey "ssh-rsa" "ssh-dss")) (rsakey ,%rsakey) (dsakey ,%dsakey) (banner "string") (log-verbosity nolog rare protocol packet functions) (blocking-mode #f #t))) + (options (if (dsa-support?) + options + (delete `(dsakey ,%dsakey) options))) (log (test-runner-aux-value (test-runner-current))) (res #t)) - + (format (current-error-port) "~a, options: ~a~%" (dsa-support?) options) (for-each (lambda (opt) (for-each diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/guile-ssh-0.16.0/tests/version.scm new/guile-ssh-0.16.3/tests/version.scm --- old/guile-ssh-0.16.0/tests/version.scm 1970-01-01 01:00:00.000000000 +0100 +++ new/guile-ssh-0.16.3/tests/version.scm 2023-01-29 18:08:45.000000000 +0100 @@ -0,0 +1,55 @@ +;;; key.scm -- Testing of Guile-SSH keys + +;; Copyright (C) 2022 Artyom V. Poptsov <[email protected]> +;; +;; This file is a part of Guile-SSH. +;; +;; Guile-SSH is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; Guile-SSH is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>. + +(add-to-load-path (getenv "abs_top_srcdir")) + +(use-modules (srfi srfi-64) + (ssh version) + (tests common)) + + +(define %test-suite-name "version") + +(test-begin-with-log %test-suite-name) + + + +(test-assert "get-libssh-version" + (get-libssh-version)) + +(test-assert "get-library-version" + (get-library-version)) + +(test-assert "get-crypto-library" + (get-crypto-library)) + +(test-assert "zlib-support?" + (object->string (zlib-support?))) + +(test-assert "dsa-support?" + (object->string (dsa-support?))) + + +(define exit-status (test-runner-fail-count (test-runner-current))) + +(test-end %test-suite-name) + +(exit exit-status) + +;;; version.scm ends here.
