aboutsummaryrefslogtreecommitdiff
path: root/lib/crypt/crypt-port.h
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2021-07-08 15:57:34 +0200
committerTom Rini <trini@konsulko.com>2021-07-23 13:36:20 -0400
commit29bbe71ccfef3440b4881259c6f8e39b6e7924c6 (patch)
tree94cb413cee26ff74dd02e3b70ca42a378c6d2ae1 /lib/crypt/crypt-port.h
parent26dd9936574864155b989b9f14319ca2779f0598 (diff)
downloadu-boot-29bbe71ccfef3440b4881259c6f8e39b6e7924c6.zip
u-boot-29bbe71ccfef3440b4881259c6f8e39b6e7924c6.tar.gz
u-boot-29bbe71ccfef3440b4881259c6f8e39b6e7924c6.tar.bz2
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>
Diffstat (limited to 'lib/crypt/crypt-port.h')
-rw-r--r--lib/crypt/crypt-port.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/crypt/crypt-port.h b/lib/crypt/crypt-port.h
index 680ffe9..6b9542d 100644
--- a/lib/crypt/crypt-port.h
+++ b/lib/crypt/crypt-port.h
@@ -18,11 +18,13 @@ extern const unsigned char ascii64[65];
#define b64t ((const char *)ascii64)
-void crypt_sha256crypt_rn(const char *phrase, size_t phr_size,
- const char *setting, size_t ARG_UNUSED(set_size),
- uint8_t *output, size_t out_size, void *scratch,
- size_t scr_size);
-void crypt_sha512crypt_rn(const char *phrase, size_t phr_size,
- const char *setting, size_t ARG_UNUSED(set_size),
- uint8_t *output, size_t out_size, void *scratch,
- size_t scr_size);
+int crypt_sha256crypt_rn_wrapped(const char *phrase, size_t phr_size,
+ const char *setting,
+ size_t ARG_UNUSED(set_size), uint8_t *output,
+ size_t out_size, void *scratch,
+ size_t scr_size);
+int crypt_sha512crypt_rn_wrapped(const char *phrase, size_t phr_size,
+ const char *setting,
+ size_t ARG_UNUSED(set_size), uint8_t *output,
+ size_t out_size, void *scratch,
+ size_t scr_size);