From: tb Date: Fri, 28 Jul 2023 10:35:14 +0000 (+0000) Subject: Remove various ${thing}_options X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=158608366c6664ddcd098fa1ad27aa21aaadfc50;p=openbsd Remove various ${thing}_options Various, ancient ciphers exposed some of their innards via an _options() API. Apart from openssl version/speed, only some lua thingie in nmap ever looked at these. Go figure. hppa testing by miod, i386 testing by sthen. Thanks! ok jsing --- diff --git a/lib/libcrypto/Makefile b/lib/libcrypto/Makefile index a174cc1b204..7263b9845ab 100644 --- a/lib/libcrypto/Makefile +++ b/lib/libcrypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.148 2023/07/28 10:17:21 tb Exp $ +# $OpenBSD: Makefile,v 1.149 2023/07/28 10:35:14 tb Exp $ LIB= crypto LIBREBUILD=y @@ -75,7 +75,6 @@ SRCS+= aes_cfb.c SRCS+= aes_ctr.c SRCS+= aes_ecb.c SRCS+= aes_ige.c -SRCS+= aes_misc.c SRCS+= aes_ofb.c SRCS+= aes_wrap.c diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index cffee7e0001..da0c9c50f35 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -11,7 +11,6 @@ AES_ecb_encrypt AES_encrypt AES_ige_encrypt AES_ofb128_encrypt -AES_options AES_set_decrypt_key AES_set_encrypt_key AES_unwrap_key @@ -235,7 +234,6 @@ BF_decrypt BF_ecb_encrypt BF_encrypt BF_ofb64_encrypt -BF_options BF_set_key BIGNUM_it BIO_CONNECT_free @@ -460,7 +458,6 @@ BN_nnmod BN_num_bits BN_num_bits_word BN_one -BN_options BN_print BN_print_fp BN_pseudo_rand @@ -820,7 +817,6 @@ DES_key_sched DES_ncbc_encrypt DES_ofb64_encrypt DES_ofb_encrypt -DES_options DES_pcbc_encrypt DES_quad_cksum DES_random_key @@ -2240,7 +2236,6 @@ RC2_encrypt RC2_ofb64_encrypt RC2_set_key RC4 -RC4_options RC4_set_key RIPEMD160 RIPEMD160_Final @@ -3634,7 +3629,6 @@ idea_cfb64_encrypt idea_ecb_encrypt idea_encrypt idea_ofb64_encrypt -idea_options idea_set_decrypt_key idea_set_encrypt_key lh_delete diff --git a/lib/libcrypto/aes/aes_misc.c b/lib/libcrypto/aes/aes_misc.c index 4ed55b1e502..e69de29bb2d 100644 --- a/lib/libcrypto/aes/aes_misc.c +++ b/lib/libcrypto/aes/aes_misc.c @@ -1,65 +0,0 @@ -/* $OpenBSD: aes_misc.c,v 1.11 2022/11/26 16:08:50 tb Exp $ */ -/* ==================================================================== - * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - */ - -#include -#include -#include -#include "aes_local.h" - -const char * -AES_options(void) -{ -#ifdef FULL_UNROLL - return "aes(full)"; -#else - return "aes(partial)"; -#endif -} diff --git a/lib/libcrypto/bf/bf_ecb.c b/lib/libcrypto/bf/bf_ecb.c index 99e50b0ffe7..eda6f193b37 100644 --- a/lib/libcrypto/bf/bf_ecb.c +++ b/lib/libcrypto/bf/bf_ecb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_ecb.c,v 1.9 2022/11/26 16:08:51 tb Exp $ */ +/* $OpenBSD: bf_ecb.c,v 1.10 2023/07/28 10:35:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -67,18 +67,6 @@ * CAMBRIDGE SECURITY WORKSHOP, CAMBRIDGE, U.K., DECEMBER 9-11, 1993) */ -const char * -BF_options(void) -{ -#ifdef BF_PTR - return("blowfish(ptr)"); -#elif defined(BF_PTR2) - return("blowfish(ptr2)"); -#else - return("blowfish(idx)"); -#endif -} - void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, const BF_KEY *key, int encrypt) diff --git a/lib/libcrypto/bn/bn_lib.c b/lib/libcrypto/bn/bn_lib.c index 74359dab37c..c0c0ac876f4 100644 --- a/lib/libcrypto/bn/bn_lib.c +++ b/lib/libcrypto/bn/bn_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_lib.c,v 1.89 2023/07/08 12:21:58 beck Exp $ */ +/* $OpenBSD: bn_lib.c,v 1.90 2023/07/28 10:35:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -655,26 +655,6 @@ BN_is_negative(const BIGNUM *a) } LCRYPTO_ALIAS(BN_is_negative); -char * -BN_options(void) -{ - static int init = 0; - static char data[16]; - - if (!init) { - init++; -#ifdef BN_LLONG - snprintf(data,sizeof data, "bn(%d,%d)", - (int)sizeof(BN_ULLONG) * 8, (int)sizeof(BN_ULONG) * 8); -#else - snprintf(data,sizeof data, "bn(%d,%d)", - (int)sizeof(BN_ULONG) * 8, (int)sizeof(BN_ULONG) * 8); -#endif - } - return (data); -} -LCRYPTO_ALIAS(BN_options); - /* * Bits of security, see SP800-57, section 5.6.11, table 2. */ diff --git a/lib/libcrypto/idea/i_ecb.c b/lib/libcrypto/idea/i_ecb.c index 19521a75363..9f7db232b13 100644 --- a/lib/libcrypto/idea/i_ecb.c +++ b/lib/libcrypto/idea/i_ecb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i_ecb.c,v 1.6 2023/07/08 10:44:00 beck Exp $ */ +/* $OpenBSD: i_ecb.c,v 1.7 2023/07/28 10:35:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,16 +60,6 @@ #include "idea_local.h" #include -const char * -idea_options(void) -{ - if (sizeof(short) != sizeof(IDEA_INT)) - return ("idea(int)"); - else - return ("idea(short)"); -} -LCRYPTO_ALIAS(idea_options); - void idea_ecb_encrypt(const unsigned char *in, unsigned char *out, IDEA_KEY_SCHEDULE *ks) diff --git a/lib/libcrypto/rc4/asm/rc4-586.pl b/lib/libcrypto/rc4/asm/rc4-586.pl index 4991c37c2c1..bb30f9b88ff 100644 --- a/lib/libcrypto/rc4/asm/rc4-586.pl +++ b/lib/libcrypto/rc4/asm/rc4-586.pl @@ -384,32 +384,4 @@ $idx="edx"; &mov (&DWP(-4,$out),"eax"); # key->y=0; &function_end("RC4_set_key"); -# const char *RC4_options(void); -&static_label("opts"); -&function_begin_B("RC4_options"); - &picsetup("edx"); - &picsymbol("eax", &label("opts"), "edx"); - &picsymbol("edx", "OPENSSL_ia32cap_P", "edx");; - - &mov ("edx",&DWP(0,"edx")); - &bt ("edx","\$IA32CAP_BIT0_INTELP4"); - &jc (&label("1xchar")); - &bt ("edx","\$IA32CAP_BIT0_SSE2"); - &jnc (&label("ret")); - &add ("eax",25); - &ret (); -&set_label("1xchar"); - &add ("eax",12); -&set_label("ret"); - &ret (); -&function_end_B("RC4_options"); - - &rodataseg(); -&set_label("opts"); -&asciz ("rc4(4x,int)"); -&asciz ("rc4(1x,char)"); -&asciz ("rc4(8x,mmx)"); - &previous(); - &asm_finish(); - diff --git a/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl b/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl index 6d058bd9d4b..3190e6a8e76 100644 --- a/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl +++ b/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl @@ -491,19 +491,6 @@ RC4_set_key: mov %eax,-4($dat) ret .size RC4_set_key,.-RC4_set_key - -.globl RC4_options -.type RC4_options,\@abi-omnipotent -.align 16 -RC4_options: - endbr64 - lea .Lopts(%rip),%rax - ret -.align 64 -.Lopts: -.asciz "rc4(64x,int)" -.align 64 -.size RC4_options,.-RC4_options ___ } diff --git a/lib/libcrypto/rc4/asm/rc4-parisc.pl b/lib/libcrypto/rc4/asm/rc4-parisc.pl index 24e3e0c30ba..831d7859792 100644 --- a/lib/libcrypto/rc4/asm/rc4-parisc.pl +++ b/lib/libcrypto/rc4/asm/rc4-parisc.pl @@ -286,24 +286,6 @@ L\$2nd nop .PROCEND - .EXPORT RC4_options,ENTRY - .ALIGN 8 -RC4_options - .PROC - .CALLINFO NO_CALLS - .ENTRY -#ifdef __PIC__ - addil LT'L\$opts, %r19 - ldw RT'L\$opts(%r1), %r28 -#else - ldil L'L\$opts, %t1 - ldo R'L\$opts(%t1), %r28 -#endif - bv (%r2) - .EXIT - nop - .PROCEND - .section .rodata .ALIGN 8 L\$opts diff --git a/lib/libcrypto/rc4/asm/rc4-x86_64.pl b/lib/libcrypto/rc4/asm/rc4-x86_64.pl index 2bac7d744dd..0472acce8ad 100755 --- a/lib/libcrypto/rc4/asm/rc4-x86_64.pl +++ b/lib/libcrypto/rc4/asm/rc4-x86_64.pl @@ -503,33 +503,6 @@ RC4_set_key: mov %eax,-4($dat) ret .size RC4_set_key,.-RC4_set_key - -.globl RC4_options -.type RC4_options,\@abi-omnipotent -.align 16 -RC4_options: - endbr64 - lea .Lopts(%rip),%rax - mov OPENSSL_ia32cap_P(%rip),%edx - bt \$IA32CAP_BIT0_INTELP4,%edx - jc .L8xchar - bt \$IA32CAP_BIT0_INTEL,%edx - jnc .Ldone - add \$25,%rax - ret -.L8xchar: - add \$12,%rax -.Ldone: - ret -.section .rodata -.align 64 -.Lopts: -.asciz "rc4(8x,int)" -.asciz "rc4(8x,char)" -.asciz "rc4(16x,int)" -.align 64 -.text -.size RC4_options,.-RC4_options ___ sub reg_part { diff --git a/lib/libcrypto/rc4/rc4.h b/lib/libcrypto/rc4/rc4.h index f59185ed33a..7ebe232106b 100644 --- a/lib/libcrypto/rc4/rc4.h +++ b/lib/libcrypto/rc4/rc4.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4.h,v 1.13 2015/10/20 15:50:13 jsing Exp $ */ +/* $OpenBSD: rc4.h,v 1.14 2023/07/28 10:35:14 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,7 +76,6 @@ typedef struct rc4_key_st { RC4_INT data[256]; } RC4_KEY; -const char *RC4_options(void); void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); void private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, diff --git a/lib/libcrypto/rc4/rc4_skey.c b/lib/libcrypto/rc4/rc4_skey.c index e32a6e84a3f..5833c7bd07f 100644 --- a/lib/libcrypto/rc4/rc4_skey.c +++ b/lib/libcrypto/rc4/rc4_skey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4_skey.c,v 1.15 2022/11/26 16:08:54 tb Exp $ */ +/* $OpenBSD: rc4_skey.c,v 1.16 2023/07/28 10:35:14 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -57,24 +57,8 @@ */ #include -#include "rc4_local.h" -#include -const char * -RC4_options(void) -{ -#ifdef RC4_INDEX - if (sizeof(RC4_INT) == 1) - return("rc4(idx,char)"); - else - return("rc4(idx,int)"); -#else - if (sizeof(RC4_INT) == 1) - return("rc4(ptr,char)"); - else - return("rc4(ptr,int)"); -#endif -} +#include "rc4_local.h" /* RC4 as implemented from a posting from * Newsgroups: sci.crypt