Page MenuHomeFreeBSD

enigma(1): Restyle code, fix salt bug, reword manual, other improvements
Needs ReviewPublic

Authored by sg on Sep 6 2019, 6:10 AM.


Group Reviewers

I was working on making a portable version of crypt and decided to use
the FreeBSD version. I cleaned up the source and fixed a small bug in
the process, which I've merged back here:

  • Reformat code to conform to style(9) guide.
  • Use getopt for option handling.
  • Replaced getpass(3) with the better readpassphrase(3).
  • Since we use the first two bits of the key as the salt, check if the key contains valid DES contains valid characters.
  • Replace error message code with err/x.
  • Change variable types to be more consistient.

Also, this is my first time using Phab. I may not get everything right.

Test Plan

I did not compile this, as I currently don't have access to a FreeBSD
dev machine. However, I did test the portable version using files
generated from a Solaris 10 machine, and they decrypted fine.

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 26495
Build 24906: arc lint + arc unit

Event Timeline

I setup my src tree on freefall and realised my work was very sloppy:
missing semicolons, incorrect function declarations and a subtle bug
with using err(). These are now fixed.

I also changed the manual slightly by adding dollar ('$') chars to code
that is to be run in the shell.

The man page looks good so far. Can you give it a run with "igor <path/to/manpage" and "mandoc -Tlint" to see if they emit any warnings?
@imp: Can you help review the code changes whether they make sense? Thank you!

Adding Ed, maybe he has time to review the code. I don't want to add the whole secteam yet...

I don't want to add the whole secteam yet...

I'll try to look at this, but there's no need for secteam's involvement in changes to this code.

Run enigma.c through FreeBSD clang-format

@bcr I already check my manuals with mandoc -Tlint and igor and can confirm that there are no warnings/errors.

OK, looks good to me from the manpage side of things.