lib: wrap crypt API to hide errno usage

In order to prevent using the global errno, replace it with a static
version and create a wrapper function which returns the error value.

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:34 +02:00 committed by Tom Rini
parent 26dd993657
commit 29bbe71ccf
8 changed files with 98 additions and 38 deletions

View file

@ -9,5 +9,6 @@
* @equal Pointer to an int where the result is stored
* '0' = unequal
* '1' = equal
* @return 0 on success, error code of errno else
*/
void crypt_compare(const char *should, const char *passphrase, int *equal);
int crypt_compare(const char *should, const char *passphrase, int *equal);