[Midnightbsd-cvs] src [11553] trunk/usr.bin/enigma/enigma.c: sync enigma
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Jul 7 17:52:19 EDT 2018
Revision: 11553
http://svnweb.midnightbsd.org/src/?rev=11553
Author: laffer1
Date: 2018-07-07 17:52:18 -0400 (Sat, 07 Jul 2018)
Log Message:
-----------
sync enigma
Modified Paths:
--------------
trunk/usr.bin/enigma/Makefile
trunk/usr.bin/enigma/enigma.1
trunk/usr.bin/enigma/enigma.c
Property Changed:
----------------
trunk/usr.bin/enigma/enigma.1
Modified: trunk/usr.bin/enigma/Makefile
===================================================================
--- trunk/usr.bin/enigma/Makefile 2018-07-07 21:51:58 UTC (rev 11552)
+++ trunk/usr.bin/enigma/Makefile 2018-07-07 21:52:18 UTC (rev 11553)
@@ -1,4 +1,5 @@
-# $FreeBSD: src/usr.bin/enigma/Makefile,v 1.9 2004/02/05 22:44:24 ru Exp $
+# $MidnightBSD$
+# $FreeBSD: stable/10/usr.bin/enigma/Makefile 125503 2004-02-05 22:44:25Z ru $
PROG= enigma
Modified: trunk/usr.bin/enigma/enigma.1
===================================================================
--- trunk/usr.bin/enigma/enigma.1 2018-07-07 21:51:58 UTC (rev 11552)
+++ trunk/usr.bin/enigma/enigma.1 2018-07-07 21:52:18 UTC (rev 11553)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\"
.\" enigma (aka. crypt) man page written by Joerg Wunsch.
.\"
@@ -4,11 +5,11 @@
.\" Since enigma itself is distributed in the Public Domain, this file
.\" is also.
.\"
-.\" $FreeBSD: src/usr.bin/enigma/enigma.1,v 1.13 2006/12/24 19:55:38 ru Exp $
+.\" $FreeBSD: stable/10/usr.bin/enigma/enigma.1 206622 2010-04-14 19:08:06Z uqs $
.\" "
.Dd May 14, 2004
+.Dt ENIGMA 1
.Os
-.Dt ENIGMA 1
.Sh NAME
.Nm enigma ,
.Nm crypt
@@ -86,9 +87,9 @@
For real encryption, refer to
.Xr bdes 1 ,
.Xr openssl 1 ,
-.Xr pgp 1 Pq Pa mports/security/pgp ,
+.Xr pgp 1 Pq Pa ports/security/pgp ,
or
-.Xr gpg 1 Pq Pa mports/security/gnupg .
+.Xr gpg 1 Pq Pa ports/security/gnupg .
However, restrictions for exporting,
importing or using such tools might exist in some countries, so those
stronger programs are not being shipped as part of the operating
Property changes on: trunk/usr.bin/enigma/enigma.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/enigma/enigma.c
===================================================================
--- trunk/usr.bin/enigma/enigma.c 2018-07-07 21:51:58 UTC (rev 11552)
+++ trunk/usr.bin/enigma/enigma.c 2018-07-07 21:52:18 UTC (rev 11553)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* "enigma.c" is in file cbw.tar from
* anonymous FTP host watmsg.waterloo.edu: pub/crypt/cbw.tar.Z
@@ -11,7 +12,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/enigma/enigma.c,v 1.9 2006/07/25 22:20:05 jkim Exp $");
+__FBSDID("$FreeBSD: stable/10/usr.bin/enigma/enigma.c 231994 2012-02-22 06:27:20Z kevlo $");
#include <sys/types.h>
@@ -25,16 +26,16 @@
#define ECHO 010
#define ROTORSZ 256
#define MASK 0377
-char t1[ROTORSZ];
-char t2[ROTORSZ];
-char t3[ROTORSZ];
-char deck[ROTORSZ];
-char buf[13];
+static char t1[ROTORSZ];
+static char t2[ROTORSZ];
+static char t3[ROTORSZ];
+static char deck[ROTORSZ];
+static char buf[13];
-void shuffle(char *);
-void setup(char *);
+static void shuffle(char *);
+static void setup(char *);
-void
+static void
setup(char *pw)
{
int ic, i, k, temp;
@@ -41,9 +42,15 @@
char salt[3];
unsigned rnd;
int32_t seed;
+ char *cryptpw;
strlcpy(salt, pw, sizeof(salt));
- memcpy(buf, crypt(pw, salt), sizeof(buf));
+ cryptpw = crypt(pw, salt);
+ if (cryptpw == NULL) {
+ fprintf(stderr, "crypt(3) failure\n");
+ exit(1);
+ }
+ memcpy(buf, cryptpw, sizeof(buf));
seed = 123;
for (i=0; i<13; i++)
seed = seed*buf[i] + i;
@@ -128,7 +135,7 @@
return 0;
}
-void
+static void
shuffle(char deckary[])
{
int i, ic, k, temp;
More information about the Midnightbsd-cvs
mailing list