diff options
author | Steffen Jaeckel | 2021-07-08 15:57:33 +0200 |
---|---|---|
committer | Tom Rini | 2021-07-23 13:36:14 -0400 |
commit | 26dd9936574864155b989b9f14319ca2779f0598 (patch) | |
tree | 41fe3ce1471a80916ea6cc91d8a6e7c956c8e2d9 /include | |
parent | c74675bd904b6ce9d5820a80f27793c0583fd54c (diff) |
lib: add crypt subsystem
Add the basic functionality required to support the standard crypt
format.
The files crypt-sha256.c and crypt-sha512.c originate from libxcrypt and
their formatting is therefor retained.
The integration is done via a crypt_compare() function in crypt.c.
```
libxcrypt $ git describe --long --always --all
tags/v4.4.17-0-g6b110bc
```
Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/crypt.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/crypt.h b/include/crypt.h new file mode 100644 index 00000000000..e0be2832ff2 --- /dev/null +++ b/include/crypt.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* Copyright (C) 2020 Steffen Jaeckel <jaeckel-floss@eyet-services.de> */ + +/** + * Compare should with the processed passphrase. + * + * @should The crypt-style string to compare against + * @passphrase The plaintext passphrase + * @equal Pointer to an int where the result is stored + * '0' = unequal + * '1' = equal + */ +void crypt_compare(const char *should, const char *passphrase, int *equal); |