pastebin - collaborative debugging tool
rovema.kpaste.net RSS


Debian OpenSSH backport to Jessie
Posted by Anonymous on Sat 18th Feb 2023 11:12
raw | new post
modification of post by Anonymous (view diff)

  1. # Debian OpenSSH backport to Debian/Jessie
  2. #
  3. # git clone https://salsa.debian.org/ssh-team/openssh.git
  4. # cd openssh/
  5. # patch -p1 <this_patch.patch
  6. # debuild -b -uc -us 2>&1 | tee buildlog.log
  7. #
  8. diff --git a/.gitattributes b/.gitattributes
  9. new file mode 100644
  10. index 0000000..204822d
  11. --- /dev/null
  12. +++ b/.gitattributes
  13. @@ -0,0 +1,6 @@
  14. +configure      -diff
  15. +aclocal.m4     -diff
  16. +config.guess   -diff
  17. +aclocal.m4     -diff
  18. +config.guess   -diff
  19. +config.sub     -diff
  20. diff --git a/config.h.in b/config.h.in
  21. index f80d542..abb987a 100644
  22. --- a/config.h.in
  23. +++ b/config.h.in
  24. @@ -984,6 +984,9 @@
  25.  /* Define to 1 if you have the `memmove' function. */
  26.  #undef HAVE_MEMMOVE
  27.  
  28. +/* Define to 1 if you have the <memory.h> header file. */
  29. +#undef HAVE_MEMORY_H
  30. +
  31.  /* Define to 1 if you have the `memset_s' function. */
  32.  #undef HAVE_MEMSET_S
  33.  
  34. @@ -1355,9 +1358,6 @@
  35.  /* Define to 1 if you have the <stdint.h> header file. */
  36.  #undef HAVE_STDINT_H
  37.  
  38. -/* Define to 1 if you have the <stdio.h> header file. */
  39. -#undef HAVE_STDIO_H
  40. -
  41.  /* Define to 1 if you have the <stdlib.h> header file. */
  42.  #undef HAVE_STDLIB_H
  43.  
  44. @@ -1478,6 +1478,9 @@
  45.  /* Define if you have syslen in utmpx.h */
  46.  #undef HAVE_SYSLEN_IN_UTMPX
  47.  
  48. +/* Define if you want systemd support. */
  49. +#undef HAVE_SYSTEMD
  50. +
  51.  /* Define to 1 if you have the <sys/audit.h> header file. */
  52.  #undef HAVE_SYS_AUDIT_H
  53.  
  54. @@ -1775,6 +1778,9 @@
  55.  /* Define if pututxline updates lastlog too */
  56.  #undef LASTLOG_WRITE_PUTUTXLINE
  57.  
  58. +/* Define if you want TCP Wrappers support */
  59. +#undef LIBWRAP
  60. +
  61.  /* Define to whatever link() returns for "not supported" if it doesn't return
  62.     EOPNOTSUPP. */
  63.  #undef LINK_OPNOTSUPP_ERRNO
  64. @@ -1979,9 +1985,7 @@
  65.  /* Prepend the address family to IP tunnel traffic */
  66.  #undef SSH_TUN_PREPEND_AF
  67.  
  68. -/* Define to 1 if all of the C90 standard headers exist (not just the ones
  69. -   required in a freestanding environment). This macro is provided for
  70. -   backward compatibility; new code need not use it. */
  71. +/* Define to 1 if you have the ANSI C header files. */
  72.  #undef STDC_HEADERS
  73.  
  74.  /* Define if you want a different $PATH for the superuser */
  75. @@ -2008,6 +2012,9 @@
  76.  /* Use btmp to log bad logins */
  77.  #undef USE_BTMP
  78.  
  79. +/* platform uses an in-memory credentials cache */
  80. +#undef USE_CCAPI
  81. +
  82.  /* Use libedit for sftp */
  83.  #undef USE_LIBEDIT
  84.  
  85. @@ -2023,6 +2030,9 @@
  86.  /* Use PIPES instead of a socketpair() */
  87.  #undef USE_PIPES
  88.  
  89. +/* platform has the Security Authorization Session API */
  90. +#undef USE_SECURITY_SESSION_API
  91. +
  92.  /* Define if you have Solaris privileges */
  93.  #undef USE_SOLARIS_PRIVS
  94.  
  95. @@ -2081,6 +2091,11 @@
  96.  /* Define if xauth is found in your path */
  97.  #undef XAUTH_PATH
  98.  
  99. +/* Enable large inode numbers on Mac OS X 10.5.  */
  100. +#ifndef _DARWIN_USE_64_BIT_INODE
  101. +# define _DARWIN_USE_64_BIT_INODE 1
  102. +#endif
  103. +
  104.  /* Number of bits in a file offset, on hosts where this is settable. */
  105.  #undef _FILE_OFFSET_BITS
  106.  
  107. diff --git a/configure.ac b/configure.ac
  108. index 23423e4..774796a 100644
  109. --- a/configure.ac
  110. +++ b/configure.ac
  111. @@ -2824,8 +2824,8 @@ AC_ARG_WITH([ssl-engine],
  112.  
  113.  nocrypto_saved_LIBS="$LIBS"
  114.  if test "x$openssl" = "xyes" ; then
  115. -       LIBS="-lcrypto $LIBS"
  116. -       CHANNELLIBS="-lcrypto $CHANNELLIBS"
  117. +       LIBS="-Wl,-Bstatic -lcrypto -Wl,-Bdynamic $LIBS"
  118. +       CHANNELLIBS="-Wl,-Bstatic -lcrypto -Wl,-Bdynamic $CHANNELLIBS"
  119.         AC_TRY_LINK_FUNC([RAND_add], ,
  120.             [AC_MSG_ERROR([*** working libcrypto not found, check config.log])])
  121.         AC_CHECK_HEADER([openssl/opensslv.h], ,
  122. diff --git a/contrib/gnome-ssh-askpass3.c b/contrib/gnome-ssh-askpass3.c
  123. index e1a0533..6a6d25c 100644
  124. --- a/contrib/gnome-ssh-askpass3.c
  125. +++ b/contrib/gnome-ssh-askpass3.c
  126. @@ -63,6 +63,22 @@
  127.  #include <gdk/gdkkeysyms.h>
  128.  
  129.  static void
  130. +report_failed_grab (GtkWidget *parent_window, const char *what)
  131. +{
  132. +       GtkWidget *err;
  133. +
  134. +       err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
  135. +           GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
  136. +           "Could not grab %s. A malicious client may be eavesdropping "
  137. +           "on your session.", what);
  138. +       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
  139. +
  140. +       gtk_dialog_run(GTK_DIALOG(err));
  141. +
  142. +       gtk_widget_destroy(err);
  143. +}
  144. +
  145. +static void
  146.  ok_dialog(GtkWidget *entry, gpointer dialog)
  147.  {
  148.         g_return_if_fail(GTK_IS_DIALOG(dialog));
  149. @@ -137,12 +153,9 @@ passphrase_dialog(char *message, int prompt_type)
  150.         char *passphrase, *local;
  151.         int result, grab_tries, grab_server, grab_pointer;
  152.         int buttons, default_response;
  153. -       GtkWidget *parent_window, *dialog, *entry, *err;
  154. +       GtkWidget *parent_window, *dialog, *entry;
  155.         GdkGrabStatus status;
  156.         GdkColor fg, bg;
  157. -       GdkSeat *seat;
  158. -       GdkDisplay *display;
  159. -       GdkSeatCapabilities caps;
  160.         int fg_set = 0, bg_set = 0;
  161.  
  162.         grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
  163. @@ -213,30 +226,48 @@ passphrase_dialog(char *message, int prompt_type)
  164.                             G_CALLBACK(check_none), dialog);
  165.                 }
  166.         }
  167. +
  168.         /* Grab focus */
  169.         gtk_widget_show_now(dialog);
  170. -       display = gtk_widget_get_display(GTK_WIDGET(dialog));
  171. -       seat = gdk_display_get_default_seat(display);
  172. -       caps = GDK_SEAT_CAPABILITY_KEYBOARD;
  173. -       if (grab_pointer)
  174. -               caps |= GDK_SEAT_CAPABILITY_ALL_POINTING;
  175. -       if (grab_server)
  176. -               caps = GDK_SEAT_CAPABILITY_ALL;
  177. -       for (;;) {
  178. -               status = gdk_seat_grab(seat, gtk_widget_get_window(dialog),
  179. -                   caps, TRUE, NULL, NULL, NULL, NULL);
  180. +       if (grab_pointer) {
  181. +               for(;;) {
  182. +                       status = gdk_pointer_grab(
  183. +                           (gtk_widget_get_window(GTK_WIDGET(dialog))), TRUE,
  184. +                           0, NULL, NULL, GDK_CURRENT_TIME);
  185. +                       if (status == GDK_GRAB_SUCCESS)
  186. +                               break;
  187. +                       usleep(GRAB_WAIT * 1000);
  188. +                       if (++grab_tries > GRAB_TRIES) {
  189. +                               failed = "mouse";
  190. +                               goto nograb;
  191. +                       }
  192. +               }
  193. +       }
  194. +       for(;;) {
  195. +               status = gdk_keyboard_grab(
  196. +                   gtk_widget_get_window(GTK_WIDGET(dialog)), FALSE,
  197. +                   GDK_CURRENT_TIME);
  198.                 if (status == GDK_GRAB_SUCCESS)
  199.                         break;
  200.                 usleep(GRAB_WAIT * 1000);
  201. -               if (++grab_tries > GRAB_TRIES)
  202. -                       goto nograb;
  203. +               if (++grab_tries > GRAB_TRIES) {
  204. +                       failed = "keyboard";
  205. +                       goto nograbkb;
  206. +               }
  207. +       }
  208. +       if (grab_server) {
  209. +               gdk_x11_grab_server();
  210.         }
  211.  
  212.         result = gtk_dialog_run(GTK_DIALOG(dialog));
  213.  
  214.         /* Ungrab */
  215. -       gdk_seat_ungrab(seat);
  216. -       gdk_display_flush(display);
  217. +       if (grab_server)
  218. +               XUngrabServer(gdk_x11_get_default_xdisplay());
  219. +       if (grab_pointer)
  220. +               gdk_pointer_ungrab(GDK_CURRENT_TIME);
  221. +       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
  222. +       gdk_flush();
  223.  
  224.         /* Report passphrase if user selected OK */
  225.         if (prompt_type == PROMPT_ENTRY) {
  226. @@ -264,16 +295,21 @@ passphrase_dialog(char *message, int prompt_type)
  227.                 return -1;
  228.         return 0;
  229.  
  230. + nograbkb:
  231. +       /*
  232. +        * At least one grab failed - ungrab what we got, and report
  233. +        * the failure to the user.  Note that XGrabServer() cannot
  234. +        * fail.
  235. +        */
  236. +       gdk_pointer_ungrab(GDK_CURRENT_TIME);
  237.   nograb:
  238. +       if (grab_server)
  239. +               XUngrabServer(gdk_x11_get_default_xdisplay());
  240.         gtk_widget_destroy(dialog);
  241. -       err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
  242. -           GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
  243. -           "Could not grab input. A malicious client may be eavesdropping "
  244. -           "on your session.");
  245. -       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
  246. -       gtk_dialog_run(GTK_DIALOG(err));
  247. -       gtk_widget_destroy(err);
  248. -       return -1;
  249. +
  250. +       report_failed_grab(parent_window, failed);
  251. +
  252. +       return (-1);
  253.  }
  254.  
  255.  int
  256. @@ -284,6 +320,8 @@ main(int argc, char **argv)
  257.  
  258.         gtk_init(&argc, &argv);
  259.  
  260. +       gtk_window_set_default_icon_from_file ("/usr/share/pixmaps/ssh-askpass-gnome.png", NULL);
  261. +
  262.         if (argc > 1) {
  263.                 message = g_strjoinv(" ", argv + 1);
  264.         } else {
  265. diff --git a/debian/compat b/debian/compat
  266. new file mode 100644
  267. index 0000000..f599e28
  268. --- /dev/null
  269. +++ b/debian/compat
  270. @@ -0,0 +1 @@
  271. +10
  272. diff --git a/debian/control b/debian/control
  273. index f3ed979..efbfc0c 100644
  274. --- a/debian/control
  275. +++ b/debian/control
  276. @@ -2,18 +2,15 @@ Source: openssh
  277.  Section: net
  278.  Priority: standard
  279.  Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
  280. -Build-Depends: debhelper (>= 13.1~),
  281. -               debhelper-compat (= 13),
  282. +Build-Depends: debhelper,
  283.                 dh-exec,
  284. -               dh-runit (>= 2.8.8),
  285.                 libaudit-dev [linux-any],
  286.                 libedit-dev,
  287. -               libfido2-dev (>= 1.5.0) [linux-any],
  288.                 libgtk-3-dev <!pkg.openssh.nognome>,
  289.                 libkrb5-dev | heimdal-dev,
  290.                 libpam0g-dev | libpam-dev,
  291.                 libselinux1-dev [linux-any],
  292. -               libssl-dev (>= 1.1.0g),
  293. +               libssl-dev ,
  294.                 libsystemd-dev [linux-any] | libelogind-dev [linux-any],
  295.                 libwrap0-dev | libwrap-dev,
  296.                 pkg-config,
  297. @@ -24,7 +21,6 @@ Uploaders: Colin Watson <cjwatson@debian.org>,
  298.  Homepage: https://www.openssh.com/
  299.  Vcs-Git: https://salsa.debian.org/ssh-team/openssh.git
  300.  Vcs-Browser: https://salsa.debian.org/ssh-team/openssh
  301. -Rules-Requires-Root: no
  302.  
  303.  Package: openssh-client
  304.  Architecture: any
  305. diff --git a/debian/rules b/debian/rules
  306. index 18b2bf3..dc240bc 100755
  307. --- a/debian/rules
  308. +++ b/debian/rules
  309. @@ -74,11 +74,12 @@ confflags += --with-pam
  310.  confflags += --with-libedit
  311.  confflags += --with-kerberos5=/usr
  312.  confflags += --with-ssl-engine
  313. +
  314.  ifeq ($(DEB_HOST_ARCH_OS),linux)
  315.  confflags += --with-selinux
  316.  confflags += --with-audit=linux
  317.  confflags += --with-systemd
  318. -confflags += --with-security-key-builtin
  319. +#confflags += --with-security-key-builtin
  320.  endif
  321.  
  322.  # The deb build wants xauth; the udeb build doesn't.
  323. @@ -98,15 +99,15 @@ confflags += --with-cflags='$(cflags)'
  324.  confflags_udeb += --with-cflags='$(cflags_udeb)'
  325.  
  326.  # Linker flags.
  327. -confflags += --with-ldflags='$(strip -Wl,--as-needed $(LDFLAGS))'
  328. -confflags_udeb += --with-ldflags='-Wl,--as-needed'
  329. +#confflags += --with-ldflags='$(strip -Wl,--as-needed $(LDFLAGS))'
  330. +#confflags_udeb += --with-ldflags='-Wl,--as-needed'
  331.  
  332.  ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386)
  333.    BUILD_PACKAGES += -Nopenssh-tests
  334.  endif
  335.  
  336.  %:
  337. -       dh $@ --with=runit $(BUILD_PACKAGES)
  338. +       dh $@ $(BUILD_PACKAGES)
  339.  
  340.  override_dh_autoreconf-indep:
  341.  
  342. diff --git a/kex.c b/kex.c
  343. index e7b7316..a16e87a 100644
  344. --- a/kex.c
  345. +++ b/kex.c
  346. @@ -102,8 +102,10 @@ static const struct kexalg kexalgs[] = {
  347.         { KEX_DHGEX_SHA256, KEX_DH_GEX_SHA256, 0, SSH_DIGEST_SHA256 },
  348.  #endif /* HAVE_EVP_SHA256 */
  349.  #ifdef OPENSSL_HAS_ECC
  350. +#ifdef NID_X9_62_prime256v1
  351.         { KEX_ECDH_SHA2_NISTP256, KEX_ECDH_SHA2,
  352.             NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
  353. +#endif
  354.         { KEX_ECDH_SHA2_NISTP384, KEX_ECDH_SHA2, NID_secp384r1,
  355.             SSH_DIGEST_SHA384 },
  356.  # ifdef OPENSSL_HAS_NISTP521
  357. @@ -129,8 +131,10 @@ static const struct kexalg gss_kexalgs[] = {
  358.         { KEX_GSS_GRP14_SHA1_ID, KEX_GSS_GRP14_SHA1, 0, SSH_DIGEST_SHA1 },
  359.         { KEX_GSS_GRP14_SHA256_ID, KEX_GSS_GRP14_SHA256, 0, SSH_DIGEST_SHA256 },
  360.         { KEX_GSS_GRP16_SHA512_ID, KEX_GSS_GRP16_SHA512, 0, SSH_DIGEST_SHA512 },
  361. +#ifdef NID_X9_62_prime256v1
  362.         { KEX_GSS_NISTP256_SHA256_ID, KEX_GSS_NISTP256_SHA256,
  363.             NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
  364. +#endif
  365.         { KEX_GSS_C25519_SHA256_ID, KEX_GSS_C25519_SHA256, 0, SSH_DIGEST_SHA256 },
  366.  #endif
  367.         { NULL, 0, -1, -1},

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at