1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-10-21 01:51:11 +02:00

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>
This commit is contained in:
Steffen Jaeckel
2021-07-08 15:57:33 +02:00
committed by Tom Rini
parent c74675bd90
commit 26dd993657
14 changed files with 881 additions and 0 deletions

13
include/crypt.h Normal file
View File

@@ -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);