[PATCH v1 0/6] common: Introduce crypt-style password support

Steffen Jaeckel jaeckel-floss at eyet-services.de
Mon Apr 26 14:19:11 CEST 2021


This patchset introduces support for crypt-style passwords to unlock
the console in autoboot mode.

The implementation of crypt-sha256 and crypt-sha512 originate from
libxcrypt at https://github.com/besser82/libxcrypt.git
Version v4.4.17
Git commit hash 6b110bc

I didn't re-format those two files to make diffing to the original
versions from libxcrypt easier, which leads to a huge load of
checkpatch.pl warnings&errors. Please advise on whether they should be
re-formatted or can be kept as is.

The remaining warnings from checkpatch.pl are intentional resp. open for
discussion.

Cheers,
Steffen

Changes in v1:
Added unit-tests of crypt_compare()
Wrapped crypt functions to encapsulate errno

Steffen Jaeckel (6):
  lib: add crypt subsystem
  lib: wrap crypt API to hide errno usage
  common: integrate crypt-based passwords
  common: Rename macro appropriately
  cmd: allow disabling of timeout for password entry
  configs: add new values to bcm963158 defconfig

 cmd/Kconfig                     |   8 +
 common/Kconfig.boot             |  23 ++-
 common/autoboot.c               | 109 ++++++++--
 configs/bcm963158_ram_defconfig |   8 +
 include/crypt.h                 |  14 ++
 lib/Kconfig                     |   1 +
 lib/Makefile                    |   1 +
 lib/crypt/Kconfig               |  29 +++
 lib/crypt/Makefile              |  10 +
 lib/crypt/alg-sha256.h          |  11 +
 lib/crypt/alg-sha512.h          |  11 +
 lib/crypt/crypt-port.h          |  30 +++
 lib/crypt/crypt-sha256.c        | 334 ++++++++++++++++++++++++++++++
 lib/crypt/crypt-sha512.c        | 349 ++++++++++++++++++++++++++++++++
 lib/crypt/crypt.c               |  76 +++++++
 test/Kconfig                    |   9 +
 test/lib/Makefile               |   1 +
 test/lib/test_crypt.c           |  64 ++++++
 18 files changed, 1068 insertions(+), 20 deletions(-)
 create mode 100644 include/crypt.h
 create mode 100644 lib/crypt/Kconfig
 create mode 100644 lib/crypt/Makefile
 create mode 100644 lib/crypt/alg-sha256.h
 create mode 100644 lib/crypt/alg-sha512.h
 create mode 100644 lib/crypt/crypt-port.h
 create mode 100644 lib/crypt/crypt-sha256.c
 create mode 100644 lib/crypt/crypt-sha512.c
 create mode 100644 lib/crypt/crypt.c
 create mode 100644 test/lib/test_crypt.c

-- 
2.31.1



More information about the U-Boot mailing list