pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/security/libssh



Module Name:    pkgsrc
Committed By:   tnn
Date:           Thu May  1 18:19:22 UTC 2025

Modified Files:
        pkgsrc/security/libssh: Makefile distinfo
        pkgsrc/security/libssh/patches: patch-tests_CMakeLists.txt
Added Files:
        pkgsrc/security/libssh/patches: patch-src_misc.c
            patch-tests_client_torture__session.c
            patch-tests_unittests_torture__misc.c

Log Message:
libssh: support OpenSSH major version 10. Bump.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 pkgsrc/security/libssh/Makefile
cvs rdiff -u -r1.33 -r1.34 pkgsrc/security/libssh/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/security/libssh/patches/patch-src_misc.c \
    pkgsrc/security/libssh/patches/patch-tests_client_torture__session.c \
    pkgsrc/security/libssh/patches/patch-tests_unittests_torture__misc.c
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/security/libssh/Makefile
diff -u pkgsrc/security/libssh/Makefile:1.53 pkgsrc/security/libssh/Makefile:1.54
--- pkgsrc/security/libssh/Makefile:1.53        Sat Apr 19 07:58:22 2025
+++ pkgsrc/security/libssh/Makefile     Thu May  1 18:19:22 2025
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2025/04/19 07:58:22 wiz Exp $
+# $NetBSD: Makefile,v 1.54 2025/05/01 18:19:22 tnn Exp $
 #
 # history: upstream renamed 0.11 to 0.1.1;
 # we have to use the old-style convention so that version compares work.
@@ -6,7 +6,7 @@
 VER=           0.11.1
 DISTNAME=      libssh-${VER}
 PKGNAME=       libssh-0.111
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    security
 MASTER_SITES=  https://www.libssh.org/files/${VER:R}/
 EXTRACT_SUFX=  .tar.xz

Index: pkgsrc/security/libssh/distinfo
diff -u pkgsrc/security/libssh/distinfo:1.33 pkgsrc/security/libssh/distinfo:1.34
--- pkgsrc/security/libssh/distinfo:1.33        Tue Jan  7 05:56:17 2025
+++ pkgsrc/security/libssh/distinfo     Thu May  1 18:19:22 2025
@@ -1,9 +1,12 @@
-$NetBSD: distinfo,v 1.33 2025/01/07 05:56:17 pho Exp $
+$NetBSD: distinfo,v 1.34 2025/05/01 18:19:22 tnn Exp $
 
 BLAKE2s (libssh-0.11.1.tar.xz) = 097094811bc8708196c48f9b237d2da6ebd5d3b48cf19d0d6f69e8cec83a5cd9
 SHA512 (libssh-0.11.1.tar.xz) = 284d376ad9ea30b0274b4ac754b27d168286dca862ece43ef15ca6d89e66865ad7a6703cc12dd4a8564a60b8449ae9b36e6496fd51d34cc27ac4030f6cf216d6
 Size (libssh-0.11.1.tar.xz) = 621108 bytes
 SHA1 (patch-CompilerChecks.cmake) = 8a650be5b69e956a0a54f54b71c4927ce685b8ca
 SHA1 (patch-examples_sshd__direct-tcpip.c) = 62de8625d58dbc03c38b0eb23f6e7f20a46e91de
-SHA1 (patch-tests_CMakeLists.txt) = 61d9e21d612545766b00f577b3d342eb20a0a9a5
+SHA1 (patch-src_misc.c) = f022c1a888ef1d9a7f1963981a989a82c41afcb3
+SHA1 (patch-tests_CMakeLists.txt) = 42728a0af04fababbbe973c3408ea31038b59276
+SHA1 (patch-tests_client_torture__session.c) = d3c67c2e17afb8e980486815b1debb6c8d9eb060
 SHA1 (patch-tests_torture.c) = 2c70e9d827f15ec36a62e0d0f5dd98774f24f79e
+SHA1 (patch-tests_unittests_torture__misc.c) = aba0eb9f590a5c91152dc026fcba714acef823be

Index: pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt
diff -u pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt:1.1 pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt:1.2
--- pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt:1.1       Sun Sep 13 18:45:36 2020
+++ pkgsrc/security/libssh/patches/patch-tests_CMakeLists.txt   Thu May  1 18:19:22 2025
@@ -1,11 +1,23 @@
-$NetBSD: patch-tests_CMakeLists.txt,v 1.1 2020/09/13 18:45:36 otis Exp $
+$NetBSD: patch-tests_CMakeLists.txt,v 1.2 2025/05/01 18:19:22 tnn Exp $
 
