From 1a466ddc7986e4243a819ecb735187b80e3b57f4 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Mon, 3 Oct 2016 18:20:58 +0000 Subject: Remove setkey(), encrypt(), des_setkey() and des_cipher(). The setkey() and encrypt() functions are part of XSI, not the POSIX base definitions. There is no strict requirement for us to provide these, especially if we're only going to keep these around as undocumented stubs. The same holds for des_setkey() and des_cipher(). Instead of providing functions that only generate warnings when linking, simply disallow linking against them. The impact of this is relatively low. It only causes two leaf ports to break. I'll see what I can do to help out to get those fixed. PR: 211626 --- lib/libc/gen/crypt.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'lib/libc/gen/crypt.c') diff --git a/lib/libc/gen/crypt.c b/lib/libc/gen/crypt.c index ab1a79901225..d8e45cd21fa7 100644 --- a/lib/libc/gen/crypt.c +++ b/lib/libc/gen/crypt.c @@ -48,47 +48,41 @@ __FBSDID("$FreeBSD$"); * encryption, make sure you've got libcrypt.a around. */ -__warn_references(des_setkey, - "WARNING! des_setkey(3) not present in the system!"); - /* ARGSUSED */ int -des_setkey(const char *key __unused) +__freebsd11_des_setkey(const char *key __unused) { fprintf(stderr, "WARNING! des_setkey(3) not present in the system!\n"); return (0); } -__warn_references(des_cipher, - "WARNING! des_cipher(3) not present in the system!"); - /* ARGSUSED */ int -des_cipher(const char *in, char *out, long salt __unused, int num_iter __unused) +__freebsd11_des_cipher(const char *in, char *out, long salt __unused, + int num_iter __unused) { fprintf(stderr, "WARNING! des_cipher(3) not present in the system!\n"); bcopy(in, out, 8); return (0); } -__warn_references(setkey, - "WARNING! setkey(3) not present in the system!"); - /* ARGSUSED */ int -setkey(const char *key __unused) +__freebsd11_setkey(const char *key __unused) { fprintf(stderr, "WARNING! setkey(3) not present in the system!\n"); return (0); } -__warn_references(encrypt, - "WARNING! encrypt(3) not present in the system!"); - /* ARGSUSED */ int -encrypt(char *block __unused, int flag __unused) +__freebsd11_encrypt(char *block __unused, int flag __unused) { fprintf(stderr, "WARNING! encrypt(3) not present in the system!\n"); return (0); } + +__sym_compat(des_setkey, __freebsd11_des_setkey, FBSD_1.0); +__sym_compat(des_cipher, __freebsd11_des_cipher, FBSD_1.0); +__sym_compat(setkey, __freebsd11_setkey, FBSD_1.0); +__sym_compat(encrypt, __freebsd11_encrypt, FBSD_1.0); -- cgit v1.2.3