Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed a DES implementation rather than relying on lib(x)crypt #7

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Jun 20, 2021

  1. Don’t link against -lcrypt or -lcrypto. Preliminary Makefile cleanup.

    Since all of the cryptographic primitives required by asleap (DES,
    MD4, and SHA1) are obsolete, it is best to ship implementations
    ourselves rather than rely on external libraries that may deprecate
    them or remove them altogether.  SHA1 is already being supplied by
    sha1.c, but MD4 is optionally supplied by OpenSSL (libcrypto) and for
    DES we are relying on the obsolete SVID functions ‘encrypt’ and ‘setkey’.
    
    Remove the ifdefs in common.c and genkeys.c allowing for the use of
    OpenSSL’s implementation of MD4.  In the Makefile, remove both
    -lxcrypt and -lcrypto from LDLIBS, and add md4.o to the link for both
    asleap and genkeys.  This means the program will not compile right
    now, with undefined references to ‘encrypt’ and ‘setkey’—this will be
    corrected in the next commit.
    
    While we’re messing with the Makefile, overhaul it with proper use of
    object files, built-in rules and variables, and comprehensive .c:.h
    dependency lists.
    
    While we’re messing with the Makefile, eliminate the only place where
    we need a -D_LINUX by instead using __GNU_LIBRARY__ to detect the
    availability of <endian.h>.  This *may* mean makefile.cygwin is no
    longer necessary.  Will come back to that.
    zackw committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    667f3c5 View commit details
    Browse the repository at this point in the history
  2. Import DES implementation from libxcrypt.

    This implementation was originally written by David Burren for NetBSD
    and is therefore under a 3-clause BSD license.  By using it directly,
    the Expand and Collapse operations in utils.c cease to be necessary.
    zackw committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    5d255cb View commit details
    Browse the repository at this point in the history
  3. While we’re here, some linting.

    - Crank up the warnings level (-Wextra -Wpedantic -Wstrict-prototypes)
    - Explicitly request C2011 with extensions.
    - Explicitly request 64-bit off_t.
    - Fix all the resulting warnings.
    
    The only code change of note is that I deleted struct dot11_mgmt from
    ieee80211.h.  This was using the old GNU zero-length array extension
    in a way that is not supported for C99 flexible array members, and
    it’s unused in this program, so the easiest fix is to get rid of it.
    zackw committed Jun 20, 2021
    Configuration menu
    Copy the full SHA
    2bbb89a View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2021

  1. Realign the Cygwin makefile with the Unix makefile.

    The only differences are now:
    
     - use of .obj and .exe extensions instead of .o and null
     - -L$(WPDPACK)/lib -lwpcap instead of -lpcap
     - no ‘strip’ target
    zackw committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    2f2ddff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eb3bd42 View commit details
    Browse the repository at this point in the history