Skip to content

Commit 9278c98

Browse files
committed
Drop ed(1) "crypto"
You should not be using DES. You should not have been using DES for the past 30 years. The ed DES-CBC scheme lacked several desirable properties of a sealed document system, even ignoring DES itself. In particular, it did not provide the "integrity" cryptographic property (detection of tampering), and it treated ASCII passwords as 64-bit keys (instead of using a KDF like scrypt or PBKDF2). Some general approaches ed(1) users might consider to replace the removed DES mode: 1. Full disk encryption with something like AES-XTS. This is easy to conceptualize, design, and implement, and it provides confidentiality for data at rest. Like CBC, it lacks tampering protection. Examples include GELI, LUKS, FileVault2. 2. Encrypted overlay ("stackable") filesystems (EncFS, PEFS?, CryptoFS, others). 3. Native encryption at the filesystem layer. Ext4/F2FS, ZFS, APFS, and NTFS all have some flavor of this. 4. Storing your files unencrypted. It's not like DES was doing you much good. If you have DES-CBC scrambled files produced by ed(1) prior to this change, you may decrypt them with: openssl des-cbc -d -iv 0 -K <key in hex> -in <inputfile> -out <plaintext> Reviewed by: allanjude, bapt, emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D17829
1 parent 83e1dcf commit 9278c98

File tree

11 files changed

+11
-477
lines changed

11 files changed

+11
-477
lines changed

bin/ed/Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44

55
PACKAGE=runtime
66
PROG= ed
7-
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
7+
SRCS= buf.c glbl.c io.c main.c re.c sub.c undo.c
88
LINKS= ${BINDIR}/ed ${BINDIR}/red
99
MLINKS= ed.1 red.1
1010

11-
.if ${MK_OPENSSL} != "no" && ${MK_ED_CRYPTO} != "no"
12-
CFLAGS+=-DDES
13-
LIBADD= crypto
14-
.endif
15-
1611
.include <bsd.prog.mk>

bin/ed/POSIX

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,20 @@ EXTENSIONS
2525
iv) `z' for scrolling through the buffer, and
2626
v) BSD line addressing syntax (i.e., `^' and `%') is recognized.
2727

28-
2) If crypt(3) is available, files can be read and written using DES
29-
encryption. The `x' command prompts the user to enter a key used for
30-
encrypting/ decrypting subsequent reads and writes. If only a newline
31-
is entered as the key, then encryption is disabled. Otherwise, a key
32-
is read in the same manner as a password entry. The key remains in
33-
effect until encryption is disabled. For more information on the
34-
encryption algorithm, see the bdes(1) man page. Encryption/decryption
35-
should be fully compatible with SunOS des(1).
36-
37-
3) The POSIX interactive global commands `G' and `V' are extended to
28+
2) The POSIX interactive global commands `G' and `V' are extended to
3829
support multiple commands, including `a', `i' and `c'. The command
3930
format is the same as for the global commands `g' and `v', i.e., one
4031
command per line with each line, except for the last, ending in a
4132
backslash (\).
4233

43-
4) An extension to the POSIX file commands `E', `e', `r', `W' and `w' is
34+
3) An extension to the POSIX file commands `E', `e', `r', `W' and `w' is
4435
that <file> arguments are processed for backslash escapes, i.e., any
4536
character preceded by a backslash is interpreted literally. If the
4637
first unescaped character of a <file> argument is a bang (!), then the
4738
rest of the line is interpreted as a shell command, and no escape
4839
processing is performed by ed.
4940

50-
5) For SunOS ed(1) compatibility, ed runs in restricted mode if invoked
41+
4) For SunOS ed(1) compatibility, ed runs in restricted mode if invoked
5142
as red. This limits editing of files in the local directory only and
5243
prohibits shell commands.
5344

bin/ed/README

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ compile with little trouble. Otherwise, the macros SPL1() and SPL0()
99
should be redefined to disable interrupts.
1010

1111
The following compiler directives are recognized:
12-
DES - to add encryption support (requires crypt(3))
1312
NO_REALLOC_NULL - if realloc(3) does not accept a NULL pointer
1413
BACKWARDS - for backwards compatibility
1514
NEED_INSQUE - if insque(3) is missing

0 commit comments

Comments
 (0)