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
Lint OK
No Unit Test Coverage
Build Status
Buildable 26495
Build 24906: arc lint + arc unit

Event Timeline

sg created this revision.Sep 6 2019, 6:10 AM
sg updated this revision to Diff 61801.Sep 8 2019, 2:19 AM

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.

bcr added a comment.Sep 10 2019, 7:03 PM

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!

bcr added a reviewer: emaste.Sep 13 2019, 6:14 PM

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.

sg updated this revision to Diff 62091.Sep 14 2019, 1:03 PM

Run enigma.c through FreeBSD clang-format

sg added a comment.Sep 14 2019, 1:04 PM

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

bcr accepted this revision as: manpages.Sep 14 2019, 1:05 PM

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