From adf1096a037b1896347e13a76947647e455de84f Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 4 Sep 2007 09:14:00 +0000 Subject: [PATCH] initial import of putty-0.60 SSH/telnet client: PuTTY is a SSH and Telnet client implementation. This package contains the command-line clients and supporting utilities for key generation. feedback steven@ mbalmer@; ok mbalmer@ --- net/putty/Makefile | 37 +++++++++++ net/putty/distinfo | 5 ++ net/putty/patches/patch-unix_uxgen_c | 25 +++++++ net/putty/patches/patch-unix_uxnoise_c | 90 ++++++++++++++++++++++++++ net/putty/pkg/DESCR-gui | 1 + net/putty/pkg/DESCR-main | 2 + net/putty/pkg/PLIST-gui | 7 ++ net/putty/pkg/PLIST-main | 9 +++ 8 files changed, 176 insertions(+) create mode 100644 net/putty/Makefile create mode 100644 net/putty/distinfo create mode 100644 net/putty/patches/patch-unix_uxgen_c create mode 100644 net/putty/patches/patch-unix_uxnoise_c create mode 100644 net/putty/pkg/DESCR-gui create mode 100644 net/putty/pkg/DESCR-main create mode 100644 net/putty/pkg/PLIST-gui create mode 100644 net/putty/pkg/PLIST-main diff --git a/net/putty/Makefile b/net/putty/Makefile new file mode 100644 index 00000000000..275c13d2f7e --- /dev/null +++ b/net/putty/Makefile @@ -0,0 +1,37 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2007/09/04 09:14:00 djm Exp $ + +COMMENT-main= SSH and telnet client +COMMENT-gui= PuTTY GUI clients + +DISTNAME= putty-0.60 +PKGNAME-main= ${DISTNAME} +PKGNAME-gui= ${DISTNAME:S/putty/putty-gui/} +CATEGORIES= net security + +HOMEPAGE= http://www.chiark.greenend.org.uk/~sgtatham/putty/ +MASTER_SITES= http://the.earth.li/~sgtatham/putty/latest/ \ + ftp://ftp.chiark.greenend.org.uk/users/sgtatham/putty-latest/ + +MAINTAINER= Damien Miller + +# BSD +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +CONFIGURE_STYLE= gnu +WRKBUILD= ${WRKSRC}/unix + +MULTI_PACKAGES= -main -gui + +WANTLIB= c +WANTLIB-gui= c m X11 Xext Xi glib gmodule iconv intl +LIB_DEPENDS-gui= gtk.>=1,gdk.>=1::x11/gtk+ + +pre-configure: + cd ${WRKSRC} && ./mkfiles.pl + +NO_REGRESS= Yes + +.include diff --git a/net/putty/distinfo b/net/putty/distinfo new file mode 100644 index 00000000000..f63726d2078 --- /dev/null +++ b/net/putty/distinfo @@ -0,0 +1,5 @@ +MD5 (putty-0.60.tar.gz) = B+Zf2YsW0RWuOKGAv7JC4g== +RMD160 (putty-0.60.tar.gz) = nFbuTS0F9bEHnGXxml2dBrWWq6M= +SHA1 (putty-0.60.tar.gz) = jZn48Qd7erJfAUEmtdgSoa1Vzjc= +SHA256 (putty-0.60.tar.gz) = sruq+TJJl+hc8V1E7UHo6JU5yCFdzqydbXJyo328KEk= +SIZE (putty-0.60.tar.gz) = 1743711 diff --git a/net/putty/patches/patch-unix_uxgen_c b/net/putty/patches/patch-unix_uxgen_c new file mode 100644 index 00000000000..94e751287b8 --- /dev/null +++ b/net/putty/patches/patch-unix_uxgen_c @@ -0,0 +1,25 @@ +$OpenBSD: patch-unix_uxgen_c,v 1.1.1.1 2007/09/04 09:14:00 djm Exp $ +--- unix/uxgen.c.orig Tue Sep 4 17:31:05 2007 ++++ unix/uxgen.c Tue Sep 4 17:31:16 2007 +@@ -14,10 +14,10 @@ char *get_random_data(int len) + int fd; + int ngot, ret; + +- fd = open("/dev/random", O_RDONLY); ++ fd = open("/dev/arandom", O_RDONLY); + if (fd < 0) { + sfree(buf); +- perror("puttygen: unable to open /dev/random"); ++ perror("puttygen: unable to open /dev/arandom"); + return NULL; + } + +@@ -26,7 +26,7 @@ char *get_random_data(int len) + ret = read(fd, buf+ngot, len-ngot); + if (ret < 0) { + close(fd); +- perror("puttygen: unable to read /dev/random"); ++ perror("puttygen: unable to read /dev/arandom"); + return NULL; + } + ngot += ret; diff --git a/net/putty/patches/patch-unix_uxnoise_c b/net/putty/patches/patch-unix_uxnoise_c new file mode 100644 index 00000000000..fd934650489 --- /dev/null +++ b/net/putty/patches/patch-unix_uxnoise_c @@ -0,0 +1,90 @@ +$OpenBSD: patch-unix_uxnoise_c,v 1.1.1.1 2007/09/04 09:14:00 djm Exp $ +--- unix/uxnoise.c.orig Wed Nov 17 02:27:00 2004 ++++ unix/uxnoise.c Tue Sep 4 17:47:44 2007 +@@ -4,6 +4,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -18,7 +19,7 @@ static int read_dev_urandom(char *buf, int len) + int fd; + int ngot, ret; + +- fd = open("/dev/urandom", O_RDONLY); ++ fd = open("/dev/arandom", O_RDONLY); + if (fd < 0) + return 0; + +@@ -39,28 +40,16 @@ static int read_dev_urandom(char *buf, int len) + * This function is called once, at PuTTY startup. It will do some + * slightly silly things such as fetching an entire process listing + * and scanning /tmp, load the saved random seed from disk, and +- * also read 32 bytes out of /dev/urandom. ++ * also read 32 bytes out of /dev/arandom. + */ + + void noise_get_heavy(void (*func) (void *, int)) + { +- char buf[512]; +- FILE *fp; +- int ret; ++ char buf[32]; + +- if (read_dev_urandom(buf, 32)) +- func(buf, 32); ++ if (read_dev_urandom(buf, sizeof(buf))) ++ func(buf, sizeof(buf)); + +- fp = popen("ps -axu 2>/dev/null", "r"); +- while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0) +- func(buf, ret); +- pclose(fp); +- +- fp = popen("ls -al /tmp 2>/dev/null", "r"); +- while ( (ret = fread(buf, 1, sizeof(buf), fp)) > 0) +- func(buf, ret); +- pclose(fp); +- + read_random_seed(func); + random_save_seed(); + } +@@ -94,21 +83,13 @@ void noise_get_light(void (*func) (void *, int)) + */ + void noise_regular(void) + { +- int fd; +- int ret; +- char buf[512]; ++ u_int32_t buf[8], i; + struct rusage rusage; + +- if ((fd = open("/proc/meminfo", O_RDONLY)) >= 0) { +- while ( (ret = read(fd, buf, sizeof(buf))) > 0) +- random_add_noise(buf, ret); +- close(fd); +- } +- if ((fd = open("/proc/stat", O_RDONLY)) >= 0) { +- while ( (ret = read(fd, buf, sizeof(buf))) > 0) +- random_add_noise(buf, ret); +- close(fd); +- } ++ for (i = 0; i < 8; i++) ++ buf[i] = arc4random(); ++ random_add_noise(buf, sizeof(buf)); ++ + getrusage(RUSAGE_SELF, &rusage); + random_add_noise(&rusage, sizeof(rusage)); + } +@@ -121,6 +102,9 @@ void noise_regular(void) + void noise_ultralight(unsigned long data) + { + struct timeval tv; ++ u_int32_t r; ++ r = arc4random(); ++ random_add_noise(&r, sizeof(r)); + gettimeofday(&tv, NULL); + random_add_noise(&tv, sizeof(tv)); + random_add_noise(&data, sizeof(data)); diff --git a/net/putty/pkg/DESCR-gui b/net/putty/pkg/DESCR-gui new file mode 100644 index 00000000000..e53d6b3c26b --- /dev/null +++ b/net/putty/pkg/DESCR-gui @@ -0,0 +1 @@ +PuTTY GUI SSH and telnet clients. diff --git a/net/putty/pkg/DESCR-main b/net/putty/pkg/DESCR-main new file mode 100644 index 00000000000..18d87419583 --- /dev/null +++ b/net/putty/pkg/DESCR-main @@ -0,0 +1,2 @@ +PuTTY is a SSH and Telnet client implementation. This package contains +the command-line clients and supporting utilities for key generation. diff --git a/net/putty/pkg/PLIST-gui b/net/putty/pkg/PLIST-gui new file mode 100644 index 00000000000..1e5c6d4e174 --- /dev/null +++ b/net/putty/pkg/PLIST-gui @@ -0,0 +1,7 @@ +@comment $OpenBSD: PLIST-gui,v 1.1.1.1 2007/09/04 09:14:00 djm Exp $ +bin/pterm +bin/putty +bin/puttytel +@man man/man1/pterm.1 +@man man/man1/putty.1 +@man man/man1/puttytel.1 diff --git a/net/putty/pkg/PLIST-main b/net/putty/pkg/PLIST-main new file mode 100644 index 00000000000..ab74dffd938 --- /dev/null +++ b/net/putty/pkg/PLIST-main @@ -0,0 +1,9 @@ +@comment $OpenBSD: PLIST-main,v 1.1.1.1 2007/09/04 09:14:00 djm Exp $ +bin/plink +bin/pscp +bin/psftp +bin/puttygen +@man man/man1/plink.1 +@man man/man1/pscp.1 +@man man/man1/psftp.1 +@man man/man1/puttygen.1