Source-Changes-HG archive

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

[src/trunk]: src/lib/libcrypt Enable decryption in crypt(), from cryptosrc-in...



details:   https://anonhg.NetBSD.org/src/rev/510789885688
branches:  trunk
changeset: 488002:510789885688
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 16 16:27:32 2000 +0000

description:
Enable decryption in crypt(), from cryptosrc-intl, and lift the updated
manual page (which describes decryption) from cryptosrc-us.

diffstat:

 lib/libcrypt/crypt.3 |  17 ++++++++++-------
 lib/libcrypt/crypt.c |   8 +++++---
 2 files changed, 15 insertions(+), 10 deletions(-)

diffs (82 lines):

diff -r 88c8f8f6a973 -r 510789885688 lib/libcrypt/crypt.3
--- a/lib/libcrypt/crypt.3      Fri Jun 16 16:19:33 2000 +0000
+++ b/lib/libcrypt/crypt.3      Fri Jun 16 16:27:32 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: crypt.3,v 1.7 1999/07/02 15:18:37 simonb Exp $
+.\"    $NetBSD: crypt.3,v 1.8 2000/06/16 16:27:32 thorpej Exp $
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -31,9 +31,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"     @(#)crypt.3    8.1.1.1 (Berkeley) 8/18/93
+.\"     @(#)crypt.3    8.2 (Berkeley) 12/11/93
 .\"
-.Dd August 18, 1993
+.Dd December 11, 1993
 .Dt CRYPT 3
 .Os
 .Sh NAME
@@ -79,7 +79,7 @@
 of salt.
 Both the iteration
 .Fa count
-and the
+and the 
 .Fa salt
 are encoded with 6 bits per character, least significant bits first.
 The values 0 to 63 are encoded by the characters ``./0-9A-Za-z'',
@@ -167,8 +167,9 @@
 is 0,
 the argument
 .Fa block
-is encrypted, otherwise it fails.
-The encryption is returned in the original
+is encrypted, otherwise it
+is decrypted.
+The encryption or decryption is returned in the original
 array
 .Fa block
 after using the
@@ -194,7 +195,9 @@
 character are concatenated to yield a 56-bit key.
 The function
 .Fn des_cipher
-encrypts the 64-bits stored in the 8 characters at
+encrypts (or decrypts if
+.Fa count
+is negative) the 64-bits stored in the 8 characters at
 .Fa in
 using
 .Xr abs 3
diff -r 88c8f8f6a973 -r 510789885688 lib/libcrypt/crypt.c
--- a/lib/libcrypt/crypt.c      Fri Jun 16 16:19:33 2000 +0000
+++ b/lib/libcrypt/crypt.c      Fri Jun 16 16:27:32 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypt.c,v 1.14 2000/03/13 22:59:22 soren Exp $ */
+/*     $NetBSD: crypt.c,v 1.15 2000/06/16 16:27:32 thorpej Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)crypt.c    8.1.1.1 (Berkeley) 8/18/93";
 #else
-__RCSID("$NetBSD: crypt.c,v 1.14 2000/03/13 22:59:22 soren Exp $");
+__RCSID("$NetBSD: crypt.c,v 1.15 2000/06/16 16:27:32 thorpej Exp $");
 #endif
 #endif /* not lint */
 
@@ -666,7 +666,9 @@
        }
        else
        {               /* decryption */
-               return (1); /* always fail */
+               num_iter = -num_iter;
+               kp = &KS[KS_SIZE-1];
+               ks_inc  = -(long)sizeof(*kp);
        }
 
        while (--num_iter >= 0) {



Home | Main Index | Thread Index | Old Index