-Search for sshd also in /usr/lib/ssh where it is located
-in SunOS/SmartOS.
+* OpenSSH 10 support
+* Search for sshd also in /usr/lib/ssh where it is located
+  in SunOS/SmartOS.
 
---- tests/CMakeLists.txt.orig  2020-09-10 12:43:04.000000000 +0000
+--- tests/CMakeLists.txt.orig  2024-08-29 13:01:56.000000000 +0000
 +++ tests/CMakeLists.txt
-@@ -117,7 +117,8 @@ find_program(SSHD_EXECUTABLE
+@@ -100,8 +100,8 @@ add_subdirectory(unittests)
+ find_program(SSH_EXECUTABLE NAMES ssh)
+ if (SSH_EXECUTABLE)
+     execute_process(COMMAND ${SSH_EXECUTABLE} -V ERROR_VARIABLE OPENSSH_VERSION_STR)
+-    string(REGEX REPLACE "^.*OpenSSH_([0-9]).[0-9].*$" "\\1" OPENSSH_VERSION_MAJOR "${OPENSSH_VERSION_STR}")
+-    string(REGEX REPLACE "^.*OpenSSH_[0-9].([0-9]).*$" "\\1" OPENSSH_VERSION_MINOR "${OPENSSH_VERSION_STR}")
++    string(REGEX REPLACE "^.*OpenSSH_([0-9]+)[.]([0-9]+).*$" "\\1" OPENSSH_VERSION_MAJOR "${OPENSSH_VERSION_STR}")
++    string(REGEX REPLACE "^.*OpenSSH_([0-9]+)[.]([0-9]+).*$" "\\2" OPENSSH_VERSION_MINOR "${OPENSSH_VERSION_STR}")
+     set(OPENSSH_VERSION "${OPENSSH_VERSION_MAJOR}.${OPENSSH_VERSION_MINOR}")
+     if("${OPENSSH_VERSION}" VERSION_LESS "6.3")
+         # ssh - Q was introduced in 6.3
+@@ -168,7 +168,8 @@ find_program(SSHD_EXECUTABLE
               PATHS
                  /sbin
                  /usr/sbin
@@ -15,3 +27,14 @@ in SunOS/SmartOS.
  
  if (CLIENT_TESTING OR SERVER_TESTING)
      find_package(socket_wrapper 1.1.5 REQUIRED)
+@@ -212,8 +213,8 @@ if (CLIENT_TESTING OR SERVER_TESTING)
+     find_program(SSH_EXECUTABLE NAMES ssh)
+     if (SSH_EXECUTABLE)
+         execute_process(COMMAND ${SSH_EXECUTABLE} -V ERROR_VARIABLE OPENSSH_VERSION_STR)
+-        string(REGEX REPLACE "^.*OpenSSH_([0-9]).[0-9].*$" "\\1" OPENSSH_VERSION_MAJOR "${OPENSSH_VERSION_STR}")
+-        string(REGEX REPLACE "^.*OpenSSH_[0-9].([0-9]).*$" "\\1" OPENSSH_VERSION_MINOR "${OPENSSH_VERSION_STR}")
++        string(REGEX REPLACE "^.*OpenSSH_([0-9]+)[.]([0-9]+).*$" "\\1" OPENSSH_VERSION_MAJOR "${OPENSSH_VERSION_STR}")
++        string(REGEX REPLACE "^.*OpenSSH_([0-9]+)[.]([0-9]+).*$" "\\2" OPENSSH_VERSION_MINOR "${OPENSSH_VERSION_STR}")
+         add_definitions(-DOPENSSH_VERSION_MAJOR=${OPENSSH_VERSION_MAJOR} -DOPENSSH_VERSION_MINOR=${OPENSSH_VERSION_MINOR})
+     endif()
+ 

Added files:

Index: pkgsrc/security/libssh/patches/patch-src_misc.c
diff -u /dev/null pkgsrc/security/libssh/patches/patch-src_misc.c:1.1
--- /dev/null   Thu May  1 18:19:22 2025
+++ pkgsrc/security/libssh/patches/patch-src_misc.c     Thu May  1 18:19:22 2025
@@ -0,0 +1,26 @@
+NetBSD$
+
+OpenSSH 10 support: https://gitlab.com/libssh/libssh-mirror/-/commit/d758990d392fbbca623afd22186164cb4ccf1743.patch
+
+--- src/misc.c.orig    2024-08-29 13:01:56.000000000 +0000
++++ src/misc.c
+@@ -1397,6 +1397,7 @@ int ssh_analyze_banner(ssh_session sessi
+         char *tmp = NULL;
+         unsigned long int major = 0UL;
+         unsigned long int minor = 0UL;
++        int off = 0;
+ 
+         /*
+          * The banner is typical:
+@@ -1416,8 +1417,9 @@ int ssh_analyze_banner(ssh_session sessi
+             }
+ 
+             errno = 0;
+-            minor = strtoul(openssh + 10, &tmp, 10);
+-            if ((tmp == (openssh + 10)) ||
++            off = major >= 10 ? 11 : 10;
++            minor = strtoul(openssh + off, &tmp, 10);
++            if ((tmp == (openssh + off)) ||
+                 ((errno == ERANGE) && (major == ULONG_MAX)) ||
+                 ((errno != 0) && (major == 0)) ||
+                 (minor > 100)) {
Index: pkgsrc/security/libssh/patches/patch-tests_client_torture__session.c
diff -u /dev/null pkgsrc/security/libssh/patches/patch-tests_client_torture__session.c:1.1
--- /dev/null   Thu May  1 18:19:22 2025
+++ pkgsrc/security/libssh/patches/patch-tests_client_torture__session.c        Thu May  1 18:19:22 2025
@@ -0,0 +1,35 @@
+$NetBSD: patch-tests_client_torture__session.c,v 1.1 2025/05/01 18:19:22 tnn Exp $
+
+OpenSSH 10 support: https://gitlab.com/libssh/libssh-mirror/-/commit/d758990d392fbbca623afd22186164cb4ccf1743.patch
+ 
+--- tests/client/torture_session.c.orig        2024-08-09 16:37:15.000000000 +0000
++++ tests/client/torture_session.c
+@@ -574,6 +574,18 @@ static void torture_pubkey_hash(void **s
+     }
+ }
+ 
++static void torture_openssh_banner_version(void **state)
++{
++    struct torture_state *s = *state;
++    ssh_session session = s->ssh.session;
++
++    int openssh_version = ssh_get_openssh_version(session);
++    int cmake_openssh_version = SSH_VERSION_INT(OPENSSH_VERSION_MAJOR, OPENSSH_VERSION_MINOR, 0);
++
++    assert_int_equal(openssh_version, cmake_openssh_version);
++}
++
++
+ int torture_run_tests(void) {
+     int rc;
+     struct CMUnitTest tests[] = {
+@@ -619,6 +631,9 @@ int torture_run_tests(void) {
+         cmocka_unit_test_setup_teardown(torture_pubkey_hash,
+                                         session_setup,
+                                         session_teardown),
++        cmocka_unit_test_setup_teardown(torture_openssh_banner_version,
++                                        session_setup,
++                                        session_teardown),
+     };
+ 
+     ssh_init();
Index: pkgsrc/security/libssh/patches/patch-tests_unittests_torture__misc.c
diff -u /dev/null pkgsrc/security/libssh/patches/patch-tests_unittests_torture__misc.c:1.1
--- /dev/null   Thu May  1 18:19:22 2025
+++ pkgsrc/security/libssh/patches/patch-tests_unittests_torture__misc.c        Thu May  1 18:19:22 2025
@@ -0,0 +1,25 @@
+$NetBSD: patch-tests_unittests_torture__misc.c,v 1.1 2025/05/01 18:19:22 tnn Exp $
+
+OpenSSH 10 support: https://gitlab.com/libssh/libssh-mirror/-/commit/d758990d392fbbca623afd22186164cb4ccf1743.patch
+
+--- tests/unittests/torture_misc.c.orig        2024-08-29 13:01:56.000000000 +0000
++++ tests/unittests/torture_misc.c
+@@ -339,6 +339,7 @@ static void torture_ssh_analyze_banner(v
+     assert_server_banner_accepted("SSH-2.0-OpenSSH");
+     assert_int_equal(0, session->openssh);
+ 
++
+     /* OpenSSH banners: big enough to extract major and minor versions */
+     assert_client_banner_accepted("SSH-2.0-OpenSSH_5.9p1");
+     assert_int_equal(SSH_VERSION_INT(5, 9, 0), session->openssh);
+@@ -378,6 +379,10 @@ static void torture_ssh_analyze_banner(v
+     assert_server_banner_accepted("SSH-2.0-OpenSSH-keyscan");
+     assert_int_equal(0, session->openssh);
+ 
++    /* OpenSSH banners: Double digit in major version */
++    assert_server_banner_accepted("SSH-2.0-OpenSSH_10.0p1");
++    assert_int_equal(SSH_VERSION_INT(10, 0, 0), session->openssh);
++
+     ssh_free(session);
+ }
+ 



Home | Main Index | Thread Index | Old Index