OpenBSD CVS

CVS log for src/usr.bin/encrypt/encrypt.c


[BACK] Up to [local] / src / usr.bin / encrypt

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.52 / (download) - annotate - [select for diffs], Thu Feb 10 13:06:46 2022 UTC (2 years, 3 months ago) by robert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.51: +3 -1 lines
Diff to previous 1.51 (colored)

unveil _PATH_LOGIN_CONF_D

Revision 1.51 / (download) - annotate - [select for diffs], Mon Jul 12 15:09:19 2021 UTC (2 years, 10 months ago) by beck
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.50: +5 -4 lines
Diff to previous 1.50 (colored)

Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@

Revision 1.50 / (download) - annotate - [select for diffs], Sat Sep 14 17:47:00 2019 UTC (4 years, 8 months ago) by semarie
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.49: +3 -2 lines
Diff to previous 1.49 (colored)

correct some unveil(2) violations due to "login.conf.db" access (the .db version
of "login.conf"), and stat(2) on _PATH_MASTERPASSWD_LOCK (via pw_mkdb(3)).

problem initially noted by myself for passwd(1)
millert@ reported similar problem on chpass(1), su(1), doas(1) and encrypt(1)
mestre@ noted chpass(1) too

ok mestre@ millert@

Revision 1.49 / (download) - annotate - [select for diffs], Fri Aug 3 04:47:56 2018 UTC (5 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.48: +2 -0 lines
Diff to previous 1.48 (colored)

The first unveil userland commit!

unveil _PATH_LOGIN_CONF (/etc/login.conf) which is used by
login_getclass(3) and family before doing password encode.  This
is the only filename used by the program during runtime, everything
else happens on stdin/stdout.

Revision 1.48 / (download) - annotate - [select for diffs], Fri Aug 3 04:19:34 2018 UTC (5 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored)

This does not need pledge "wpath"

Revision 1.47 / (download) - annotate - [select for diffs], Wed May 24 09:19:55 2017 UTC (6 years, 11 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.46: +2 -3 lines
Diff to previous 1.46 (colored)

Use freezero instead of explicit_bzero+free

OK tb@

Revision 1.46 / (download) - annotate - [select for diffs], Wed May 3 09:51:39 2017 UTC (7 years ago) by mestre
Branch: MAIN
Changes since 1.45: +2 -1 lines
Diff to previous 1.45 (colored)

Use the safe idiom of cleaning sensitive data from memory with explicit_bzero,
instead of relying on other methods, after readpassphrase. Some programs on
this diff won't benefit that much since it happens near the terminal path, but
someone might copy the unsafe idiom to another program and place it where it
may leak sensitive data.

Discussed aeons ago with tb@, OK deraadt@ and beck@

Revision 1.45 / (download) - annotate - [select for diffs], Sun Sep 4 15:36:13 2016 UTC (7 years, 8 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.44: +5 -4 lines
Diff to previous 1.44 (colored)

usage() is static and __dead; add prototype for print_passwd;
return instead of exit from main

Revision 1.44 / (download) - annotate - [select for diffs], Fri Sep 2 18:06:43 2016 UTC (7 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored)

_PASSWORD_LEN is length that comes out of crypt(), not a meaningful
length for user entered passwords. And the +1 is just superstitious
nonsense inherited from getpass() guts.
Switch to a pleasing fixed size of 1024.
ok millert

Revision 1.43 / (download) - annotate - [select for diffs], Fri Sep 2 17:06:59 2016 UTC (7 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.42: +7 -4 lines
Diff to previous 1.42 (colored)

convert getpass to readpassphrase. from Dimitris Papastamos

Revision 1.42 / (download) - annotate - [select for diffs], Sat Oct 10 18:14:20 2015 UTC (8 years, 7 months ago) by doug
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

encrypt(1) also needs to pledge "wpath" for getpass().

getpass() opens /dev/tty RW so it can write the prompt.

ok deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Sat Oct 10 17:59:15 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.40: +4 -1 lines
Diff to previous 1.40 (colored)

pledge "stdio rpath tty".  rpath for the configuration reading done by
login* subsystem, tty for readpassphase()
ok beck

Revision 1.40 / (download) - annotate - [select for diffs], Thu Feb 26 17:46:15 2015 UTC (9 years, 2 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.39: +7 -6 lines
Diff to previous 1.39 (colored)

Wrap a long line.  Use explicit_bzero.  Fix comment describing extra.
From Andre Smagin
Also, should be safe to print errno from newhash() now.
ok millert

Revision 1.39 / (download) - annotate - [select for diffs], Tue Feb 24 18:45:51 2015 UTC (9 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.38: +5 -3 lines
Diff to previous 1.38 (colored)

increase prefbuf size so that 'encrypt -b 000000000000000000000012' works.
noticed by Andre Smagin.
also check snprintf for overflow so we get better error messages if
somebody decides to pad with even more zeroes, and avoid possible
truncations.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Jan 15 17:34:15 2015 UTC (9 years, 4 months ago) by chl
Branch: MAIN
Changes since 1.37: +1 -2 lines
Diff to previous 1.37 (colored)

remove unused variable

ok tedu@

Revision 1.37 / (download) - annotate - [select for diffs], Mon Jan 5 14:07:12 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.36: +14 -54 lines
Diff to previous 1.36 (colored)

encrypt can use the scrypt scaling code in libc now via crypt_newhash

Revision 1.36 / (download) - annotate - [select for diffs], Sun Jan 4 02:28:26 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.35: +5 -4 lines
Diff to previous 1.35 (colored)

fix -b a mode, spotted by rpe

Revision 1.35 / (download) - annotate - [select for diffs], Mon Dec 29 17:07:17 2014 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

impose some limits on the ideal rounds so nothing too crazy happens when
the clock results are weird

Revision 1.34 / (download) - annotate - [select for diffs], Wed Dec 24 22:04:26 2014 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.33: +16 -66 lines
Diff to previous 1.33 (colored)

simplify. bcrypt only support and use newer libc APIs. no makekey emul.
ok deraadt
schwarze is a little sad to see the last 1/8 shared man page go, but we
have a support program in place, called the attic.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Nov 3 16:47:55 2014 UTC (9 years, 6 months ago) by tedu
Branch: MAIN
Changes since 1.32: +9 -6 lines
Diff to previous 1.32 (colored)

hoist blowfish up and use bcrypt_newhash directly

Revision 1.32 / (download) - annotate - [select for diffs], Wed Sep 3 08:26:00 2014 UTC (9 years, 8 months ago) by jmc
Branch: MAIN
Changes since 1.31: +2 -2 lines
Diff to previous 1.31 (colored)

remove -m from usage();

Revision 1.31 / (download) - annotate - [select for diffs], Wed Sep 3 07:47:50 2014 UTC (9 years, 8 months ago) by giovanni
Branch: MAIN
Changes since 1.30: +3 -18 lines
Diff to previous 1.30 (colored)


kill md5 support, broken since May
ok tedu@

Revision 1.30 / (download) - annotate - [select for diffs], Tue Nov 12 13:54:51 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

simpler prototype repairs

Revision 1.29 / (download) - annotate - [select for diffs], Thu May 23 01:33:08 2013 UTC (10 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.28: +39 -2 lines
Diff to previous 1.28 (colored)

allow auto scaling bcrypt rounds by CPU power.
ok deraadt jmc sthen

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jul 14 21:26:38 2007 UTC (16 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.27: +8 -27 lines
Diff to previous 1.27 (colored)

Don't trim whitespace from stdin. Encrypt it the same as other
input sources. Feedback and fixes from ray@ and fgsch@.

ok millert@ (six years ago) ray@ fgsch@

Revision 1.27 / (download) - annotate - [select for diffs], Tue May 1 01:26:25 2007 UTC (17 years ago) by jdixon
Branch: MAIN
Changes since 1.26: +6 -2 lines
Diff to previous 1.26 (colored)

use strtonum; ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 20 03:50:39 2007 UTC (17 years, 2 months ago) by tedu
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

remove some bogus *p tests from charles longeau
ok deraadt millert

Revision 1.25 / (download) - annotate - [select for diffs], Tue Mar 6 11:16:55 2007 UTC (17 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

tidy up synopsis and usage(); from Igor Sobrado

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 2 18:02:16 2006 UTC (17 years, 6 months ago) by ray
Branch: MAIN
Changes since 1.23: +4 -1 lines
Diff to previous 1.23 (colored)

There is no need to trim an empty string any further, just return
it.

OK moritz@.

Revision 1.23 / (download) - annotate - [select for diffs], Sat May 27 23:42:08 2006 UTC (17 years, 11 months ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.22: +5 -3 lines
Diff to previous 1.22 (colored)

Handle crypt(3) returning NULL. Found by Gustavo C. Pereira.

ok deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Sun Apr 2 04:13:07 2006 UTC (18 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

oops, to64() is shared.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jul 13 21:09:48 2004 UTC (19 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.20: +3 -5 lines
Diff to previous 1.20 (colored)

passwd.conf has been deprecated since login.conf was imported.
Today it finally dies.  Based on a diff from Gabriel Kihlman.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Nov 23 19:00:27 2003 UTC (20 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

Check getpass(3) return value. From Jared Yanovich <jjy2+ at pitt dot edu>

ok henning@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jul 2 21:04:09 2003 UTC (20 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.18: +5 -1 lines
Diff to previous 1.18 (colored)

protos

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jun 14 23:19:18 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.17: +12 -6 lines
Diff to previous 1.17 (colored)

Add a "-c class" option to specify that the given login class should
be used to find the cipher to user.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Apr 6 21:22:31 2003 UTC (21 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored)

strlcpy

Revision 1.16 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:45 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jul 31 18:30:38 2001 UTC (22 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.14: +163 -167 lines
Diff to previous 1.14 (colored)

KNF + some ANSIfication

Revision 1.14 / (download) - annotate - [select for diffs], Tue Jul 31 18:12:02 2001 UTC (22 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.13: +10 -3 lines
Diff to previous 1.13 (colored)

Call pwd_gensalt() with the correct args and reference login.conf
in man page; hideishi@magisystem.net

Revision 1.13 / (download) - annotate - [select for diffs], Sat Nov 11 15:34:25 2000 UTC (23 years, 6 months ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.12: +4 -4 lines
Diff to previous 1.12 (colored)

allow prompt to be specified anywhere on the command line, make it work
with md5.  prohibit makekey mode and prompt.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Nov 10 15:33:12 2000 UTC (23 years, 6 months ago) by provos
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

seperate -> separate, okay aaron@

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 3 18:13:37 1999 UTC (24 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.10: +1 -2 lines
Diff to previous 1.10 (colored)

proto bcrypt_gensalt()

Revision 1.10 / (download) - annotate - [select for diffs], Mon Aug 16 19:46:38 1999 UTC (24 years, 9 months ago) by art
Branch: MAIN
Changes since 1.9: +4 -2 lines
Diff to previous 1.9 (colored)

include ctype.h for isspace() and fix some declarations

Revision 1.9 / (download) - annotate - [select for diffs], Thu May 20 00:05:39 1999 UTC (25 years ago) by alex
Branch: MAIN
Changes since 1.8: +32 -16 lines
Diff to previous 1.8 (colored)

Add -p flag, prompt for a string with echo off.

Revision 1.8 / (download) - annotate - [select for diffs], Wed May 19 03:17:15 1999 UTC (25 years ago) by alex
Branch: MAIN
Changes since 1.7: +4 -2 lines
Diff to previous 1.7 (colored)

Use fprintf/exit in place of errx for usage display.

Revision 1.7 / (download) - annotate - [select for diffs], Tue Jun 17 21:03:40 1997 UTC (26 years, 11 months ago) by kstailey
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3, OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

add <stdlib.h> for atoi(), free(), etc.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Jun 17 21:01:01 1997 UTC (26 years, 11 months ago) by kstailey
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

(foo *)NULL -> NULL

Revision 1.5 / (download) - annotate - [select for diffs], Sun Mar 30 19:22:46 1997 UTC (27 years, 1 month ago) by provos
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1
Changes since 1.4: +90 -40 lines
Diff to previous 1.4 (colored)

blowfish + passwd.conf support. fixed md5 salt.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Mar 27 23:43:36 1997 UTC (27 years, 1 month ago) by downsj
Branch: MAIN
Changes since 1.3: +4 -2 lines
Diff to previous 1.3 (colored)

Fix core dump.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Aug 26 08:41:26 1996 UTC (27 years, 8 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.2: +40 -7 lines
Diff to previous 1.2 (colored)

Add an old makekey(8) mode.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Aug 8 04:37:02 1996 UTC (27 years, 9 months ago) by downsj
Branch: MAIN
Changes since 1.1: +22 -8 lines
Diff to previous 1.1 (colored)

Slightly cleaner.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Aug 8 02:07:22 1996 UTC (27 years, 9 months ago) by downsj
Branch: MAIN

encrypt(1), little utility for encrypting passwords from the command line.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.