summaryrefslogtreecommitdiffstats
path: root/lib/libc/crypt
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-11 09:18:27 +0000
committerguenther <guenther@openbsd.org>2015-09-11 09:18:27 +0000
commit89db3a204d87a918319b4ef97bce4540c64a667e (patch)
treeb536b5b296b2aea1c855688380200936f1c9cb06 /lib/libc/crypt
parentremove some more trailing whitespace (diff)
downloadwireguard-openbsd-89db3a204d87a918319b4ef97bce4540c64a667e.tar.xz
wireguard-openbsd-89db3a204d87a918319b4ef97bce4540c64a667e.zip
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
ok deraadt@
Diffstat (limited to 'lib/libc/crypt')
-rw-r--r--lib/libc/crypt/blowfish.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/crypt/blowfish.c b/lib/libc/crypt/blowfish.c
index c337df8a0a3..a658e602d24 100644
--- a/lib/libc/crypt/blowfish.c
+++ b/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 <provos@physnet.uni-hamburg.de>
@@ -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