From 49ecee098d062b92fcf095e05e15779c32899646 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 24 Jan 2017 16:00:54 +0100 Subject: tls: add 2nd cipher_id, TLS_RSA_WITH_AES_128_CBC_SHA, so far it doesn't work Good news that TLS_RSA_WITH_AES_256_CBC_SHA256 still works with new code ;) This change adds inevitable extension to have different sized hashes and AES key sizes. In libbb, md5_end() and shaX_end() are extended to return result size instead of void - this helps *a lot* in tls (the cost is ~5 bytes per _end() function). Signed-off-by: Denys Vlasenko --- libbb/pw_encrypt_sha.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libbb/pw_encrypt_sha.c') diff --git a/libbb/pw_encrypt_sha.c b/libbb/pw_encrypt_sha.c index 72e37e485..5457d7ab6 100644 --- a/libbb/pw_encrypt_sha.c +++ b/libbb/pw_encrypt_sha.c @@ -18,9 +18,10 @@ static char * NOINLINE sha_crypt(/*const*/ char *key_data, /*const*/ char *salt_data) { +#undef sha_end void (*sha_begin)(void *ctx) FAST_FUNC; void (*sha_hash)(void *ctx, const void *buffer, size_t len) FAST_FUNC; - void (*sha_end)(void *ctx, void *resbuf) FAST_FUNC; + unsigned (*sha_end)(void *ctx, void *resbuf) FAST_FUNC; int _32or64; char *result, *resptr; -- cgit v1.2.3