From b0404dc3aed5b42933d7f9650d2a9f6e0620f34c Mon Sep 17 00:00:00 2001 From: guenther <> Date: Fri, 11 Sep 2015 09:18:27 +0000 Subject: Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct ok deraadt@ --- src/lib/libc/crypt/blowfish.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/crypt') diff --git a/src/lib/libc/crypt/blowfish.c b/src/lib/libc/crypt/blowfish.c index c337df8a0a..a658e602d2 100644 --- a/src/lib/libc/crypt/blowfish.c +++ b/src/lib/libc/crypt/blowfish.c @@ -1,4 +1,4 @@ -/* $OpenBSD: blowfish.c,v 1.18 2004/11/02 17:23:26 hshoexer Exp $ */ +/* $OpenBSD: blowfish.c,v 1.19 2015/09/11 09:18:27 guenther Exp $ */ /* * Blowfish block cipher for OpenBSD * Copyright 1997 Niels Provos @@ -87,6 +87,7 @@ Blowfish_encipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) *xl = Xr ^ p[17]; *xr = Xl; } +DEF_WEAK(Blowfish_encipher); void Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) @@ -112,6 +113,7 @@ Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) *xl = Xr ^ p[0]; *xr = Xl; } +DEF_WEAK(Blowfish_decipher); void Blowfish_initstate(blf_ctx *c) @@ -391,6 +393,7 @@ Blowfish_initstate(blf_ctx *c) *c = initstate; } +DEF_WEAK(Blowfish_initstate); u_int32_t Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, @@ -412,6 +415,7 @@ Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, *current = j; return temp; } +DEF_WEAK(Blowfish_stream2word); void Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) @@ -449,6 +453,7 @@ Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) } } } +DEF_WEAK(Blowfish_expand0state); void @@ -493,6 +498,7 @@ Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, } } +DEF_WEAK(Blowfish_expandstate); void blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) @@ -503,6 +509,7 @@ blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) /* Transform S-boxes and subkeys with key */ Blowfish_expand0state(c, k, len); } +DEF_WEAK(blf_key); void blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) @@ -516,6 +523,7 @@ blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) d += 2; } } +DEF_WEAK(blf_enc); void blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) @@ -529,6 +537,7 @@ blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) d += 2; } } +DEF_WEAK(blf_dec); void blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) @@ -551,6 +560,7 @@ blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) data += 8; } } +DEF_WEAK(blf_ecb_encrypt); void blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) @@ -573,6 +583,7 @@ blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) data += 8; } } +DEF_WEAK(blf_ecb_decrypt); void blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) @@ -598,6 +609,7 @@ blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) data += 8; } } +DEF_WEAK(blf_cbc_encrypt); void blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) @@ -639,6 +651,7 @@ blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) for (j = 0; j < 8; j++) data[j] ^= iva[j]; } +DEF_WEAK(blf_cbc_decrypt); #if 0 void -- cgit v1.2.3-55-g6feb