From 2d743fc5aa584fdc90ba9360f9d17e79b7f963ef Mon Sep 17 00:00:00 2001 From: purplerain Date: Wed, 10 Apr 2024 21:48:14 +0000 Subject: [PATCH] sync with OpenBSD -current --- distrib/armv7/miniroot/Makefile | 2 +- distrib/armv7/miniroot/Makefile.inc | 6 +- distrib/armv7/miniroot/cubie/Makefile | 8 - distrib/armv7/ramdisk/install.md | 8 +- distrib/armv7/ramdisk/list | 6 +- distrib/notes/armv7/contents | 6 +- etc/etc.armv7/Makefile.inc | 5 +- lib/libcrypto/Symbols.namespace | 725 ++++++++++++++++-- lib/libcrypto/asn1/a_pkey.c | 5 +- lib/libcrypto/asn1/a_pubkey.c | 4 +- lib/libcrypto/asn1/a_strex.c | 4 +- lib/libcrypto/asn1/a_time_tm.c | 24 +- lib/libcrypto/asn1/asn1.h | 8 +- lib/libcrypto/asn1/asn1_item.c | 6 +- lib/libcrypto/asn1/asn1_old.c | 3 +- lib/libcrypto/asn1/p8_pkey.c | 10 +- lib/libcrypto/asn1/t_crl.c | 4 +- lib/libcrypto/asn1/t_req.c | 5 +- lib/libcrypto/asn1/t_spki.c | 3 +- lib/libcrypto/asn1/t_x509.c | 10 +- lib/libcrypto/asn1/x_algor.c | 12 +- lib/libcrypto/asn1/x_attrib.c | 8 +- lib/libcrypto/asn1/x_crl.c | 31 +- lib/libcrypto/asn1/x_exten.c | 9 +- lib/libcrypto/asn1/x_info.c | 4 +- lib/libcrypto/asn1/x_name.c | 14 +- lib/libcrypto/asn1/x_pkey.c | 4 +- lib/libcrypto/asn1/x_pubkey.c | 35 +- lib/libcrypto/asn1/x_req.c | 13 +- lib/libcrypto/asn1/x_sig.c | 8 +- lib/libcrypto/asn1/x_spki.c | 10 +- lib/libcrypto/asn1/x_val.c | 6 +- lib/libcrypto/asn1/x_x509.c | 20 +- lib/libcrypto/asn1/x_x509a.c | 10 +- lib/libcrypto/bn/bn.h | 11 +- lib/libcrypto/bn/bn_div.c | 3 +- lib/libcrypto/bn/bn_exp.c | 4 +- lib/libcrypto/bn/bn_gcd.c | 10 +- lib/libcrypto/bn/bn_local.h | 3 +- lib/libcrypto/conf/conf_def.c | 4 +- lib/libcrypto/conf/conf_err.c | 3 +- lib/libcrypto/conf/conf_lib.c | 24 +- lib/libcrypto/conf/conf_mall.c | 3 +- lib/libcrypto/conf/conf_mod.c | 19 +- lib/libcrypto/conf/conf_sap.c | 4 +- lib/libcrypto/cryptlib.c | 25 +- lib/libcrypto/crypto.h | 12 +- lib/libcrypto/crypto_init.c | 7 +- lib/libcrypto/ec/ec.h | 10 +- lib/libcrypto/ec/ec_lib.c | 10 +- lib/libcrypto/ec/ec_oct.c | 3 +- lib/libcrypto/evp/bio_b64.c | 3 +- lib/libcrypto/evp/bio_enc.c | 4 +- lib/libcrypto/evp/bio_md.c | 3 +- lib/libcrypto/evp/e_aes.c | 42 +- lib/libcrypto/evp/e_bf.c | 6 +- lib/libcrypto/evp/e_camellia.c | 20 +- lib/libcrypto/evp/e_cast.c | 6 +- lib/libcrypto/evp/e_chacha.c | 3 +- lib/libcrypto/evp/e_chacha20poly1305.c | 5 +- lib/libcrypto/evp/e_des.c | 8 +- lib/libcrypto/evp/e_des3.c | 14 +- lib/libcrypto/evp/e_idea.c | 6 +- lib/libcrypto/evp/e_null.c | 3 +- lib/libcrypto/evp/e_rc2.c | 8 +- lib/libcrypto/evp/e_rc4.c | 4 +- lib/libcrypto/evp/e_sm4.c | 7 +- lib/libcrypto/evp/e_xcbc_d.c | 3 +- lib/libcrypto/evp/evp.h | 12 +- lib/libcrypto/evp/evp_aead.c | 12 +- lib/libcrypto/evp/evp_cipher.c | 63 +- lib/libcrypto/evp/evp_digest.c | 30 +- lib/libcrypto/evp/evp_encode.c | 12 +- lib/libcrypto/evp/evp_err.c | 3 +- lib/libcrypto/evp/evp_key.c | 7 +- lib/libcrypto/evp/evp_names.c | 9 +- lib/libcrypto/evp/evp_pbe.c | 4 +- lib/libcrypto/evp/evp_pkey.c | 13 +- lib/libcrypto/evp/m_md4.c | 3 +- lib/libcrypto/evp/m_md5.c | 3 +- lib/libcrypto/evp/m_md5_sha1.c | 3 +- lib/libcrypto/evp/m_null.c | 3 +- lib/libcrypto/evp/m_ripemd.c | 3 +- lib/libcrypto/evp/m_sha1.c | 9 +- lib/libcrypto/evp/m_sha3.c | 6 +- lib/libcrypto/evp/m_sigver.c | 8 +- lib/libcrypto/evp/m_sm3.c | 3 +- lib/libcrypto/evp/m_wp.c | 3 +- lib/libcrypto/evp/p_legacy.c | 8 +- lib/libcrypto/evp/p_lib.c | 48 +- lib/libcrypto/evp/p_sign.c | 3 +- lib/libcrypto/evp/p_verify.c | 3 +- lib/libcrypto/evp/pmeth_fn.c | 15 +- lib/libcrypto/evp/pmeth_gn.c | 13 +- lib/libcrypto/evp/pmeth_lib.c | 16 +- lib/libcrypto/hidden/openssl/asn1.h | 4 +- lib/libcrypto/hidden/openssl/bn.h | 7 +- lib/libcrypto/hidden/openssl/conf.h | 74 ++ lib/libcrypto/hidden/openssl/crypto.h | 33 +- lib/libcrypto/hidden/openssl/ec.h | 11 +- lib/libcrypto/hidden/openssl/evp.h | 383 +++++++++ lib/libcrypto/hidden/openssl/rand.h | 12 +- lib/libcrypto/hidden/openssl/x509.h | 196 ++++- lib/libcrypto/malloc-wrapper.c | 5 +- lib/libcrypto/mem_clr.c | 3 +- lib/libcrypto/mem_dbg.c | 3 +- lib/libcrypto/o_fips.c | 4 +- lib/libcrypto/rand/rand.h | 4 +- lib/libcrypto/rand/rand_lib.c | 9 +- lib/libcrypto/rand/randfile.c | 5 +- lib/libcrypto/x509/x509_purp.c | 9 +- regress/lib/libcrypto/bn/Makefile | 3 +- regress/lib/libcrypto/bn/bn_bits.c | 227 ++++++ regress/lib/libcrypto/bn/bn_convert.c | 131 +++- regress/lib/libcrypto/symbols/symbols.awk | 24 +- .../lib/libcrypto/whirlpool/whirlpool_test.c | 120 +-- regress/sys/arch/amd64/vmm/vcpu.c | 193 +++-- regress/usr.sbin/bgpd/config/Makefile | 4 +- regress/usr.sbin/bgpd/config/bgpd.conf.12.ok | 3 + regress/usr.sbin/bgpd/config/bgpd.conf.13.ok | 12 + regress/usr.sbin/bgpd/config/bgpd.conf.15.ok | 2 + regress/usr.sbin/bgpd/config/bgpd.conf.16.in | 59 ++ regress/usr.sbin/bgpd/config/bgpd.conf.16.ok | 53 ++ regress/usr.sbin/bgpd/config/bgpd.conf.3.ok | 1 + regress/usr.sbin/bgpd/config/bgpd.conf.4.ok | 10 + .../usr.sbin/bgpd/integrationtests/Makefile | 7 +- .../integrationtests/bgpd.capa.client.conf | 20 + .../integrationtests/bgpd.capa.master.conf | 40 + .../usr.sbin/bgpd/integrationtests/capa.sh | 140 ++++ sbin/iked/proc.c | 25 +- share/man/man4/acpi.4 | 6 +- share/man/man4/pci.4 | 6 +- share/man/man4/ufshci.4 | 5 +- sys/arch/amd64/amd64/vmm_machdep.c | 172 +++-- sys/arch/amd64/include/vmmvar.h | 21 +- sys/conf/files | 4 +- sys/dev/pci/drm/i915/display/intel_fbdev.c | 35 +- sys/dev/pci/files.pci | 6 +- sys/dev/pci/ufshci_pci.c | 109 +++ sys/kern/kern_sig.c | 48 +- sys/kern/sys_generic.c | 12 +- sys/kern/uipc_socket.c | 12 +- sys/kern/uipc_socket2.c | 38 +- sys/kern/uipc_usrreq.c | 27 +- sys/lib/libkern/arch/alpha/htonl.S | 1 - sys/lib/libkern/arch/alpha/htons.S | 1 - sys/lib/libkern/arch/amd64/htonl.S | 53 -- sys/lib/libkern/arch/amd64/htons.S | 53 -- sys/lib/libkern/arch/arm/htonl.S | 43 -- sys/lib/libkern/arch/arm/htons.S | 42 - sys/lib/libkern/arch/i386/htonl.S | 47 -- sys/lib/libkern/arch/i386/htons.S | 45 -- sys/lib/libkern/arch/mips64/htonl.S | 59 -- sys/lib/libkern/arch/mips64/htons.S | 55 -- sys/lib/libkern/arch/sparc64/htonl.S | 46 -- sys/lib/libkern/arch/sparc64/htons.S | 45 -- sys/lib/libkern/htonl.c | 23 - sys/lib/libkern/htons.c | 23 - sys/net/if_wg.c | 3 +- sys/net/rtable.c | 3 +- sys/net/rtable.h | 3 +- sys/netinet/ip_output.c | 6 +- sys/netinet6/ip6_output.c | 9 +- sys/sys/proc.h | 8 +- sys/sys/socketvar.h | 7 +- sys/uvm/uvm_aobj.c | 7 +- sys/uvm/uvm_pdaemon.c | 30 +- usr.bin/make/engine.c | 4 +- usr.bin/make/timestamp.c | 8 +- usr.bin/make/timestamp.h | 8 +- usr.bin/tmux/input.c | 6 +- usr.bin/tmux/options-table.c | 10 +- usr.bin/tmux/server-client.c | 9 +- usr.bin/tmux/tmux.1 | 10 +- usr.bin/tmux/tmux.h | 4 +- usr.bin/tmux/window.c | 4 +- usr.sbin/bgpd/bgpd.c | 12 +- usr.sbin/bgpd/bgpd.conf.5 | 39 +- usr.sbin/bgpd/bgpd.h | 6 +- usr.sbin/bgpd/parse.y | 52 +- usr.sbin/bgpd/printconf.c | 54 +- usr.sbin/bgpd/rtr.c | 10 +- usr.sbin/bgpd/rtr_proto.c | 30 +- usr.sbin/bgpd/session.c | 120 ++- usr.sbin/httpd/proc.c | 25 +- usr.sbin/snmpd/proc.c | 25 +- usr.sbin/vmctl/main.c | 4 +- usr.sbin/vmd/proc.c | 25 +- usr.sbin/vmd/vm.c | 9 +- 189 files changed, 3737 insertions(+), 1337 deletions(-) delete mode 100644 distrib/armv7/miniroot/cubie/Makefile create mode 100644 lib/libcrypto/hidden/openssl/conf.h create mode 100644 lib/libcrypto/hidden/openssl/evp.h create mode 100644 regress/lib/libcrypto/bn/bn_bits.c create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.16.in create mode 100644 regress/usr.sbin/bgpd/config/bgpd.conf.16.ok create mode 100644 regress/usr.sbin/bgpd/integrationtests/bgpd.capa.client.conf create mode 100644 regress/usr.sbin/bgpd/integrationtests/bgpd.capa.master.conf create mode 100644 regress/usr.sbin/bgpd/integrationtests/capa.sh create mode 100644 sys/dev/pci/ufshci_pci.c delete mode 100644 sys/lib/libkern/arch/alpha/htonl.S delete mode 100644 sys/lib/libkern/arch/alpha/htons.S delete mode 100644 sys/lib/libkern/arch/amd64/htonl.S delete mode 100644 sys/lib/libkern/arch/amd64/htons.S delete mode 100644 sys/lib/libkern/arch/arm/htonl.S delete mode 100644 sys/lib/libkern/arch/arm/htons.S delete mode 100644 sys/lib/libkern/arch/i386/htonl.S delete mode 100644 sys/lib/libkern/arch/i386/htons.S delete mode 100644 sys/lib/libkern/arch/mips64/htonl.S delete mode 100644 sys/lib/libkern/arch/mips64/htons.S delete mode 100644 sys/lib/libkern/arch/sparc64/htonl.S delete mode 100644 sys/lib/libkern/arch/sparc64/htons.S delete mode 100644 sys/lib/libkern/htonl.c delete mode 100644 sys/lib/libkern/htons.c diff --git a/distrib/armv7/miniroot/Makefile b/distrib/armv7/miniroot/Makefile index be9f3615c..cf5337e6c 100644 --- a/distrib/armv7/miniroot/Makefile +++ b/distrib/armv7/miniroot/Makefile @@ -1,3 +1,3 @@ -SUBDIR= am335x cubie cubox nitrogen panda wandboard +SUBDIR= am335x cubox nitrogen panda wandboard .include diff --git a/distrib/armv7/miniroot/Makefile.inc b/distrib/armv7/miniroot/Makefile.inc index 0dc15a799..ad4a0d6f8 100644 --- a/distrib/armv7/miniroot/Makefile.inc +++ b/distrib/armv7/miniroot/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.32 2023/09/25 16:42:19 sthen Exp $ +# $OpenBSD: Makefile.inc,v 1.33 2024/04/09 11:13:51 kettenis Exp $ FS= miniroot-${BOARD}-${OSrev}.img FSSIZE= 71424 # ffs+msdos, actually @@ -38,10 +38,6 @@ ${FS}: bsd.rd dd if=${PUBOOT}/${UBOOT}/u-boot.img of=/dev/r`cat vnd`c \ bs=1024 seek=69 conv=sync .endif -.if ${PLATFORM} == "SUNXI" - dd if=${PUBOOT}/${UBOOT}/u-boot-sunxi-with-spl.bin \ - of=/dev/r`cat vnd`c bs=1024 seek=8 conv=sync -.endif mkdir -p ${MOUNT_POINT}/efi/boot cp /usr/mdec/BOOTARM.EFI ${MOUNT_POINT}/efi/boot/bootarm.efi diff --git a/distrib/armv7/miniroot/cubie/Makefile b/distrib/armv7/miniroot/cubie/Makefile deleted file mode 100644 index 06014f023..000000000 --- a/distrib/armv7/miniroot/cubie/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -BOARD= cubie -PLATFORM=SUNXI -DTBDIR= allwinner/ -UBOOT= Cubieboard2 -DTBS=\ - sun7i-a20-cubieboard2.dtb - -.include "${.CURDIR}/../Makefile.inc" diff --git a/distrib/armv7/ramdisk/install.md b/distrib/armv7/ramdisk/install.md index 0283d1e94..1c5bed148 100644 --- a/distrib/armv7/ramdisk/install.md +++ b/distrib/armv7/ramdisk/install.md @@ -1,4 +1,4 @@ -# $OpenBSD: install.md,v 1.56 2023/04/20 19:42:52 kettenis Exp $ +# $OpenBSD: install.md,v 1.57 2024/04/09 11:13:51 kettenis Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. @@ -39,7 +39,6 @@ md_installboot() { case $(sysctl -n hw.product) in *AM335x*) _plat=am335x;; *OMAP4*) _plat=panda;; - *'Cubietech Cubieboard2'*) _plat=cubie;; *Cubox-i*|*HummingBoard*) _plat=cubox;; *Wandboard*) _plat=wandboard;; *Nitrogen6*|*'SABRE Lite'*) _plat=nitrogen;; @@ -79,11 +78,6 @@ md_installboot() { mkuboot -t script -a arm -o linux /tmp/i/boot.cmd \ /mnt/mnt/6x_bootscript ;; - cubie) - cp $_mdec/*.dtb /mnt/mnt/ - dd if=$_mdec/u-boot-sunxi-with-spl.bin of=/dev/${_disk}c \ - bs=1024 seek=8 status=none - ;; esac umount /mnt/mnt diff --git a/distrib/armv7/ramdisk/list b/distrib/armv7/ramdisk/list index 42c3f9f3d..9a63528d6 100644 --- a/distrib/armv7/ramdisk/list +++ b/distrib/armv7/ramdisk/list @@ -1,4 +1,4 @@ -# $OpenBSD: list,v 1.49 2023/09/25 16:42:19 sthen Exp $ +# $OpenBSD: list,v 1.50 2024/04/09 11:13:51 kettenis Exp $ SRCDIRS distrib/special @@ -116,10 +116,6 @@ COPY /usr/local/share/dtb/arm/ti/omap/am335x-evm.dtb usr/mdec/am335x/am335x-evm COPY /usr/local/share/dtb/arm/ti/omap/am335x-evmsk.dtb usr/mdec/am335x/am335x-evmsk.dtb COPY /usr/local/share/dtb/arm/ti/omap/am335x-icev2.dtb usr/mdec/am335x/am335x-icev2.dtb -MKDIR usr/mdec/cubie -COPY /usr/local/share/u-boot/Cubieboard2/u-boot-sunxi-with-spl.bin usr/mdec/cubie/u-boot-sunxi-with-spl.bin -COPY /usr/local/share/dtb/arm/allwinner/sun7i-a20-cubieboard2.dtb usr/mdec/cubie/sun7i-a20-cubieboard2.dtb - MKDIR usr/mdec/panda COPY /usr/local/share/u-boot/omap4_panda/MLO usr/mdec/panda/MLO COPY /usr/local/share/u-boot/omap4_panda/u-boot.img usr/mdec/panda/u-boot.img diff --git a/distrib/notes/armv7/contents b/distrib/notes/armv7/contents index 027cd122a..5e4966806 100644 --- a/distrib/notes/armv7/contents +++ b/distrib/notes/armv7/contents @@ -1,14 +1,10 @@ -dnl $OpenBSD: contents,v 1.16 2023/03/16 18:04:08 miod Exp $ +dnl $OpenBSD: contents,v 1.17 2024/04/09 11:13:51 kettenis Exp $ TopPart miniroot-am335x-{:--:}OSrev.img A miniroot filesystem to be used for installation; BeagleBone version. - miniroot-cubie-{:--:}OSrev.img - A miniroot filesystem to be used for - installation; Cubieboard2 version. - miniroot-cubox-{:--:}OSrev.img A miniroot filesystem to be used for installation; CuBox-i version. diff --git a/etc/etc.armv7/Makefile.inc b/etc/etc.armv7/Makefile.inc index f7d6128b9..dc67cbafe 100644 --- a/etc/etc.armv7/Makefile.inc +++ b/etc/etc.armv7/Makefile.inc @@ -1,10 +1,9 @@ -# $OpenBSD: Makefile.inc,v 1.17 2020/05/17 17:04:29 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.18 2024/04/09 11:13:51 kettenis Exp $ bootblocks: cp -p ${DESTDIR}/usr/mdec/BOOTARM.EFI ${RELEASEDIR} MDEXT= bsd.rd BOOTARM.EFI \ - miniroot-am335x-${OSrev}.img \ - miniroot-cubie-${OSrev}.img miniroot-cubox-${OSrev}.img \ + miniroot-am335x-${OSrev}.img miniroot-cubox-${OSrev}.img \ miniroot-nitrogen-${OSrev}.img miniroot-panda-${OSrev}.img \ miniroot-wandboard-${OSrev}.img diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index a9ac044b7..0abd5ef54 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -149,7 +149,6 @@ _libre_PKCS8_add_keyusage _libre_PKCS12_get_friendlyname _libre_PKCS12_verify_mac _libre_PKCS12_set_mac -_libre_PKCS12_setup_mac _libre_OPENSSL_asc2uni _libre_OPENSSL_uni2asc _libre_PKCS12_new @@ -582,25 +581,6 @@ _libre_X509_VERIFY_PARAM_get_count _libre_X509_VERIFY_PARAM_add0_table _libre_X509_VERIFY_PARAM_lookup _libre_X509_VERIFY_PARAM_table_cleanup -_libre_X509_policy_check -_libre_X509_policy_tree_free -_libre_X509_policy_tree_level_count -_libre_X509_policy_tree_get0_level -_libre_X509_policy_tree_get0_policies -_libre_X509_policy_tree_get0_user_policies -_libre_X509_policy_level_node_count -_libre_X509_policy_level_get0_node -_libre_X509_policy_node_get0_policy -_libre_X509_policy_node_get0_qualifiers -_libre_X509_policy_node_get0_parent -_libre_PROXY_POLICY_new -_libre_PROXY_POLICY_free -_libre_d2i_PROXY_POLICY -_libre_i2d_PROXY_POLICY -_libre_PROXY_CERT_INFO_EXTENSION_new -_libre_PROXY_CERT_INFO_EXTENSION_free -_libre_d2i_PROXY_CERT_INFO_EXTENSION -_libre_i2d_PROXY_CERT_INFO_EXTENSION _libre_BASIC_CONSTRAINTS_new _libre_BASIC_CONSTRAINTS_free _libre_d2i_BASIC_CONSTRAINTS @@ -1856,13 +1836,7 @@ _libre_CRYPTO_cleanup_all_ex_data _libre_CRYPTO_lock _libre_CRYPTO_add_lock _libre_CRYPTO_set_mem_functions -_libre_CRYPTO_set_locked_mem_functions _libre_CRYPTO_set_mem_ex_functions -_libre_CRYPTO_set_locked_mem_ex_functions -_libre_CRYPTO_set_mem_debug_functions -_libre_CRYPTO_realloc_clean -_libre_CRYPTO_remalloc -_libre_CRYPTO_set_mem_debug_options _libre_OpenSSLDie _libre_OPENSSL_cpu_caps _libre_OPENSSL_init_crypto @@ -2399,48 +2373,6 @@ _libre_DSA_meth_set1_name _libre_DSA_meth_set_sign _libre_DSA_meth_set_finish _libre_ERR_load_DSA_strings -_libre_Gost2814789_set_sbox -_libre_Gost2814789_set_key -_libre_Gost2814789_ecb_encrypt -_libre_Gost2814789_cfb64_encrypt -_libre_Gost2814789_cnt_encrypt -_libre_GOST_CIPHER_PARAMS_new -_libre_GOST_CIPHER_PARAMS_free -_libre_d2i_GOST_CIPHER_PARAMS -_libre_i2d_GOST_CIPHER_PARAMS -_libre_GOST2814789IMIT_Init -_libre_GOST2814789IMIT_Update -_libre_GOST2814789IMIT_Final -_libre_GOST2814789IMIT_Transform -_libre_GOST2814789IMIT -_libre_GOSTR341194_Init -_libre_GOSTR341194_Update -_libre_GOSTR341194_Final -_libre_GOSTR341194_Transform -_libre_GOSTR341194 -_libre_STREEBOG256_Init -_libre_STREEBOG256_Update -_libre_STREEBOG256_Final -_libre_STREEBOG256 -_libre_STREEBOG512_Init -_libre_STREEBOG512_Update -_libre_STREEBOG512_Final -_libre_STREEBOG512_Transform -_libre_STREEBOG512 -_libre_GOST_KEY_new -_libre_GOST_KEY_free -_libre_GOST_KEY_check_key -_libre_GOST_KEY_set_public_key_affine_coordinates -_libre_GOST_KEY_get0_group -_libre_GOST_KEY_set_group -_libre_GOST_KEY_get_digest -_libre_GOST_KEY_set_digest -_libre_GOST_KEY_get0_private_key -_libre_GOST_KEY_set_private_key -_libre_GOST_KEY_get0_public_key -_libre_GOST_KEY_set_public_key -_libre_GOST_KEY_get_size -_libre_ERR_load_GOST_strings _libre_CRYPTO_cbc128_encrypt _libre_CRYPTO_cbc128_decrypt _libre_CRYPTO_ctr128_encrypt @@ -2628,3 +2560,660 @@ _libre_AES_ctr128_encrypt _libre_AES_ige_encrypt _libre_AES_wrap_key _libre_AES_unwrap_key +_libre_EVP_MD_type +_libre_EVP_MD_pkey_type +_libre_EVP_MD_size +_libre_EVP_MD_block_size +_libre_EVP_MD_flags +_libre_EVP_MD_CTX_md +_libre_EVP_MD_CTX_md_data +_libre_EVP_MD_CTX_pkey_ctx +_libre_EVP_MD_CTX_set_pkey_ctx +_libre_EVP_CIPHER_nid +_libre_EVP_CIPHER_block_size +_libre_EVP_CIPHER_key_length +_libre_EVP_CIPHER_iv_length +_libre_EVP_CIPHER_flags +_libre_EVP_CIPHER_CTX_cipher +_libre_EVP_CIPHER_CTX_encrypting +_libre_EVP_CIPHER_CTX_nid +_libre_EVP_CIPHER_CTX_block_size +_libre_EVP_CIPHER_CTX_key_length +_libre_EVP_CIPHER_CTX_iv_length +_libre_EVP_CIPHER_CTX_get_iv +_libre_EVP_CIPHER_CTX_set_iv +_libre_EVP_CIPHER_CTX_copy +_libre_EVP_CIPHER_CTX_get_app_data +_libre_EVP_CIPHER_CTX_set_app_data +_libre_EVP_CIPHER_CTX_get_cipher_data +_libre_EVP_CIPHER_CTX_set_cipher_data +_libre_EVP_CIPHER_CTX_buf_noconst +_libre_EVP_CIPHER_CTX_flags +_libre_EVP_CIPHER_meth_new +_libre_EVP_CIPHER_meth_dup +_libre_EVP_CIPHER_meth_free +_libre_EVP_CIPHER_meth_set_iv_length +_libre_EVP_CIPHER_meth_set_flags +_libre_EVP_CIPHER_meth_set_impl_ctx_size +_libre_EVP_CIPHER_meth_set_init +_libre_EVP_CIPHER_meth_set_do_cipher +_libre_EVP_CIPHER_meth_set_cleanup +_libre_EVP_CIPHER_meth_set_set_asn1_params +_libre_EVP_CIPHER_meth_set_get_asn1_params +_libre_EVP_CIPHER_meth_set_ctrl +_libre_EVP_PKEY_new_raw_private_key +_libre_EVP_PKEY_new_raw_public_key +_libre_EVP_PKEY_get_raw_private_key +_libre_EVP_PKEY_get_raw_public_key +_libre_EVP_Cipher +_libre_EVP_MD_CTX_new +_libre_EVP_MD_CTX_free +_libre_EVP_MD_CTX_reset +_libre_EVP_MD_CTX_create +_libre_EVP_MD_CTX_destroy +_libre_EVP_MD_CTX_cleanup +_libre_EVP_MD_CTX_copy_ex +_libre_EVP_MD_CTX_set_flags +_libre_EVP_MD_CTX_clear_flags +_libre_EVP_MD_CTX_ctrl +_libre_EVP_MD_CTX_test_flags +_libre_EVP_DigestInit_ex +_libre_EVP_DigestUpdate +_libre_EVP_DigestFinal_ex +_libre_EVP_Digest +_libre_EVP_MD_CTX_copy +_libre_EVP_DigestInit +_libre_EVP_DigestFinal +_libre_EVP_read_pw_string +_libre_EVP_read_pw_string_min +_libre_EVP_set_pw_prompt +_libre_EVP_get_pw_prompt +_libre_EVP_BytesToKey +_libre_EVP_CIPHER_CTX_set_flags +_libre_EVP_CIPHER_CTX_clear_flags +_libre_EVP_CIPHER_CTX_test_flags +_libre_EVP_EncryptInit +_libre_EVP_EncryptInit_ex +_libre_EVP_EncryptUpdate +_libre_EVP_EncryptFinal_ex +_libre_EVP_DecryptInit +_libre_EVP_DecryptInit_ex +_libre_EVP_DecryptUpdate +_libre_EVP_DecryptFinal_ex +_libre_EVP_CipherInit +_libre_EVP_CipherInit_ex +_libre_EVP_CipherUpdate +_libre_EVP_CipherFinal_ex +_libre_EVP_SignFinal +_libre_EVP_VerifyFinal +_libre_EVP_DigestSignInit +_libre_EVP_DigestSignFinal +_libre_EVP_DigestSign +_libre_EVP_DigestVerifyInit +_libre_EVP_DigestVerifyFinal +_libre_EVP_DigestVerify +_libre_EVP_OpenInit +_libre_EVP_OpenFinal +_libre_EVP_SealInit +_libre_EVP_SealFinal +_libre_EVP_ENCODE_CTX_new +_libre_EVP_ENCODE_CTX_free +_libre_EVP_EncodeInit +_libre_EVP_EncodeUpdate +_libre_EVP_EncodeFinal +_libre_EVP_EncodeBlock +_libre_EVP_DecodeInit +_libre_EVP_DecodeUpdate +_libre_EVP_DecodeFinal +_libre_EVP_DecodeBlock +_libre_EVP_CIPHER_CTX_cleanup +_libre_EVP_CIPHER_CTX_new +_libre_EVP_CIPHER_CTX_free +_libre_EVP_CIPHER_CTX_reset +_libre_EVP_CIPHER_CTX_set_key_length +_libre_EVP_CIPHER_CTX_set_padding +_libre_EVP_CIPHER_CTX_ctrl +_libre_EVP_CIPHER_CTX_rand_key +_libre_BIO_f_md +_libre_BIO_f_base64 +_libre_BIO_f_cipher +_libre_BIO_set_cipher +_libre_EVP_md_null +_libre_EVP_md4 +_libre_EVP_md5 +_libre_EVP_md5_sha1 +_libre_EVP_sha1 +_libre_EVP_sha224 +_libre_EVP_sha256 +_libre_EVP_sha384 +_libre_EVP_sha512 +_libre_EVP_sha512_224 +_libre_EVP_sha512_256 +_libre_EVP_sha3_224 +_libre_EVP_sha3_256 +_libre_EVP_sha3_384 +_libre_EVP_sha3_512 +_libre_EVP_sm3 +_libre_EVP_ripemd160 +_libre_EVP_whirlpool +_libre_EVP_enc_null +_libre_EVP_des_ecb +_libre_EVP_des_ede +_libre_EVP_des_ede3 +_libre_EVP_des_ede_ecb +_libre_EVP_des_ede3_ecb +_libre_EVP_des_cfb64 +_libre_EVP_des_cfb1 +_libre_EVP_des_cfb8 +_libre_EVP_des_ede_cfb64 +_libre_EVP_des_ede3_cfb64 +_libre_EVP_des_ede3_cfb1 +_libre_EVP_des_ede3_cfb8 +_libre_EVP_des_ofb +_libre_EVP_des_ede_ofb +_libre_EVP_des_ede3_ofb +_libre_EVP_des_cbc +_libre_EVP_des_ede_cbc +_libre_EVP_des_ede3_cbc +_libre_EVP_desx_cbc +_libre_EVP_rc4 +_libre_EVP_rc4_40 +_libre_EVP_idea_ecb +_libre_EVP_idea_cfb64 +_libre_EVP_idea_ofb +_libre_EVP_idea_cbc +_libre_EVP_rc2_ecb +_libre_EVP_rc2_cbc +_libre_EVP_rc2_40_cbc +_libre_EVP_rc2_64_cbc +_libre_EVP_rc2_cfb64 +_libre_EVP_rc2_ofb +_libre_EVP_bf_ecb +_libre_EVP_bf_cbc +_libre_EVP_bf_cfb64 +_libre_EVP_bf_ofb +_libre_EVP_cast5_ecb +_libre_EVP_cast5_cbc +_libre_EVP_cast5_cfb64 +_libre_EVP_cast5_ofb +_libre_EVP_aes_128_ecb +_libre_EVP_aes_128_cbc +_libre_EVP_aes_128_cfb1 +_libre_EVP_aes_128_cfb8 +_libre_EVP_aes_128_cfb128 +_libre_EVP_aes_128_ofb +_libre_EVP_aes_128_ctr +_libre_EVP_aes_128_ccm +_libre_EVP_aes_128_gcm +_libre_EVP_aes_128_wrap +_libre_EVP_aes_128_xts +_libre_EVP_aes_192_ecb +_libre_EVP_aes_192_cbc +_libre_EVP_aes_192_cfb1 +_libre_EVP_aes_192_cfb8 +_libre_EVP_aes_192_cfb128 +_libre_EVP_aes_192_ofb +_libre_EVP_aes_192_ctr +_libre_EVP_aes_192_ccm +_libre_EVP_aes_192_gcm +_libre_EVP_aes_192_wrap +_libre_EVP_aes_256_ecb +_libre_EVP_aes_256_cbc +_libre_EVP_aes_256_cfb1 +_libre_EVP_aes_256_cfb8 +_libre_EVP_aes_256_cfb128 +_libre_EVP_aes_256_ofb +_libre_EVP_aes_256_ctr +_libre_EVP_aes_256_ccm +_libre_EVP_aes_256_gcm +_libre_EVP_aes_256_wrap +_libre_EVP_aes_256_xts +_libre_EVP_chacha20_poly1305 +_libre_EVP_camellia_128_ecb +_libre_EVP_camellia_128_cbc +_libre_EVP_camellia_128_cfb1 +_libre_EVP_camellia_128_cfb8 +_libre_EVP_camellia_128_cfb128 +_libre_EVP_camellia_128_ofb +_libre_EVP_camellia_192_ecb +_libre_EVP_camellia_192_cbc +_libre_EVP_camellia_192_cfb1 +_libre_EVP_camellia_192_cfb8 +_libre_EVP_camellia_192_cfb128 +_libre_EVP_camellia_192_ofb +_libre_EVP_camellia_256_ecb +_libre_EVP_camellia_256_cbc +_libre_EVP_camellia_256_cfb1 +_libre_EVP_camellia_256_cfb8 +_libre_EVP_camellia_256_cfb128 +_libre_EVP_camellia_256_ofb +_libre_EVP_chacha20 +_libre_EVP_sm4_ecb +_libre_EVP_sm4_cbc +_libre_EVP_sm4_cfb128 +_libre_EVP_sm4_ofb +_libre_EVP_sm4_ctr +_libre_OPENSSL_add_all_algorithms_noconf +_libre_OPENSSL_add_all_algorithms_conf +_libre_OpenSSL_add_all_ciphers +_libre_OpenSSL_add_all_digests +_libre_EVP_get_cipherbyname +_libre_EVP_get_digestbyname +_libre_EVP_cleanup +_libre_EVP_CIPHER_do_all +_libre_EVP_CIPHER_do_all_sorted +_libre_EVP_MD_do_all +_libre_EVP_MD_do_all_sorted +_libre_EVP_PKEY_decrypt_old +_libre_EVP_PKEY_encrypt_old +_libre_EVP_PKEY_type +_libre_EVP_PKEY_id +_libre_EVP_PKEY_base_id +_libre_EVP_PKEY_bits +_libre_EVP_PKEY_security_bits +_libre_EVP_PKEY_size +_libre_EVP_PKEY_set_type +_libre_EVP_PKEY_set_type_str +_libre_EVP_PKEY_assign +_libre_EVP_PKEY_get0 +_libre_EVP_PKEY_get0_hmac +_libre_EVP_PKEY_get0_RSA +_libre_EVP_PKEY_get1_RSA +_libre_EVP_PKEY_set1_RSA +_libre_EVP_PKEY_get0_DSA +_libre_EVP_PKEY_get1_DSA +_libre_EVP_PKEY_set1_DSA +_libre_EVP_PKEY_get0_DH +_libre_EVP_PKEY_get1_DH +_libre_EVP_PKEY_set1_DH +_libre_EVP_PKEY_get0_EC_KEY +_libre_EVP_PKEY_get1_EC_KEY +_libre_EVP_PKEY_set1_EC_KEY +_libre_EVP_PKEY_new +_libre_EVP_PKEY_free +_libre_EVP_PKEY_up_ref +_libre_d2i_PublicKey +_libre_i2d_PublicKey +_libre_d2i_PrivateKey +_libre_d2i_AutoPrivateKey +_libre_i2d_PrivateKey +_libre_EVP_PKEY_copy_parameters +_libre_EVP_PKEY_missing_parameters +_libre_EVP_PKEY_save_parameters +_libre_EVP_PKEY_cmp_parameters +_libre_EVP_PKEY_cmp +_libre_EVP_PKEY_print_public +_libre_EVP_PKEY_print_private +_libre_EVP_PKEY_print_params +_libre_EVP_PKEY_get_default_digest_nid +_libre_EVP_CIPHER_type +_libre_PKCS5_PBKDF2_HMAC_SHA1 +_libre_PKCS5_PBKDF2_HMAC +_libre_EVP_PKEY_asn1_get_count +_libre_EVP_PKEY_asn1_get0 +_libre_EVP_PKEY_asn1_find +_libre_EVP_PKEY_asn1_find_str +_libre_EVP_PKEY_asn1_get0_info +_libre_EVP_PKEY_get0_asn1 +_libre_EVP_PKEY_CTX_new +_libre_EVP_PKEY_CTX_new_id +_libre_EVP_PKEY_CTX_dup +_libre_EVP_PKEY_CTX_free +_libre_EVP_PKEY_CTX_ctrl +_libre_EVP_PKEY_CTX_ctrl_str +_libre_EVP_PKEY_CTX_get_operation +_libre_EVP_PKEY_CTX_set0_keygen_info +_libre_EVP_PKEY_new_mac_key +_libre_EVP_PKEY_new_CMAC_key +_libre_EVP_PKEY_CTX_set_data +_libre_EVP_PKEY_CTX_get_data +_libre_EVP_PKEY_CTX_get0_pkey +_libre_EVP_PKEY_CTX_get0_peerkey +_libre_EVP_PKEY_CTX_set_app_data +_libre_EVP_PKEY_CTX_get_app_data +_libre_EVP_PKEY_sign_init +_libre_EVP_PKEY_sign +_libre_EVP_PKEY_verify_init +_libre_EVP_PKEY_verify +_libre_EVP_PKEY_verify_recover_init +_libre_EVP_PKEY_verify_recover +_libre_EVP_PKEY_encrypt_init +_libre_EVP_PKEY_encrypt +_libre_EVP_PKEY_decrypt_init +_libre_EVP_PKEY_decrypt +_libre_EVP_PKEY_derive_init +_libre_EVP_PKEY_derive_set_peer +_libre_EVP_PKEY_derive +_libre_EVP_PKEY_paramgen_init +_libre_EVP_PKEY_paramgen +_libre_EVP_PKEY_keygen_init +_libre_EVP_PKEY_keygen +_libre_EVP_PKEY_check +_libre_EVP_PKEY_public_check +_libre_EVP_PKEY_param_check +_libre_EVP_PKEY_CTX_set_cb +_libre_EVP_PKEY_CTX_get_cb +_libre_EVP_PKEY_CTX_get_keygen_info +_libre_EVP_aead_aes_128_gcm +_libre_EVP_aead_aes_256_gcm +_libre_EVP_aead_chacha20_poly1305 +_libre_EVP_aead_xchacha20_poly1305 +_libre_EVP_AEAD_key_length +_libre_EVP_AEAD_nonce_length +_libre_EVP_AEAD_max_overhead +_libre_EVP_AEAD_max_tag_len +_libre_EVP_AEAD_CTX_new +_libre_EVP_AEAD_CTX_free +_libre_EVP_AEAD_CTX_init +_libre_EVP_AEAD_CTX_cleanup +_libre_EVP_AEAD_CTX_seal +_libre_EVP_AEAD_CTX_open +_libre_ERR_load_EVP_strings +_libre_X509_CRL_get_signature_nid +_libre_X509_CRL_get0_extensions +_libre_X509_CRL_get_version +_libre_X509_CRL_get0_lastUpdate +_libre_X509_CRL_get0_nextUpdate +_libre_X509_CRL_get_lastUpdate +_libre_X509_CRL_get_nextUpdate +_libre_X509_CRL_get_issuer +_libre_X509_CRL_get_REVOKED +_libre_X509_CRL_get0_signature +_libre_X509_CRL_get0_tbs_sigalg +_libre_X509_REQ_get_signature_nid +_libre_X509_REQ_get0_signature +_libre_X509_CRL_verify +_libre_NETSCAPE_SPKI_print +_libre_X509_signature_dump +_libre_X509_signature_print +_libre_d2i_RSA_PUBKEY_fp +_libre_i2d_RSA_PUBKEY_fp +_libre_d2i_DSA_PUBKEY_fp +_libre_i2d_DSA_PUBKEY_fp +_libre_d2i_EC_PUBKEY_fp +_libre_i2d_EC_PUBKEY_fp +_libre_i2d_PUBKEY_fp +_libre_d2i_PUBKEY_fp +_libre_d2i_RSA_PUBKEY_bio +_libre_i2d_RSA_PUBKEY_bio +_libre_d2i_DSA_PUBKEY_bio +_libre_i2d_DSA_PUBKEY_bio +_libre_d2i_EC_PUBKEY_bio +_libre_i2d_EC_PUBKEY_bio +_libre_i2d_PUBKEY_bio +_libre_d2i_PUBKEY_bio +_libre_X509_dup +_libre_X509_ATTRIBUTE_dup +_libre_X509_EXTENSION_dup +_libre_X509_CRL_dup +_libre_X509_REQ_dup +_libre_X509_ALGOR_dup +_libre_X509_ALGOR_set0 +_libre_X509_ALGOR_get0 +_libre_X509_ALGOR_cmp +_libre_X509_NAME_dup +_libre_X509_NAME_get0_der +_libre_X509_NAME_ENTRY_dup +_libre_X509_ALGOR_new +_libre_X509_ALGOR_free +_libre_d2i_X509_ALGOR +_libre_i2d_X509_ALGOR +_libre_d2i_X509_ALGORS +_libre_i2d_X509_ALGORS +_libre_X509_VAL_new +_libre_X509_VAL_free +_libre_d2i_X509_VAL +_libre_i2d_X509_VAL +_libre_X509_PUBKEY_new +_libre_X509_PUBKEY_free +_libre_d2i_X509_PUBKEY +_libre_i2d_X509_PUBKEY +_libre_X509_PUBKEY_set +_libre_X509_PUBKEY_get +_libre_X509_PUBKEY_get0 +_libre_i2d_PUBKEY +_libre_d2i_PUBKEY +_libre_i2d_RSA_PUBKEY +_libre_d2i_RSA_PUBKEY +_libre_i2d_DSA_PUBKEY +_libre_d2i_DSA_PUBKEY +_libre_i2d_EC_PUBKEY +_libre_d2i_EC_PUBKEY +_libre_X509_SIG_new +_libre_X509_SIG_free +_libre_d2i_X509_SIG +_libre_i2d_X509_SIG +_libre_X509_SIG_get0 +_libre_X509_SIG_getm +_libre_X509_REQ_INFO_new +_libre_X509_REQ_INFO_free +_libre_d2i_X509_REQ_INFO +_libre_i2d_X509_REQ_INFO +_libre_X509_REQ_new +_libre_X509_REQ_free +_libre_d2i_X509_REQ +_libre_i2d_X509_REQ +_libre_X509_ATTRIBUTE_new +_libre_X509_ATTRIBUTE_free +_libre_d2i_X509_ATTRIBUTE +_libre_i2d_X509_ATTRIBUTE +_libre_X509_ATTRIBUTE_create +_libre_X509_EXTENSION_new +_libre_X509_EXTENSION_free +_libre_d2i_X509_EXTENSION +_libre_i2d_X509_EXTENSION +_libre_d2i_X509_EXTENSIONS +_libre_i2d_X509_EXTENSIONS +_libre_X509_NAME_ENTRY_new +_libre_X509_NAME_ENTRY_free +_libre_d2i_X509_NAME_ENTRY +_libre_i2d_X509_NAME_ENTRY +_libre_X509_NAME_new +_libre_X509_NAME_free +_libre_d2i_X509_NAME +_libre_i2d_X509_NAME +_libre_X509_NAME_set +_libre_X509_CINF_new +_libre_X509_CINF_free +_libre_d2i_X509_CINF +_libre_i2d_X509_CINF +_libre_X509_new +_libre_X509_free +_libre_d2i_X509 +_libre_i2d_X509 +_libre_X509_get_ex_new_index +_libre_X509_set_ex_data +_libre_X509_get_ex_data +_libre_i2d_X509_AUX +_libre_d2i_X509_AUX +_libre_i2d_re_X509_tbs +_libre_X509_get0_signature +_libre_X509_get_signature_nid +_libre_X509_alias_set1 +_libre_X509_keyid_set1 +_libre_X509_alias_get0 +_libre_X509_keyid_get0 +_libre_X509_add1_trust_object +_libre_X509_add1_reject_object +_libre_X509_trust_clear +_libre_X509_reject_clear +_libre_X509_REVOKED_new +_libre_X509_REVOKED_free +_libre_X509_REVOKED_dup +_libre_d2i_X509_REVOKED +_libre_i2d_X509_REVOKED +_libre_X509_CRL_INFO_new +_libre_X509_CRL_INFO_free +_libre_d2i_X509_CRL_INFO +_libre_i2d_X509_CRL_INFO +_libre_X509_CRL_new +_libre_X509_CRL_free +_libre_d2i_X509_CRL +_libre_i2d_X509_CRL +_libre_X509_CRL_add0_revoked +_libre_X509_CRL_get0_by_serial +_libre_X509_CRL_get0_by_cert +_libre_X509_PKEY_new +_libre_X509_PKEY_free +_libre_NETSCAPE_SPKI_new +_libre_NETSCAPE_SPKI_free +_libre_d2i_NETSCAPE_SPKI +_libre_i2d_NETSCAPE_SPKI +_libre_NETSCAPE_SPKAC_new +_libre_NETSCAPE_SPKAC_free +_libre_d2i_NETSCAPE_SPKAC +_libre_i2d_NETSCAPE_SPKAC +_libre_X509_INFO_new +_libre_X509_INFO_free +_libre_ASN1_item_digest +_libre_ASN1_item_verify +_libre_ASN1_item_sign +_libre_ASN1_item_sign_ctx +_libre_X509_print_ex_fp +_libre_X509_print_fp +_libre_X509_CRL_print_fp +_libre_X509_REQ_print_fp +_libre_X509_NAME_print_ex_fp +_libre_X509_NAME_print +_libre_X509_NAME_print_ex +_libre_X509_print_ex +_libre_X509_print +_libre_X509_ocspid_print +_libre_X509_CRL_print +_libre_X509_REQ_print_ex +_libre_X509_REQ_print +_libre_EVP_PKEY_get_attr_count +_libre_EVP_PKEY_get_attr_by_NID +_libre_EVP_PKEY_get_attr_by_OBJ +_libre_EVP_PKEY_get_attr +_libre_EVP_PKEY_delete_attr +_libre_EVP_PKEY_add1_attr +_libre_EVP_PKEY_add1_attr_by_OBJ +_libre_EVP_PKEY_add1_attr_by_NID +_libre_EVP_PKEY_add1_attr_by_txt +_libre_PKCS8_PRIV_KEY_INFO_new +_libre_PKCS8_PRIV_KEY_INFO_free +_libre_d2i_PKCS8_PRIV_KEY_INFO +_libre_i2d_PKCS8_PRIV_KEY_INFO +_libre_EVP_PKCS82PKEY +_libre_EVP_PKEY2PKCS8 +_libre_PKCS8_pkey_set0 +_libre_PKCS8_pkey_get0 +_libre_PKCS8_pkey_get0_attrs +_libre_PKCS8_pkey_add1_attr_by_NID +_libre_X509_PUBKEY_set0_param +_libre_X509_PUBKEY_get0_param +_libre_CONF_set_default_method +_libre_CONF_set_nconf +_libre_CONF_load +_libre_CONF_load_fp +_libre_CONF_load_bio +_libre_CONF_get_section +_libre_CONF_get_string +_libre_CONF_get_number +_libre_CONF_free +_libre_CONF_dump_fp +_libre_CONF_dump_bio +_libre_OPENSSL_config +_libre_OPENSSL_no_config +_libre_NCONF_new +_libre_NCONF_default +_libre_NCONF_WIN32 +_libre_NCONF_free +_libre_NCONF_free_data +_libre_NCONF_load +_libre_NCONF_load_fp +_libre_NCONF_load_bio +_libre_NCONF_get_section +_libre_NCONF_get_string +_libre_NCONF_get_number_e +_libre_NCONF_dump_fp +_libre_NCONF_dump_bio +_libre_CONF_modules_load +_libre_CONF_modules_load_file +_libre_CONF_modules_unload +_libre_CONF_modules_finish +_libre_CONF_modules_free +_libre_CONF_module_add +_libre_CONF_imodule_get_name +_libre_CONF_imodule_get_value +_libre_CONF_imodule_get_usr_data +_libre_CONF_imodule_set_usr_data +_libre_CONF_imodule_get_module +_libre_CONF_imodule_get_flags +_libre_CONF_imodule_set_flags +_libre_CONF_module_get_usr_data +_libre_CONF_module_set_usr_data +_libre_CONF_get1_default_config_file +_libre_CONF_parse_list +_libre_OPENSSL_load_builtin_modules +_libre_ERR_load_CONF_strings +_libre_CRYPTO_mem_ctrl +_libre_CRYPTO_set_id_callback +_libre_CRYPTO_get_id_callback +_libre_CRYPTO_thread_id +_libre_CRYPTO_get_new_lockid +_libre_CRYPTO_get_lock_name +_libre_CRYPTO_num_locks +_libre_CRYPTO_set_locking_callback +_libre_CRYPTO_get_locking_callback +_libre_CRYPTO_set_add_lock_callback +_libre_CRYPTO_get_add_lock_callback +_libre_CRYPTO_THREADID_set_numeric +_libre_CRYPTO_THREADID_set_pointer +_libre_CRYPTO_THREADID_set_callback +_libre_CRYPTO_THREADID_get_callback +_libre_CRYPTO_get_new_dynlockid +_libre_CRYPTO_destroy_dynlockid +_libre_CRYPTO_get_dynlock_value +_libre_CRYPTO_set_dynlock_create_callback +_libre_CRYPTO_set_dynlock_lock_callback +_libre_CRYPTO_set_dynlock_destroy_callback +_libre_CRYPTO_get_dynlock_lock_callback +_libre_CRYPTO_get_dynlock_destroy_callback +_libre_CRYPTO_malloc +_libre_CRYPTO_strdup +_libre_CRYPTO_free +_libre_OPENSSL_cleanse +_libre_FIPS_mode +_libre_FIPS_mode_set +_libre_OPENSSL_init +_libre_CRYPTO_memcmp +_libre_RAND_cleanup +_libre_RAND_bytes +_libre_RAND_pseudo_bytes +_libre_RAND_seed +_libre_RAND_add +_libre_RAND_load_file +_libre_RAND_write_file +_libre_RAND_file_name +_libre_RAND_status +_libre_RAND_poll +_libre_RC2_set_key +_libre_RC2_ecb_encrypt +_libre_RC2_encrypt +_libre_RC2_decrypt +_libre_RC2_cbc_encrypt +_libre_RC2_cfb64_encrypt +_libre_RC2_ofb64_encrypt +_libre_BN_div +_libre_BN_mod_exp +_libre_BN_mod_exp_mont +_libre_BN_gcd +_libre_BN_mod_inverse +_libre_HMAC_Init +_libre_HMAC_CTX_reset +_libre_EVP_MD_CTX_init +_libre_EVP_EncryptFinal +_libre_EVP_DecryptFinal +_libre_EVP_CipherFinal +_libre_EVP_CIPHER_CTX_init +_libre_EC_GROUP_clear_free +_libre_EC_GROUP_set_curve_GFp +_libre_EC_GROUP_get_curve_GFp +_libre_EC_POINT_clear_free +_libre_EC_POINT_set_Jprojective_coordinates_GFp +_libre_EC_POINT_get_Jprojective_coordinates_GFp +_libre_EC_POINT_set_affine_coordinates_GFp +_libre_EC_POINT_get_affine_coordinates_GFp +_libre_EC_POINT_set_compressed_coordinates_GFp diff --git a/lib/libcrypto/asn1/a_pkey.c b/lib/libcrypto/asn1/a_pkey.c index 1e8ebc913..a73072807 100644 --- a/lib/libcrypto/asn1/a_pkey.c +++ b/lib/libcrypto/asn1/a_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_pkey.c,v 1.7 2023/11/19 15:46:09 tb Exp $ */ +/* $OpenBSD: a_pkey.c,v 1.8 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -115,6 +115,7 @@ d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) EVP_PKEY_free(ret); return (NULL); } +LCRYPTO_ALIAS(d2i_PrivateKey); int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) @@ -131,6 +132,7 @@ i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) ASN1error(ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); return (-1); } +LCRYPTO_ALIAS(i2d_PrivateKey); /* This works like d2i_PrivateKey() except it automatically works out the type */ @@ -176,3 +178,4 @@ d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, long length) sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); return d2i_PrivateKey(keytype, a, pp, length); } +LCRYPTO_ALIAS(d2i_AutoPrivateKey); diff --git a/lib/libcrypto/asn1/a_pubkey.c b/lib/libcrypto/asn1/a_pubkey.c index 5e022d34e..544f3d2cf 100644 --- a/lib/libcrypto/asn1/a_pubkey.c +++ b/lib/libcrypto/asn1/a_pubkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_pubkey.c,v 1.6 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: a_pubkey.c,v 1.7 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -136,6 +136,7 @@ d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) EVP_PKEY_free(ret); return (NULL); } +LCRYPTO_ALIAS(d2i_PublicKey); int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) @@ -158,3 +159,4 @@ i2d_PublicKey(EVP_PKEY *a, unsigned char **pp) return (-1); } } +LCRYPTO_ALIAS(i2d_PublicKey); diff --git a/lib/libcrypto/asn1/a_strex.c b/lib/libcrypto/asn1/a_strex.c index 17213cbd3..4ca0a092e 100644 --- a/lib/libcrypto/asn1/a_strex.c +++ b/lib/libcrypto/asn1/a_strex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_strex.c,v 1.34 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: a_strex.c,v 1.35 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -570,6 +570,7 @@ X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, return X509_NAME_print(out, nm, indent); return do_name_ex(send_bio_chars, out, nm, indent, flags); } +LCRYPTO_ALIAS(X509_NAME_print_ex); int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, @@ -587,6 +588,7 @@ X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, } return do_name_ex(send_fp_chars, fp, nm, indent, flags); } +LCRYPTO_ALIAS(X509_NAME_print_ex_fp); int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags) diff --git a/lib/libcrypto/asn1/a_time_tm.c b/lib/libcrypto/asn1/a_time_tm.c index c8eabec08..49d6ea209 100644 --- a/lib/libcrypto/asn1/a_time_tm.c +++ b/lib/libcrypto/asn1/a_time_tm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_time_tm.c,v 1.34 2024/04/08 19:57:40 beck Exp $ */ +/* $OpenBSD: a_time_tm.c,v 1.36 2024/04/10 14:55:12 beck Exp $ */ /* * Copyright (c) 2015 Bob Beck * @@ -344,21 +344,32 @@ ASN1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) static int ASN1_TIME_set_string_internal(ASN1_TIME *s, const char *str, int mode) { + ASN1_TIME *atime = s; struct tm tm; int type; + int ret = 0; if ((type = ASN1_time_parse(str, strlen(str), &tm, mode)) == -1) return (0); - switch(mode) { + switch (mode) { case V_ASN1_UTCTIME: - return (type == mode && tm_to_utctime(&tm, s) != NULL); + ret = (type == mode && (atime = tm_to_utctime(&tm, s)) != NULL); + break; case V_ASN1_GENERALIZEDTIME: - return (type == mode && tm_to_gentime(&tm, s) != NULL); + ret = (type == mode && (atime = tm_to_gentime(&tm, s)) != NULL); + break; case RFC5280: - return (tm_to_rfc5280_time(&tm, s) != NULL); + ret = ((atime = tm_to_rfc5280_time(&tm, s)) != NULL); + break; default: - return (0); + ret = 0; + break; } + + if (atime != s) + ASN1_TIME_free(atime); + + return ret; } static ASN1_TIME * @@ -541,6 +552,7 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) return ASN1_TIME_cmp_time_t_internal(s, t, V_ASN1_UTCTIME); return -2; } +LCRYPTO_ALIAS(ASN1_UTCTIME_cmp_time_t); /* * ASN1_GENERALIZEDTIME wrappers diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index 63458db94..aeabbc0a2 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.91 2024/03/02 09:08:41 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.92 2024/04/10 14:55:12 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -573,9 +573,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec); int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); -#ifndef LIBRESSL_INTERNAL int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); -#endif /* !LIBRESSL_INTERNAL */ int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, @@ -736,12 +734,8 @@ int ASN1_object_size(int constructed, int length, int tag); void *ASN1_item_dup(const ASN1_ITEM *it, void *x); -#ifndef LIBRESSL_INTERNAL - void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); -#endif /* !LIBRESSL_INTERNAL */ - void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ diff --git a/lib/libcrypto/asn1/asn1_item.c b/lib/libcrypto/asn1/asn1_item.c index 99a08698c..86c800e3a 100644 --- a/lib/libcrypto/asn1/asn1_item.c +++ b/lib/libcrypto/asn1/asn1_item.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_item.c,v 1.20 2024/01/28 14:43:48 joshua Exp $ */ +/* $OpenBSD: asn1_item.c,v 1.21 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -139,6 +139,7 @@ ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, free(str); return (1); } +LCRYPTO_ALIAS(ASN1_item_digest); /* * ASN1_ITEM version of ASN1_dup(): follows the same model except there's no @@ -237,6 +238,7 @@ ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, return ret; } +LCRYPTO_ALIAS(ASN1_item_sign); static int asn1_item_set_algorithm_identifiers(EVP_MD_CTX *ctx, X509_ALGOR *algor1, @@ -376,6 +378,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, return ret; } +LCRYPTO_ALIAS(ASN1_item_sign_ctx); int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, @@ -462,6 +465,7 @@ ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, return ret; } +LCRYPTO_ALIAS(ASN1_item_verify); #define HEADER_SIZE 8 #define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) diff --git a/lib/libcrypto/asn1/asn1_old.c b/lib/libcrypto/asn1/asn1_old.c index a9aeeb823..7992fccde 100644 --- a/lib/libcrypto/asn1/asn1_old.c +++ b/lib/libcrypto/asn1/asn1_old.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_old.c,v 1.5 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: asn1_old.c,v 1.6 2024/04/10 14:55:12 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -91,6 +91,7 @@ ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) free(b); return (ret); } +LCRYPTO_ALIAS(ASN1_dup); void * ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x) diff --git a/lib/libcrypto/asn1/p8_pkey.c b/lib/libcrypto/asn1/p8_pkey.c index 9e0cfc41d..149591414 100644 --- a/lib/libcrypto/asn1/p8_pkey.c +++ b/lib/libcrypto/asn1/p8_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p8_pkey.c,v 1.23 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: p8_pkey.c,v 1.24 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -121,24 +121,28 @@ d2i_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO **a, const unsigned char **in, long return (PKCS8_PRIV_KEY_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &PKCS8_PRIV_KEY_INFO_it); } +LCRYPTO_ALIAS(d2i_PKCS8_PRIV_KEY_INFO); int i2d_PKCS8_PRIV_KEY_INFO(PKCS8_PRIV_KEY_INFO *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS8_PRIV_KEY_INFO_it); } +LCRYPTO_ALIAS(i2d_PKCS8_PRIV_KEY_INFO); PKCS8_PRIV_KEY_INFO * PKCS8_PRIV_KEY_INFO_new(void) { return (PKCS8_PRIV_KEY_INFO *)ASN1_item_new(&PKCS8_PRIV_KEY_INFO_it); } +LCRYPTO_ALIAS(PKCS8_PRIV_KEY_INFO_new); void PKCS8_PRIV_KEY_INFO_free(PKCS8_PRIV_KEY_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, &PKCS8_PRIV_KEY_INFO_it); } +LCRYPTO_ALIAS(PKCS8_PRIV_KEY_INFO_free); int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, @@ -154,6 +158,7 @@ PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, int version, ASN1_STRING_set0(priv->pkey, penc, penclen); return 1; } +LCRYPTO_ALIAS(PKCS8_pkey_set0); int PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, @@ -169,12 +174,14 @@ PKCS8_pkey_get0(const ASN1_OBJECT **ppkalg, const unsigned char **pk, *pa = p8->pkeyalg; return 1; } +LCRYPTO_ALIAS(PKCS8_pkey_get0); const STACK_OF(X509_ATTRIBUTE) * PKCS8_pkey_get0_attrs(const PKCS8_PRIV_KEY_INFO *p8) { return p8->attributes; } +LCRYPTO_ALIAS(PKCS8_pkey_get0_attrs); int PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, @@ -185,3 +192,4 @@ PKCS8_pkey_add1_attr_by_NID(PKCS8_PRIV_KEY_INFO *p8, int nid, int type, return 1; return 0; } +LCRYPTO_ALIAS(PKCS8_pkey_add1_attr_by_NID); diff --git a/lib/libcrypto/asn1/t_crl.c b/lib/libcrypto/asn1/t_crl.c index d662d99ec..1ff6ea02a 100644 --- a/lib/libcrypto/asn1/t_crl.c +++ b/lib/libcrypto/asn1/t_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_crl.c,v 1.23 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: t_crl.c,v 1.24 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -83,6 +83,7 @@ X509_CRL_print_fp(FILE *fp, X509_CRL *x) BIO_free(b); return (ret); } +LCRYPTO_ALIAS(X509_CRL_print_fp); int X509_CRL_print(BIO *out, X509_CRL *x) @@ -143,3 +144,4 @@ X509_CRL_print(BIO *out, X509_CRL *x) err: return 0; } +LCRYPTO_ALIAS(X509_CRL_print); diff --git a/lib/libcrypto/asn1/t_req.c b/lib/libcrypto/asn1/t_req.c index 2fd984243..ac011705e 100644 --- a/lib/libcrypto/asn1/t_req.c +++ b/lib/libcrypto/asn1/t_req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_req.c,v 1.26 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: t_req.c,v 1.27 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -91,6 +91,7 @@ X509_REQ_print_fp(FILE *fp, X509_REQ *x) BIO_free(b); return (ret); } +LCRYPTO_ALIAS(X509_REQ_print_fp); int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, @@ -254,9 +255,11 @@ X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, X509error(ERR_R_BUF_LIB); return (0); } +LCRYPTO_ALIAS(X509_REQ_print_ex); int X509_REQ_print(BIO *bp, X509_REQ *x) { return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); } +LCRYPTO_ALIAS(X509_REQ_print); diff --git a/lib/libcrypto/asn1/t_spki.c b/lib/libcrypto/asn1/t_spki.c index 73996b66f..1a315c157 100644 --- a/lib/libcrypto/asn1/t_spki.c +++ b/lib/libcrypto/asn1/t_spki.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_spki.c,v 1.16 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: t_spki.c,v 1.17 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -113,3 +113,4 @@ NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki) BIO_write(out, "\n", 1); return 1; } +LCRYPTO_ALIAS(NETSCAPE_SPKI_print); diff --git a/lib/libcrypto/asn1/t_x509.c b/lib/libcrypto/asn1/t_x509.c index 6f7bdc79f..5e753f327 100644 --- a/lib/libcrypto/asn1/t_x509.c +++ b/lib/libcrypto/asn1/t_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_x509.c,v 1.44 2023/12/29 10:59:00 tb Exp $ */ +/* $OpenBSD: t_x509.c,v 1.45 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,6 +85,7 @@ X509_print_fp(FILE *fp, X509 *x) { return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); } +LCRYPTO_ALIAS(X509_print_fp); int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) @@ -101,12 +102,14 @@ X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) BIO_free(b); return (ret); } +LCRYPTO_ALIAS(X509_print_ex_fp); int X509_print(BIO *bp, X509 *x) { return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT); } +LCRYPTO_ALIAS(X509_print); int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) @@ -250,6 +253,7 @@ X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags, unsigned long cflag) free(m); return (ret); } +LCRYPTO_ALIAS(X509_print_ex); int X509_ocspid_print(BIO *bp, X509 *x) @@ -301,6 +305,7 @@ X509_ocspid_print(BIO *bp, X509 *x) free(der); return (0); } +LCRYPTO_ALIAS(X509_ocspid_print); int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) @@ -326,6 +331,7 @@ X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent) return 1; } +LCRYPTO_ALIAS(X509_signature_dump); int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) @@ -352,6 +358,7 @@ X509_signature_print(BIO *bp, const X509_ALGOR *sigalg, const ASN1_STRING *sig) return 0; return 1; } +LCRYPTO_ALIAS(X509_signature_print); int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm) @@ -513,3 +520,4 @@ X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) free(b); return (ret); } +LCRYPTO_ALIAS(X509_NAME_print); diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index 939ce4b66..71430e1fd 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.39 2024/03/02 10:33:51 tb Exp $ */ +/* $OpenBSD: x_algor.c,v 1.40 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -111,24 +111,28 @@ d2i_X509_ALGOR(X509_ALGOR **a, const unsigned char **in, long len) return (X509_ALGOR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ALGOR_it); } +LCRYPTO_ALIAS(d2i_X509_ALGOR); int i2d_X509_ALGOR(X509_ALGOR *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGOR_it); } +LCRYPTO_ALIAS(i2d_X509_ALGOR); X509_ALGOR * X509_ALGOR_new(void) { return (X509_ALGOR *)ASN1_item_new(&X509_ALGOR_it); } +LCRYPTO_ALIAS(X509_ALGOR_new); void X509_ALGOR_free(X509_ALGOR *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_ALGOR_it); } +LCRYPTO_ALIAS(X509_ALGOR_free); X509_ALGORS * d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len) @@ -136,18 +140,21 @@ d2i_X509_ALGORS(X509_ALGORS **a, const unsigned char **in, long len) return (X509_ALGORS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ALGORS_it); } +LCRYPTO_ALIAS(d2i_X509_ALGORS); int i2d_X509_ALGORS(X509_ALGORS *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ALGORS_it); } +LCRYPTO_ALIAS(i2d_X509_ALGORS); X509_ALGOR * X509_ALGOR_dup(X509_ALGOR *x) { return ASN1_item_dup(&X509_ALGOR_it, x); } +LCRYPTO_ALIAS(X509_ALGOR_dup); static int X509_ALGOR_set0_obj(X509_ALGOR *alg, ASN1_OBJECT *aobj) @@ -225,6 +232,7 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int parameter_type, return 1; } +LCRYPTO_ALIAS(X509_ALGOR_set0); void X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, @@ -252,6 +260,7 @@ X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type, if (out_value != NULL) *out_value = value; } +LCRYPTO_ALIAS(X509_ALGOR_get0); int X509_ALGOR_set_evp_md(X509_ALGOR *alg, const EVP_MD *md) @@ -281,3 +290,4 @@ X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) return ASN1_TYPE_cmp(a->parameter, b->parameter); } +LCRYPTO_ALIAS(X509_ALGOR_cmp); diff --git a/lib/libcrypto/asn1/x_attrib.c b/lib/libcrypto/asn1/x_attrib.c index 08206172f..3e3ed3819 100644 --- a/lib/libcrypto/asn1/x_attrib.c +++ b/lib/libcrypto/asn1/x_attrib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_attrib.c,v 1.21 2023/07/28 13:30:07 jsg Exp $ */ +/* $OpenBSD: x_attrib.c,v 1.22 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -98,30 +98,35 @@ d2i_X509_ATTRIBUTE(X509_ATTRIBUTE **a, const unsigned char **in, long len) return (X509_ATTRIBUTE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_ATTRIBUTE_it); } +LCRYPTO_ALIAS(d2i_X509_ATTRIBUTE); int i2d_X509_ATTRIBUTE(X509_ATTRIBUTE *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_ATTRIBUTE_it); } +LCRYPTO_ALIAS(i2d_X509_ATTRIBUTE); X509_ATTRIBUTE * X509_ATTRIBUTE_new(void) { return (X509_ATTRIBUTE *)ASN1_item_new(&X509_ATTRIBUTE_it); } +LCRYPTO_ALIAS(X509_ATTRIBUTE_new); void X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it); } +LCRYPTO_ALIAS(X509_ATTRIBUTE_free); X509_ATTRIBUTE * X509_ATTRIBUTE_dup(X509_ATTRIBUTE *x) { return ASN1_item_dup(&X509_ATTRIBUTE_it, x); } +LCRYPTO_ALIAS(X509_ATTRIBUTE_dup); X509_ATTRIBUTE * X509_ATTRIBUTE_create(int nid, int atrtype, void *value) @@ -150,3 +155,4 @@ X509_ATTRIBUTE_create(int nid, int atrtype, void *value) ASN1_TYPE_free(val); return (NULL); } +LCRYPTO_ALIAS(X509_ATTRIBUTE_create); diff --git a/lib/libcrypto/asn1/x_crl.c b/lib/libcrypto/asn1/x_crl.c index e3d16352a..0e6047db0 100644 --- a/lib/libcrypto/asn1/x_crl.c +++ b/lib/libcrypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.43 2024/03/02 10:59:41 tb Exp $ */ +/* $OpenBSD: x_crl.c,v 1.44 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -420,30 +420,35 @@ d2i_X509_REVOKED(X509_REVOKED **a, const unsigned char **in, long len) return (X509_REVOKED *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REVOKED_it); } +LCRYPTO_ALIAS(d2i_X509_REVOKED); int i2d_X509_REVOKED(X509_REVOKED *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REVOKED_it); } +LCRYPTO_ALIAS(i2d_X509_REVOKED); X509_REVOKED * X509_REVOKED_new(void) { return (X509_REVOKED *)ASN1_item_new(&X509_REVOKED_it); } +LCRYPTO_ALIAS(X509_REVOKED_new); void X509_REVOKED_free(X509_REVOKED *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_REVOKED_it); } +LCRYPTO_ALIAS(X509_REVOKED_free); X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *a) { return ASN1_item_dup(&X509_REVOKED_it, a); } +LCRYPTO_ALIAS(X509_REVOKED_dup); X509_CRL_INFO * d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) @@ -451,24 +456,28 @@ d2i_X509_CRL_INFO(X509_CRL_INFO **a, const unsigned char **in, long len) return (X509_CRL_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_CRL_INFO_it); } +LCRYPTO_ALIAS(d2i_X509_CRL_INFO); int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_INFO_it); } +LCRYPTO_ALIAS(i2d_X509_CRL_INFO); X509_CRL_INFO * X509_CRL_INFO_new(void) { return (X509_CRL_INFO *)ASN1_item_new(&X509_CRL_INFO_it); } +LCRYPTO_ALIAS(X509_CRL_INFO_new); void X509_CRL_INFO_free(X509_CRL_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_INFO_it); } +LCRYPTO_ALIAS(X509_CRL_INFO_free); X509_CRL * d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len) @@ -476,30 +485,35 @@ d2i_X509_CRL(X509_CRL **a, const unsigned char **in, long len) return (X509_CRL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_CRL_it); } +LCRYPTO_ALIAS(d2i_X509_CRL); int i2d_X509_CRL(X509_CRL *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_it); } +LCRYPTO_ALIAS(i2d_X509_CRL); X509_CRL * X509_CRL_new(void) { return (X509_CRL *)ASN1_item_new(&X509_CRL_it); } +LCRYPTO_ALIAS(X509_CRL_new); void X509_CRL_free(X509_CRL *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_it); } +LCRYPTO_ALIAS(X509_CRL_free); X509_CRL * X509_CRL_dup(X509_CRL *x) { return ASN1_item_dup(&X509_CRL_it, x); } +LCRYPTO_ALIAS(X509_CRL_dup); static int X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) @@ -522,6 +536,7 @@ X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev) inf->enc.modified = 1; return 1; } +LCRYPTO_ALIAS(X509_CRL_add0_revoked); int X509_CRL_verify(X509_CRL *crl, EVP_PKEY *pkey) @@ -529,6 +544,7 @@ X509_CRL_verify(X509_CRL *crl, EVP_PKEY *pkey) return ASN1_item_verify(&X509_CRL_INFO_it, crl->sig_alg, crl->signature, crl->crl, pkey); } +LCRYPTO_ALIAS(X509_CRL_verify); static int crl_revoked_issuer_match(X509_CRL *crl, X509_NAME *nm, X509_REVOKED *rev) @@ -595,6 +611,7 @@ X509_CRL_get0_by_serial(X509_CRL *crl, X509_REVOKED **ret, { return crl_lookup(crl, ret, serial, NULL); } +LCRYPTO_ALIAS(X509_CRL_get0_by_serial); int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) @@ -602,60 +619,70 @@ X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) return crl_lookup(crl, ret, X509_get_serialNumber(x), X509_get_issuer_name(x)); } +LCRYPTO_ALIAS(X509_CRL_get0_by_cert); int X509_CRL_get_signature_nid(const X509_CRL *crl) { return OBJ_obj2nid(crl->sig_alg->algorithm); } +LCRYPTO_ALIAS(X509_CRL_get_signature_nid); const STACK_OF(X509_EXTENSION) * X509_CRL_get0_extensions(const X509_CRL *crl) { return crl->crl->extensions; } +LCRYPTO_ALIAS(X509_CRL_get0_extensions); long X509_CRL_get_version(const X509_CRL *crl) { return ASN1_INTEGER_get(crl->crl->version); } +LCRYPTO_ALIAS(X509_CRL_get_version); const ASN1_TIME * X509_CRL_get0_lastUpdate(const X509_CRL *crl) { return crl->crl->lastUpdate; } +LCRYPTO_ALIAS(X509_CRL_get0_lastUpdate); ASN1_TIME * X509_CRL_get_lastUpdate(X509_CRL *crl) { return crl->crl->lastUpdate; } +LCRYPTO_ALIAS(X509_CRL_get_lastUpdate); const ASN1_TIME * X509_CRL_get0_nextUpdate(const X509_CRL *crl) { return crl->crl->nextUpdate; } +LCRYPTO_ALIAS(X509_CRL_get0_nextUpdate); ASN1_TIME * X509_CRL_get_nextUpdate(X509_CRL *crl) { return crl->crl->nextUpdate; } +LCRYPTO_ALIAS(X509_CRL_get_nextUpdate); X509_NAME * X509_CRL_get_issuer(const X509_CRL *crl) { return crl->crl->issuer; } +LCRYPTO_ALIAS(X509_CRL_get_issuer); STACK_OF(X509_REVOKED) * X509_CRL_get_REVOKED(X509_CRL *crl) { return crl->crl->revoked; } +LCRYPTO_ALIAS(X509_CRL_get_REVOKED); void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, @@ -666,9 +693,11 @@ X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, if (palg != NULL) *palg = crl->sig_alg; } +LCRYPTO_ALIAS(X509_CRL_get0_signature); const X509_ALGOR * X509_CRL_get0_tbs_sigalg(const X509_CRL *crl) { return crl->crl->sig_alg; } +LCRYPTO_ALIAS(X509_CRL_get0_tbs_sigalg); diff --git a/lib/libcrypto/asn1/x_exten.c b/lib/libcrypto/asn1/x_exten.c index 6ff33d586..323b53949 100644 --- a/lib/libcrypto/asn1/x_exten.c +++ b/lib/libcrypto/asn1/x_exten.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_exten.c,v 1.20 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: x_exten.c,v 1.21 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -116,24 +116,28 @@ d2i_X509_EXTENSION(X509_EXTENSION **a, const unsigned char **in, long len) return (X509_EXTENSION *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_EXTENSION_it); } +LCRYPTO_ALIAS(d2i_X509_EXTENSION); int i2d_X509_EXTENSION(X509_EXTENSION *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSION_it); } +LCRYPTO_ALIAS(i2d_X509_EXTENSION); X509_EXTENSION * X509_EXTENSION_new(void) { return (X509_EXTENSION *)ASN1_item_new(&X509_EXTENSION_it); } +LCRYPTO_ALIAS(X509_EXTENSION_new); void X509_EXTENSION_free(X509_EXTENSION *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_EXTENSION_it); } +LCRYPTO_ALIAS(X509_EXTENSION_free); X509_EXTENSIONS * d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len) @@ -141,15 +145,18 @@ d2i_X509_EXTENSIONS(X509_EXTENSIONS **a, const unsigned char **in, long len) return (X509_EXTENSIONS *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_EXTENSIONS_it); } +LCRYPTO_ALIAS(d2i_X509_EXTENSIONS); int i2d_X509_EXTENSIONS(X509_EXTENSIONS *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_EXTENSIONS_it); } +LCRYPTO_ALIAS(i2d_X509_EXTENSIONS); X509_EXTENSION * X509_EXTENSION_dup(X509_EXTENSION *x) { return ASN1_item_dup(&X509_EXTENSION_it, x); } +LCRYPTO_ALIAS(X509_EXTENSION_dup); diff --git a/lib/libcrypto/asn1/x_info.c b/lib/libcrypto/asn1/x_info.c index 3d2d5bad6..cb8c46608 100644 --- a/lib/libcrypto/asn1/x_info.c +++ b/lib/libcrypto/asn1/x_info.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_info.c,v 1.20 2023/07/07 19:37:52 beck Exp $ */ +/* $OpenBSD: x_info.c,v 1.21 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -75,6 +75,7 @@ X509_INFO_new(void) return ret; } +LCRYPTO_ALIAS(X509_INFO_new); void X509_INFO_free(X509_INFO *x) @@ -92,3 +93,4 @@ X509_INFO_free(X509_INFO *x) free(x); } +LCRYPTO_ALIAS(X509_INFO_free); diff --git a/lib/libcrypto/asn1/x_name.c b/lib/libcrypto/asn1/x_name.c index dc9f21789..5124ad3b2 100644 --- a/lib/libcrypto/asn1/x_name.c +++ b/lib/libcrypto/asn1/x_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_name.c,v 1.41 2023/07/24 06:56:54 tb Exp $ */ +/* $OpenBSD: x_name.c,v 1.42 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -117,30 +117,35 @@ d2i_X509_NAME_ENTRY(X509_NAME_ENTRY **a, const unsigned char **in, long len) return (X509_NAME_ENTRY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_ENTRY_it); } +LCRYPTO_ALIAS(d2i_X509_NAME_ENTRY); int i2d_X509_NAME_ENTRY(X509_NAME_ENTRY *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_ENTRY_it); } +LCRYPTO_ALIAS(i2d_X509_NAME_ENTRY); X509_NAME_ENTRY * X509_NAME_ENTRY_new(void) { return (X509_NAME_ENTRY *)ASN1_item_new(&X509_NAME_ENTRY_it); } +LCRYPTO_ALIAS(X509_NAME_ENTRY_new); void X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it); } +LCRYPTO_ALIAS(X509_NAME_ENTRY_free); X509_NAME_ENTRY * X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) { return ASN1_item_dup(&X509_NAME_ENTRY_it, x); } +LCRYPTO_ALIAS(X509_NAME_ENTRY_dup); /* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } * so declare two template wrappers for this @@ -214,30 +219,35 @@ d2i_X509_NAME(X509_NAME **a, const unsigned char **in, long len) return (X509_NAME *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_NAME_it); } +LCRYPTO_ALIAS(d2i_X509_NAME); int i2d_X509_NAME(X509_NAME *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it); } +LCRYPTO_ALIAS(i2d_X509_NAME); X509_NAME * X509_NAME_new(void) { return (X509_NAME *)ASN1_item_new(&X509_NAME_it); } +LCRYPTO_ALIAS(X509_NAME_new); void X509_NAME_free(X509_NAME *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it); } +LCRYPTO_ALIAS(X509_NAME_free); X509_NAME * X509_NAME_dup(X509_NAME *x) { return ASN1_item_dup(&X509_NAME_it, x); } +LCRYPTO_ALIAS(X509_NAME_dup); static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) @@ -635,6 +645,7 @@ X509_NAME_set(X509_NAME **xn, X509_NAME *name) *xn = name; return 1; } +LCRYPTO_ALIAS(X509_NAME_set); int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) @@ -648,3 +659,4 @@ X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) *pderlen = nm->bytes->length; return 1; } +LCRYPTO_ALIAS(X509_NAME_get0_der); diff --git a/lib/libcrypto/asn1/x_pkey.c b/lib/libcrypto/asn1/x_pkey.c index c4964fcd6..5c96c13ab 100644 --- a/lib/libcrypto/asn1/x_pkey.c +++ b/lib/libcrypto/asn1/x_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_pkey.c,v 1.23 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_pkey.c,v 1.24 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -98,6 +98,7 @@ X509_PKEY_new(void) } return NULL; } +LCRYPTO_ALIAS(X509_PKEY_new); void X509_PKEY_free(X509_PKEY *x) @@ -119,3 +120,4 @@ X509_PKEY_free(X509_PKEY *x) free(x->key_data); free(x); } +LCRYPTO_ALIAS(X509_PKEY_free); diff --git a/lib/libcrypto/asn1/x_pubkey.c b/lib/libcrypto/asn1/x_pubkey.c index 0534edcad..783e2630d 100644 --- a/lib/libcrypto/asn1/x_pubkey.c +++ b/lib/libcrypto/asn1/x_pubkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_pubkey.c,v 1.35 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_pubkey.c,v 1.36 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -118,24 +118,28 @@ d2i_X509_PUBKEY(X509_PUBKEY **a, const unsigned char **in, long len) return (X509_PUBKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_PUBKEY_it); } +LCRYPTO_ALIAS(d2i_X509_PUBKEY); int i2d_X509_PUBKEY(X509_PUBKEY *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_PUBKEY_it); } +LCRYPTO_ALIAS(i2d_X509_PUBKEY); X509_PUBKEY * X509_PUBKEY_new(void) { return (X509_PUBKEY *)ASN1_item_new(&X509_PUBKEY_it); } +LCRYPTO_ALIAS(X509_PUBKEY_new); void X509_PUBKEY_free(X509_PUBKEY *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_PUBKEY_it); } +LCRYPTO_ALIAS(X509_PUBKEY_free); int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) @@ -174,6 +178,7 @@ X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey) X509_PUBKEY_free(pk); return 0; } +LCRYPTO_ALIAS(X509_PUBKEY_set); EVP_PKEY * X509_PUBKEY_get0(X509_PUBKEY *key) @@ -226,6 +231,7 @@ X509_PUBKEY_get0(X509_PUBKEY *key) EVP_PKEY_free(ret); return (NULL); } +LCRYPTO_ALIAS(X509_PUBKEY_get0); EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key) @@ -239,6 +245,7 @@ X509_PUBKEY_get(X509_PUBKEY *key) return pkey; } +LCRYPTO_ALIAS(X509_PUBKEY_get); /* * Decode an X509_PUBKEY into the specified key type. @@ -403,12 +410,14 @@ d2i_PUBKEY(EVP_PKEY **pkey, const unsigned char **in, long len) return (EVP_PKEY *)ASN1_item_d2i((ASN1_VALUE **)pkey, in, len, &EVP_PKEY_PUBKEY_it); } +LCRYPTO_ALIAS(d2i_PUBKEY); int i2d_PUBKEY(EVP_PKEY *pkey, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)pkey, out, &EVP_PKEY_PUBKEY_it); } +LCRYPTO_ALIAS(i2d_PUBKEY); EVP_PKEY * d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **pkey) @@ -416,12 +425,14 @@ d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **pkey) return (EVP_PKEY *)ASN1_item_d2i_bio(&EVP_PKEY_PUBKEY_it, bp, (ASN1_VALUE **)pkey); } +LCRYPTO_ALIAS(d2i_PUBKEY_bio); int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey) { return ASN1_item_i2d_bio(&EVP_PKEY_PUBKEY_it, bp, (ASN1_VALUE *)pkey); } +LCRYPTO_ALIAS(i2d_PUBKEY_bio); EVP_PKEY * d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **pkey) @@ -429,12 +440,14 @@ d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **pkey) return (EVP_PKEY *)ASN1_item_d2i_fp(&EVP_PKEY_PUBKEY_it, fp, (ASN1_VALUE **)pkey); } +LCRYPTO_ALIAS(d2i_PUBKEY_fp); int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey) { return ASN1_item_i2d_fp(&EVP_PKEY_PUBKEY_it, fp, (ASN1_VALUE *)pkey); } +LCRYPTO_ALIAS(i2d_PUBKEY_fp); /* * The following are equivalents but which return RSA and DSA keys. @@ -497,36 +510,42 @@ d2i_RSA_PUBKEY(RSA **rsa, const unsigned char **in, long len) return (RSA *)ASN1_item_d2i((ASN1_VALUE **)rsa, in, len, &RSA_PUBKEY_it); } +LCRYPTO_ALIAS(d2i_RSA_PUBKEY); int i2d_RSA_PUBKEY(RSA *rsa, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)rsa, out, &RSA_PUBKEY_it); } +LCRYPTO_ALIAS(i2d_RSA_PUBKEY); RSA * d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa) { return (RSA *)ASN1_item_d2i_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE **)rsa); } +LCRYPTO_ALIAS(d2i_RSA_PUBKEY_bio); int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) { return ASN1_item_i2d_bio(&RSA_PUBKEY_it, bp, (ASN1_VALUE *)rsa); } +LCRYPTO_ALIAS(i2d_RSA_PUBKEY_bio); RSA * d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa) { return (RSA *)ASN1_item_d2i_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE **)rsa); } +LCRYPTO_ALIAS(d2i_RSA_PUBKEY_fp); int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) { return ASN1_item_i2d_fp(&RSA_PUBKEY_it, fp, (ASN1_VALUE *)rsa); } +LCRYPTO_ALIAS(i2d_RSA_PUBKEY_fp); #endif #ifndef OPENSSL_NO_DSA @@ -587,36 +606,42 @@ d2i_DSA_PUBKEY(DSA **dsa, const unsigned char **in, long len) return (DSA *)ASN1_item_d2i((ASN1_VALUE **)dsa, in, len, &DSA_PUBKEY_it); } +LCRYPTO_ALIAS(d2i_DSA_PUBKEY); int i2d_DSA_PUBKEY(DSA *dsa, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)dsa, out, &DSA_PUBKEY_it); } +LCRYPTO_ALIAS(i2d_DSA_PUBKEY); DSA * d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa) { return (DSA *)ASN1_item_d2i_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE **)dsa); } +LCRYPTO_ALIAS(d2i_DSA_PUBKEY_bio); int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) { return ASN1_item_i2d_bio(&DSA_PUBKEY_it, bp, (ASN1_VALUE *)dsa); } +LCRYPTO_ALIAS(i2d_DSA_PUBKEY_bio); DSA * d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa) { return (DSA *)ASN1_item_d2i_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE **)dsa); } +LCRYPTO_ALIAS(d2i_DSA_PUBKEY_fp); int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa) { return ASN1_item_i2d_fp(&DSA_PUBKEY_it, fp, (ASN1_VALUE *)dsa); } +LCRYPTO_ALIAS(i2d_DSA_PUBKEY_fp); #endif @@ -678,36 +703,42 @@ d2i_EC_PUBKEY(EC_KEY **ec, const unsigned char **in, long len) return (EC_KEY *)ASN1_item_d2i((ASN1_VALUE **)ec, in, len, &EC_PUBKEY_it); } +LCRYPTO_ALIAS(d2i_EC_PUBKEY); int i2d_EC_PUBKEY(EC_KEY *ec, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)ec, out, &EC_PUBKEY_it); } +LCRYPTO_ALIAS(i2d_EC_PUBKEY); EC_KEY * d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **ec) { return (EC_KEY *)ASN1_item_d2i_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE **)ec); } +LCRYPTO_ALIAS(d2i_EC_PUBKEY_bio); int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ec) { return ASN1_item_i2d_bio(&EC_PUBKEY_it, bp, (ASN1_VALUE *)ec); } +LCRYPTO_ALIAS(i2d_EC_PUBKEY_bio); EC_KEY * d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **ec) { return (EC_KEY *)ASN1_item_d2i_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE **)ec); } +LCRYPTO_ALIAS(d2i_EC_PUBKEY_fp); int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *ec) { return ASN1_item_i2d_fp(&EC_PUBKEY_it, fp, (ASN1_VALUE *)ec); } +LCRYPTO_ALIAS(i2d_EC_PUBKEY_fp); #endif int @@ -724,6 +755,7 @@ X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj, int ptype, return asn1_abs_set_unused_bits(pub->public_key, 0); } +LCRYPTO_ALIAS(X509_PUBKEY_set0_param); int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, const unsigned char **pk, @@ -739,3 +771,4 @@ X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, const unsigned char **pk, *pa = pub->algor; return 1; } +LCRYPTO_ALIAS(X509_PUBKEY_get0_param); diff --git a/lib/libcrypto/asn1/x_req.c b/lib/libcrypto/asn1/x_req.c index 9a6f0c7b0..7dd2dd7c3 100644 --- a/lib/libcrypto/asn1/x_req.c +++ b/lib/libcrypto/asn1/x_req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_req.c,v 1.21 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_req.c,v 1.22 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -143,24 +143,28 @@ d2i_X509_REQ_INFO(X509_REQ_INFO **a, const unsigned char **in, long len) return (X509_REQ_INFO *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_INFO_it); } +LCRYPTO_ALIAS(d2i_X509_REQ_INFO); int i2d_X509_REQ_INFO(X509_REQ_INFO *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_INFO_it); } +LCRYPTO_ALIAS(i2d_X509_REQ_INFO); X509_REQ_INFO * X509_REQ_INFO_new(void) { return (X509_REQ_INFO *)ASN1_item_new(&X509_REQ_INFO_it); } +LCRYPTO_ALIAS(X509_REQ_INFO_new); void X509_REQ_INFO_free(X509_REQ_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it); } +LCRYPTO_ALIAS(X509_REQ_INFO_free); static const ASN1_AUX X509_REQ_aux = { .app_data = NULL, @@ -203,36 +207,42 @@ d2i_X509_REQ(X509_REQ **a, const unsigned char **in, long len) return (X509_REQ *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_REQ_it); } +LCRYPTO_ALIAS(d2i_X509_REQ); int i2d_X509_REQ(X509_REQ *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_REQ_it); } +LCRYPTO_ALIAS(i2d_X509_REQ); X509_REQ * X509_REQ_new(void) { return (X509_REQ *)ASN1_item_new(&X509_REQ_it); } +LCRYPTO_ALIAS(X509_REQ_new); void X509_REQ_free(X509_REQ *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it); } +LCRYPTO_ALIAS(X509_REQ_free); X509_REQ * X509_REQ_dup(X509_REQ *x) { return ASN1_item_dup(&X509_REQ_it, x); } +LCRYPTO_ALIAS(X509_REQ_dup); int X509_REQ_get_signature_nid(const X509_REQ *req) { return OBJ_obj2nid(req->sig_alg->algorithm); } +LCRYPTO_ALIAS(X509_REQ_get_signature_nid); void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, @@ -243,3 +253,4 @@ X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, if (palg != NULL) *palg = req->sig_alg; } +LCRYPTO_ALIAS(X509_REQ_get0_signature); diff --git a/lib/libcrypto/asn1/x_sig.c b/lib/libcrypto/asn1/x_sig.c index c55de7141..5148b5a22 100644 --- a/lib/libcrypto/asn1/x_sig.c +++ b/lib/libcrypto/asn1/x_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_sig.c,v 1.16 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_sig.c,v 1.17 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -92,24 +92,28 @@ d2i_X509_SIG(X509_SIG **a, const unsigned char **in, long len) return (X509_SIG *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_SIG_it); } +LCRYPTO_ALIAS(d2i_X509_SIG); int i2d_X509_SIG(X509_SIG *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_SIG_it); } +LCRYPTO_ALIAS(i2d_X509_SIG); X509_SIG * X509_SIG_new(void) { return (X509_SIG *)ASN1_item_new(&X509_SIG_it); } +LCRYPTO_ALIAS(X509_SIG_new); void X509_SIG_free(X509_SIG *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_SIG_it); } +LCRYPTO_ALIAS(X509_SIG_free); void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, @@ -120,6 +124,7 @@ X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, if (pdigest != NULL) *pdigest = sig->digest; } +LCRYPTO_ALIAS(X509_SIG_get0); void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest) @@ -129,3 +134,4 @@ X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest) if (pdigest != NULL) *pdigest = sig->digest; } +LCRYPTO_ALIAS(X509_SIG_getm); diff --git a/lib/libcrypto/asn1/x_spki.c b/lib/libcrypto/asn1/x_spki.c index ef6053339..545799e2a 100644 --- a/lib/libcrypto/asn1/x_spki.c +++ b/lib/libcrypto/asn1/x_spki.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_spki.c,v 1.13 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_spki.c,v 1.14 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -94,24 +94,28 @@ d2i_NETSCAPE_SPKAC(NETSCAPE_SPKAC **a, const unsigned char **in, long len) return (NETSCAPE_SPKAC *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &NETSCAPE_SPKAC_it); } +LCRYPTO_ALIAS(d2i_NETSCAPE_SPKAC); int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKAC_it); } +LCRYPTO_ALIAS(i2d_NETSCAPE_SPKAC); NETSCAPE_SPKAC * NETSCAPE_SPKAC_new(void) { return (NETSCAPE_SPKAC *)ASN1_item_new(&NETSCAPE_SPKAC_it); } +LCRYPTO_ALIAS(NETSCAPE_SPKAC_new); void NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a) { ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKAC_it); } +LCRYPTO_ALIAS(NETSCAPE_SPKAC_free); static const ASN1_TEMPLATE NETSCAPE_SPKI_seq_tt[] = { { @@ -154,21 +158,25 @@ d2i_NETSCAPE_SPKI(NETSCAPE_SPKI **a, const unsigned char **in, long len) return (NETSCAPE_SPKI *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &NETSCAPE_SPKI_it); } +LCRYPTO_ALIAS(d2i_NETSCAPE_SPKI); int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKI_it); } +LCRYPTO_ALIAS(i2d_NETSCAPE_SPKI); NETSCAPE_SPKI * NETSCAPE_SPKI_new(void) { return (NETSCAPE_SPKI *)ASN1_item_new(&NETSCAPE_SPKI_it); } +LCRYPTO_ALIAS(NETSCAPE_SPKI_new); void NETSCAPE_SPKI_free(NETSCAPE_SPKI *a) { ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKI_it); } +LCRYPTO_ALIAS(NETSCAPE_SPKI_free); diff --git a/lib/libcrypto/asn1/x_val.c b/lib/libcrypto/asn1/x_val.c index a9c9c481e..47e175515 100644 --- a/lib/libcrypto/asn1/x_val.c +++ b/lib/libcrypto/asn1/x_val.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_val.c,v 1.13 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_val.c,v 1.14 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -90,21 +90,25 @@ d2i_X509_VAL(X509_VAL **a, const unsigned char **in, long len) return (X509_VAL *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_VAL_it); } +LCRYPTO_ALIAS(d2i_X509_VAL); int i2d_X509_VAL(X509_VAL *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_VAL_it); } +LCRYPTO_ALIAS(i2d_X509_VAL); X509_VAL * X509_VAL_new(void) { return (X509_VAL *)ASN1_item_new(&X509_VAL_it); } +LCRYPTO_ALIAS(X509_VAL_new); void X509_VAL_free(X509_VAL *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_VAL_it); } +LCRYPTO_ALIAS(X509_VAL_free); diff --git a/lib/libcrypto/asn1/x_x509.c b/lib/libcrypto/asn1/x_x509.c index 08e4dba9e..e3499f620 100644 --- a/lib/libcrypto/asn1/x_x509.c +++ b/lib/libcrypto/asn1/x_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509.c,v 1.37 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_x509.c,v 1.38 2024/04/09 13:55:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -149,24 +149,28 @@ d2i_X509_CINF(X509_CINF **a, const unsigned char **in, long len) return (X509_CINF *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_CINF_it); } +LCRYPTO_ALIAS(d2i_X509_CINF); int i2d_X509_CINF(X509_CINF *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CINF_it); } +LCRYPTO_ALIAS(i2d_X509_CINF); X509_CINF * X509_CINF_new(void) { return (X509_CINF *)ASN1_item_new(&X509_CINF_it); } +LCRYPTO_ALIAS(X509_CINF_new); void X509_CINF_free(X509_CINF *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_CINF_it); } +LCRYPTO_ALIAS(X509_CINF_free); /* X509 top level structure needs a bit of customisation */ static int @@ -216,6 +220,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) return 1; } +LCRYPTO_ALIAS(d2i_X509_CINF); static const ASN1_AUX X509_aux = { .app_data = NULL, @@ -259,30 +264,35 @@ d2i_X509(X509 **a, const unsigned char **in, long len) return (X509 *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &X509_it); } +LCRYPTO_ALIAS(d2i_X509); int i2d_X509(X509 *a, unsigned char **out) { return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_it); } +LCRYPTO_ALIAS(i2d_X509); X509 * X509_new(void) { return (X509 *)ASN1_item_new(&X509_it); } +LCRYPTO_ALIAS(X509_new); void X509_free(X509 *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_it); } +LCRYPTO_ALIAS(X509_free); X509 * X509_dup(X509 *x) { return ASN1_item_dup(&X509_it, x); } +LCRYPTO_ALIAS(X509_dup); int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, @@ -291,18 +301,21 @@ X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509, argl, argp, new_func, dup_func, free_func); } +LCRYPTO_ALIAS(X509_get_ex_new_index); int X509_set_ex_data(X509 *r, int idx, void *arg) { return (CRYPTO_set_ex_data(&r->ex_data, idx, arg)); } +LCRYPTO_ALIAS(X509_set_ex_data); void * X509_get_ex_data(X509 *r, int idx) { return (CRYPTO_get_ex_data(&r->ex_data, idx)); } +LCRYPTO_ALIAS(X509_get_ex_data); /* X509_AUX ASN1 routines. X509_AUX is the name given to * a certificate with extra info tagged on the end. Since these @@ -340,6 +353,7 @@ d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) X509_free(ret); return NULL; } +LCRYPTO_ALIAS(d2i_X509_AUX); int i2d_X509_AUX(X509 *a, unsigned char **pp) @@ -351,6 +365,7 @@ i2d_X509_AUX(X509 *a, unsigned char **pp) length += i2d_X509_CERT_AUX(a->aux, pp); return length; } +LCRYPTO_ALIAS(i2d_X509_AUX); int i2d_re_X509_tbs(X509 *x, unsigned char **pp) @@ -358,6 +373,7 @@ i2d_re_X509_tbs(X509 *x, unsigned char **pp) x->cert_info->enc.modified = 1; return i2d_X509_CINF(x->cert_info, pp); } +LCRYPTO_ALIAS(i2d_re_X509_tbs); void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, @@ -368,9 +384,11 @@ X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, if (palg != NULL) *palg = x->sig_alg; } +LCRYPTO_ALIAS(X509_get0_signature); int X509_get_signature_nid(const X509 *x) { return OBJ_obj2nid(x->sig_alg->algorithm); } +LCRYPTO_ALIAS(X509_get_signature_nid); diff --git a/lib/libcrypto/asn1/x_x509a.c b/lib/libcrypto/asn1/x_x509a.c index 2b6fe7fce..aaa22d135 100644 --- a/lib/libcrypto/asn1/x_x509a.c +++ b/lib/libcrypto/asn1/x_x509a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509a.c,v 1.21 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: x_x509a.c,v 1.22 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -172,6 +172,7 @@ X509_alias_set1(X509 *x, const unsigned char *name, int len) return 0; return ASN1_STRING_set(aux->alias, name, len); } +LCRYPTO_ALIAS(X509_alias_set1); int X509_keyid_set1(X509 *x, const unsigned char *id, int len) @@ -190,6 +191,7 @@ X509_keyid_set1(X509 *x, const unsigned char *id, int len) return 0; return ASN1_STRING_set(aux->keyid, id, len); } +LCRYPTO_ALIAS(X509_keyid_set1); unsigned char * X509_alias_get0(X509 *x, int *len) @@ -200,6 +202,7 @@ X509_alias_get0(X509 *x, int *len) *len = x->aux->alias->length; return x->aux->alias->data; } +LCRYPTO_ALIAS(X509_alias_get0); unsigned char * X509_keyid_get0(X509 *x, int *len) @@ -210,6 +213,7 @@ X509_keyid_get0(X509 *x, int *len) *len = x->aux->keyid->length; return x->aux->keyid->data; } +LCRYPTO_ALIAS(X509_keyid_get0); int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj) @@ -232,6 +236,7 @@ X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj) ASN1_OBJECT_free(objtmp); return 0; } +LCRYPTO_ALIAS(X509_add1_trust_object); int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj) @@ -254,6 +259,7 @@ X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj) ASN1_OBJECT_free(objtmp); return 0; } +LCRYPTO_ALIAS(X509_add1_reject_object); void X509_trust_clear(X509 *x) @@ -263,6 +269,7 @@ X509_trust_clear(X509 *x) x->aux->trust = NULL; } } +LCRYPTO_ALIAS(X509_trust_clear); void X509_reject_clear(X509 *x) @@ -272,3 +279,4 @@ X509_reject_clear(X509 *x) x->aux->reject = NULL; } } +LCRYPTO_ALIAS(X509_reject_clear); diff --git a/lib/libcrypto/bn/bn.h b/lib/libcrypto/bn/bn.h index 792107529..523ff4287 100644 --- a/lib/libcrypto/bn/bn.h +++ b/lib/libcrypto/bn/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.77 2024/03/02 09:27:31 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.78 2024/04/10 14:58:06 beck Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -350,11 +350,10 @@ void BN_set_negative(BIGNUM *b, int n); int BN_is_negative(const BIGNUM *b); -#ifndef LIBRESSL_INTERNAL int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); #define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx)) -#endif + int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx); int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx); int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m); @@ -383,12 +382,10 @@ int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); int BN_lshift1(BIGNUM *r, const BIGNUM *a); int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx); -#ifndef LIBRESSL_INTERNAL int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); -#endif int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); @@ -407,14 +404,10 @@ char * BN_bn2dec(const BIGNUM *a); int BN_hex2bn(BIGNUM **a, const char *str); int BN_dec2bn(BIGNUM **a, const char *str); int BN_asc2bn(BIGNUM **a, const char *str); -#ifndef LIBRESSL_INTERNAL int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); -#endif int BN_kronecker(const BIGNUM *a,const BIGNUM *b,BN_CTX *ctx); /* returns -2 for error */ -#ifndef LIBRESSL_INTERNAL BIGNUM *BN_mod_inverse(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); -#endif BIGNUM *BN_mod_sqrt(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); diff --git a/lib/libcrypto/bn/bn_div.c b/lib/libcrypto/bn/bn_div.c index 3225fa442..09a8a364d 100644 --- a/lib/libcrypto/bn/bn_div.c +++ b/lib/libcrypto/bn/bn_div.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_div.c,v 1.40 2023/03/27 10:21:23 tb Exp $ */ +/* $OpenBSD: bn_div.c,v 1.41 2024/04/10 14:58:06 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -441,6 +441,7 @@ BN_div(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, return BN_div_internal(quotient, remainder, numerator, divisor, ctx, ct); } +LCRYPTO_ALIAS(BN_div); int BN_div_nonct(BIGNUM *quotient, BIGNUM *remainder, const BIGNUM *numerator, diff --git a/lib/libcrypto/bn/bn_exp.c b/lib/libcrypto/bn/bn_exp.c index 04852424f..c51296c3c 100644 --- a/lib/libcrypto/bn/bn_exp.c +++ b/lib/libcrypto/bn/bn_exp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_exp.c,v 1.52 2024/03/02 09:27:31 tb Exp $ */ +/* $OpenBSD: bn_exp.c,v 1.53 2024/04/10 14:58:06 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -799,6 +799,7 @@ BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, return BN_mod_exp_mont_internal(rr, a, p, m, ctx, in_mont, (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); } +LCRYPTO_ALIAS(BN_mod_exp_mont); int BN_mod_exp_mont_ct(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, @@ -1160,6 +1161,7 @@ BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, return BN_mod_exp_internal(r, a, p, m, ctx, (BN_get_flags(p, BN_FLG_CONSTTIME) != 0)); } +LCRYPTO_ALIAS(BN_mod_exp); int BN_mod_exp_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, diff --git a/lib/libcrypto/bn/bn_gcd.c b/lib/libcrypto/bn/bn_gcd.c index 6b3d8a3cb..fa5d71a7f 100644 --- a/lib/libcrypto/bn/bn_gcd.c +++ b/lib/libcrypto/bn/bn_gcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_gcd.c,v 1.28 2023/06/02 17:15:30 tb Exp $ */ +/* $OpenBSD: bn_gcd.c,v 1.29 2024/04/10 14:58:06 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -195,12 +195,7 @@ BN_gcd(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) BN_CTX_end(ctx); return (ret); } - -int -BN_gcd_nonct(BIGNUM *r, const BIGNUM *in_a, const BIGNUM *in_b, BN_CTX *ctx) -{ - return BN_gcd(r, in_a, in_b, ctx); -} +LCRYPTO_ALIAS(BN_gcd); /* * BN_gcd_no_branch is a special version of BN_mod_inverse_no_branch. @@ -808,6 +803,7 @@ BN_mod_inverse(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)); return BN_mod_inverse_internal(in, a, n, ctx, ct); } +LCRYPTO_ALIAS(BN_mod_inverse); BIGNUM * BN_mod_inverse_nonct(BIGNUM *in, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx) diff --git a/lib/libcrypto/bn/bn_local.h b/lib/libcrypto/bn/bn_local.h index 5acb546d0..2c82e323f 100644 --- a/lib/libcrypto/bn/bn_local.h +++ b/lib/libcrypto/bn/bn_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_local.h,v 1.40 2024/03/02 09:27:31 tb Exp $ */ +/* $OpenBSD: bn_local.h,v 1.41 2024/04/10 15:09:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -322,7 +322,6 @@ BIGNUM *BN_mod_inverse_ct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, BIGNUM *BN_mod_inverse_nonct(BIGNUM *ret, const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx); int BN_gcd_ct(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); -int BN_gcd_nonct(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); int BN_swap_ct(BN_ULONG swap, BIGNUM *a, BIGNUM *b, size_t nwords); diff --git a/lib/libcrypto/conf/conf_def.c b/lib/libcrypto/conf/conf_def.c index f2b2c9477..dbd2e6a2e 100644 --- a/lib/libcrypto/conf/conf_def.c +++ b/lib/libcrypto/conf/conf_def.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_def.c,v 1.33 2020/02/17 12:51:48 inoguchi Exp $ */ +/* $OpenBSD: conf_def.c,v 1.34 2024/04/09 13:56:30 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,12 +122,14 @@ NCONF_default(void) { return &default_method; } +LCRYPTO_ALIAS(NCONF_default); CONF_METHOD * NCONF_WIN32(void) { return &WIN32_method; } +LCRYPTO_ALIAS(NCONF_WIN32); static CONF * def_create(CONF_METHOD *meth) diff --git a/lib/libcrypto/conf/conf_err.c b/lib/libcrypto/conf/conf_err.c index e6c707ab3..9a44f22fa 100644 --- a/lib/libcrypto/conf/conf_err.c +++ b/lib/libcrypto/conf/conf_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_err.c,v 1.15 2022/07/12 14:42:48 kn Exp $ */ +/* $OpenBSD: conf_err.c,v 1.16 2024/04/09 13:56:30 beck Exp $ */ /* ==================================================================== * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved. * @@ -103,3 +103,4 @@ ERR_load_CONF_strings(void) } #endif } +LCRYPTO_ALIAS(ERR_load_CONF_strings); diff --git a/lib/libcrypto/conf/conf_lib.c b/lib/libcrypto/conf/conf_lib.c index 2e4228bbe..d1c85dc09 100644 --- a/lib/libcrypto/conf/conf_lib.c +++ b/lib/libcrypto/conf/conf_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_lib.c,v 1.16 2024/01/28 21:00:54 tb Exp $ */ +/* $OpenBSD: conf_lib.c,v 1.17 2024/04/09 13:56:30 beck Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2000. */ @@ -75,6 +75,7 @@ CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash) default_CONF_method->init(conf); conf->data = hash; } +LCRYPTO_ALIAS(CONF_set_nconf); /* The following section contains the "CONF classic" functions, rewritten in terms of the new CONF interface. */ @@ -85,6 +86,7 @@ CONF_set_default_method(CONF_METHOD *meth) default_CONF_method = meth; return 1; } +LCRYPTO_ALIAS(CONF_set_default_method); LHASH_OF(CONF_VALUE) * CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline) @@ -103,6 +105,7 @@ CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file, long *eline) return ltmp; } +LCRYPTO_ALIAS(CONF_load); LHASH_OF(CONF_VALUE) * CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline) @@ -118,6 +121,7 @@ CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp, long *eline) BIO_free(btmp); return ltmp; } +LCRYPTO_ALIAS(CONF_load_fp); LHASH_OF(CONF_VALUE) * CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline) @@ -132,6 +136,7 @@ CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp, long *eline) return ctmp.data; return NULL; } +LCRYPTO_ALIAS(CONF_load_bio); STACK_OF(CONF_VALUE) * CONF_get_section(LHASH_OF(CONF_VALUE) *conf, const char *section) @@ -144,6 +149,7 @@ CONF_get_section(LHASH_OF(CONF_VALUE) *conf, const char *section) return NCONF_get_section(&ctmp, section); } } +LCRYPTO_ALIAS(CONF_get_section); char * CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, @@ -157,6 +163,7 @@ CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group, return NCONF_get_string(&ctmp, group, name); } } +LCRYPTO_ALIAS(CONF_get_string); long CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, @@ -179,6 +186,7 @@ CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group, } return result; } +LCRYPTO_ALIAS(CONF_get_number); void CONF_free(LHASH_OF(CONF_VALUE) *conf) @@ -188,6 +196,7 @@ CONF_free(LHASH_OF(CONF_VALUE) *conf) CONF_set_nconf(&ctmp, conf); NCONF_free_data(&ctmp); } +LCRYPTO_ALIAS(CONF_free); int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) @@ -203,6 +212,7 @@ CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(CONF_dump_fp); int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out) @@ -212,6 +222,7 @@ CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out) CONF_set_nconf(&ctmp, conf); return NCONF_dump_bio(&ctmp, out); } +LCRYPTO_ALIAS(CONF_dump_bio); /* The following section contains the "New CONF" functions. They are completely centralised around a new CONF structure that may contain @@ -235,6 +246,7 @@ NCONF_new(CONF_METHOD *meth) return ret; } +LCRYPTO_ALIAS(NCONF_new); void NCONF_free(CONF *conf) @@ -243,6 +255,7 @@ NCONF_free(CONF *conf) return; conf->meth->destroy(conf); } +LCRYPTO_ALIAS(NCONF_free); void NCONF_free_data(CONF *conf) @@ -251,6 +264,7 @@ NCONF_free_data(CONF *conf) return; conf->meth->destroy_data(conf); } +LCRYPTO_ALIAS(NCONF_free_data); int NCONF_load(CONF *conf, const char *file, long *eline) @@ -262,6 +276,7 @@ NCONF_load(CONF *conf, const char *file, long *eline) return conf->meth->load(conf, file, eline); } +LCRYPTO_ALIAS(NCONF_load); int NCONF_load_fp(CONF *conf, FILE *fp, long *eline) @@ -277,6 +292,7 @@ NCONF_load_fp(CONF *conf, FILE *fp, long *eline) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(NCONF_load_fp); int NCONF_load_bio(CONF *conf, BIO *bp, long *eline) @@ -288,6 +304,7 @@ NCONF_load_bio(CONF *conf, BIO *bp, long *eline) return conf->meth->load_bio(conf, bp, eline); } +LCRYPTO_ALIAS(NCONF_load_bio); STACK_OF(CONF_VALUE) * NCONF_get_section(const CONF *conf, const char *section) @@ -304,6 +321,7 @@ NCONF_get_section(const CONF *conf, const char *section) return _CONF_get_section_values(conf, section); } +LCRYPTO_ALIAS(NCONF_get_section); char * NCONF_get_string(const CONF *conf, const char *group, const char *name) @@ -324,6 +342,7 @@ NCONF_get_string(const CONF *conf, const char *group, const char *name) group ? group : "", name); return NULL; } +LCRYPTO_ALIAS(NCONF_get_string); int NCONF_get_number_e(const CONF *conf, const char *group, const char *name, @@ -348,6 +367,7 @@ NCONF_get_number_e(const CONF *conf, const char *group, const char *name, return 1; } +LCRYPTO_ALIAS(NCONF_get_number_e); int NCONF_dump_fp(const CONF *conf, FILE *out) @@ -362,6 +382,7 @@ NCONF_dump_fp(const CONF *conf, FILE *out) BIO_free(btmp); return ret; } +LCRYPTO_ALIAS(NCONF_dump_fp); int NCONF_dump_bio(const CONF *conf, BIO *out) @@ -373,3 +394,4 @@ NCONF_dump_bio(const CONF *conf, BIO *out) return conf->meth->dump(conf, out); } +LCRYPTO_ALIAS(NCONF_dump_bio); diff --git a/lib/libcrypto/conf/conf_mall.c b/lib/libcrypto/conf/conf_mall.c index 141c0abef..6a3d180f9 100644 --- a/lib/libcrypto/conf/conf_mall.c +++ b/lib/libcrypto/conf/conf_mall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_mall.c,v 1.11 2024/03/02 09:02:04 tb Exp $ */ +/* $OpenBSD: conf_mall.c,v 1.12 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -67,3 +67,4 @@ OPENSSL_load_builtin_modules(void) /* Add builtin modules here */ ASN1_add_oid_module(); } +LCRYPTO_ALIAS(OPENSSL_load_builtin_modules); diff --git a/lib/libcrypto/conf/conf_mod.c b/lib/libcrypto/conf/conf_mod.c index 85d74e6fb..4bde9eb37 100644 --- a/lib/libcrypto/conf/conf_mod.c +++ b/lib/libcrypto/conf/conf_mod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_mod.c,v 1.37 2024/03/26 00:24:11 tb Exp $ */ +/* $OpenBSD: conf_mod.c,v 1.38 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -147,6 +147,7 @@ CONF_modules_load(const CONF *cnf, const char *appname, unsigned long flags) return 1; } +LCRYPTO_ALIAS(CONF_modules_load); int CONF_modules_load_file(const char *filename, const char *appname, @@ -185,6 +186,7 @@ err: return ret; } +LCRYPTO_ALIAS(CONF_modules_load_file); static int module_run(const CONF *cnf, char *name, char *value, unsigned long flags) @@ -352,6 +354,7 @@ CONF_modules_unload(int all) supported_modules = NULL; } } +LCRYPTO_ALIAS(CONF_modules_unload); /* unload a single module */ static void @@ -389,6 +392,7 @@ CONF_modules_finish(void) sk_CONF_IMODULE_free(initialized_modules); initialized_modules = NULL; } +LCRYPTO_ALIAS(CONF_modules_finish); /* finish a module instance */ @@ -409,6 +413,7 @@ CONF_module_add(const char *name, conf_init_func *ifunc, conf_finish_func *ffunc { return module_add(name, ifunc, ffunc); } +LCRYPTO_ALIAS(CONF_module_add); void CONF_modules_free(void) @@ -416,6 +421,7 @@ CONF_modules_free(void) CONF_modules_finish(); CONF_modules_unload(1); } +LCRYPTO_ALIAS(CONF_modules_free); /* Utility functions */ @@ -424,54 +430,63 @@ CONF_imodule_get_name(const CONF_IMODULE *imod) { return imod->name; } +LCRYPTO_ALIAS(CONF_imodule_get_name); const char * CONF_imodule_get_value(const CONF_IMODULE *imod) { return imod->value; } +LCRYPTO_ALIAS(CONF_imodule_get_value); void * CONF_imodule_get_usr_data(const CONF_IMODULE *imod) { return imod->usr_data; } +LCRYPTO_ALIAS(CONF_imodule_get_usr_data); void CONF_imodule_set_usr_data(CONF_IMODULE *imod, void *usr_data) { imod->usr_data = usr_data; } +LCRYPTO_ALIAS(CONF_imodule_set_usr_data); CONF_MODULE * CONF_imodule_get_module(const CONF_IMODULE *imod) { return imod->mod; } +LCRYPTO_ALIAS(CONF_imodule_get_module); unsigned long CONF_imodule_get_flags(const CONF_IMODULE *imod) { return imod->flags; } +LCRYPTO_ALIAS(CONF_imodule_get_flags); void CONF_imodule_set_flags(CONF_IMODULE *imod, unsigned long flags) { imod->flags = flags; } +LCRYPTO_ALIAS(CONF_imodule_set_flags); void * CONF_module_get_usr_data(CONF_MODULE *mod) { return mod->usr_data; } +LCRYPTO_ALIAS(CONF_module_get_usr_data); void CONF_module_set_usr_data(CONF_MODULE *mod, void *usr_data) { mod->usr_data = usr_data; } +LCRYPTO_ALIAS(CONF_module_set_usr_data); /* Return default config file name */ @@ -485,6 +500,7 @@ CONF_get1_default_config_file(void) return (NULL); return file; } +LCRYPTO_ALIAS(CONF_get1_default_config_file); /* This function takes a list separated by 'sep' and calls the * callback function giving the start and length of each member @@ -531,3 +547,4 @@ CONF_parse_list(const char *list_, int sep, int nospc, lstart = p + 1; } } +LCRYPTO_ALIAS(CONF_parse_list); diff --git a/lib/libcrypto/conf/conf_sap.c b/lib/libcrypto/conf/conf_sap.c index 689b7a325..3a0bf96df 100644 --- a/lib/libcrypto/conf/conf_sap.c +++ b/lib/libcrypto/conf/conf_sap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_sap.c,v 1.15 2023/11/19 15:46:09 tb Exp $ */ +/* $OpenBSD: conf_sap.c,v 1.16 2024/04/09 13:56:30 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -124,6 +124,7 @@ OPENSSL_config(const char *config_name) { (void) OpenSSL_config(config_name); } +LCRYPTO_ALIAS(OPENSSL_config); static void OPENSSL_no_config_internal(void) @@ -144,3 +145,4 @@ OPENSSL_no_config(void) { (void) OpenSSL_no_config(); } +LCRYPTO_ALIAS(OPENSSL_no_config); diff --git a/lib/libcrypto/cryptlib.c b/lib/libcrypto/cryptlib.c index 9eef0348e..ae3df35f5 100644 --- a/lib/libcrypto/cryptlib.c +++ b/lib/libcrypto/cryptlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cryptlib.c,v 1.49 2024/03/24 06:48:03 tb Exp $ */ +/* $OpenBSD: cryptlib.c,v 1.50 2024/04/10 14:51:02 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -136,24 +136,28 @@ CRYPTO_num_locks(void) { return 1; } +LCRYPTO_ALIAS(CRYPTO_num_locks); unsigned long (*CRYPTO_get_id_callback(void))(void) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_id_callback); void CRYPTO_set_id_callback(unsigned long (*func)(void)) { return; } +LCRYPTO_ALIAS(CRYPTO_set_id_callback); unsigned long CRYPTO_thread_id(void) { return (unsigned long)pthread_self(); } +LCRYPTO_ALIAS(CRYPTO_thread_id); void CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, @@ -161,6 +165,7 @@ CRYPTO_set_locking_callback(void (*func)(int mode, int lock_num, { locking_callback = func; } +LCRYPTO_ALIAS(CRYPTO_set_locking_callback); void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, @@ -168,6 +173,7 @@ void { return locking_callback; } +LCRYPTO_ALIAS(CRYPTO_get_locking_callback); void CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, @@ -175,6 +181,7 @@ CRYPTO_set_add_lock_callback(int (*func)(int *num, int mount, int lock_num, { add_lock_callback = func; } +LCRYPTO_ALIAS(CRYPTO_set_add_lock_callback); int (*CRYPTO_get_add_lock_callback(void))(int *num, int mount, int type, @@ -182,58 +189,68 @@ int { return add_lock_callback; } +LCRYPTO_ALIAS(CRYPTO_get_add_lock_callback); const char * CRYPTO_get_lock_name(int lock_num) { return ""; } +LCRYPTO_ALIAS(CRYPTO_get_lock_name); struct CRYPTO_dynlock_value * CRYPTO_get_dynlock_value(int i) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_value); int CRYPTO_get_new_dynlockid(void) { return 0; } +LCRYPTO_ALIAS(CRYPTO_get_new_dynlockid); void CRYPTO_destroy_dynlockid(int i) { return; } +LCRYPTO_ALIAS(CRYPTO_destroy_dynlockid); int CRYPTO_get_new_lockid(char *name) { return 0; } +LCRYPTO_ALIAS(CRYPTO_get_new_lockid); int CRYPTO_THREADID_set_callback(void (*func)(CRYPTO_THREADID *)) { return 1; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_callback); void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *) { return NULL; } +LCRYPTO_ALIAS(CRYPTO_THREADID_get_callback); void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val) { return; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_numeric); void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr) { return; } +LCRYPTO_ALIAS(CRYPTO_THREADID_set_pointer); void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( @@ -241,6 +258,7 @@ CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value *( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_create_callback); void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( @@ -248,6 +266,7 @@ CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_lock_callback); void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( @@ -255,6 +274,7 @@ CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)( { return; } +LCRYPTO_ALIAS(CRYPTO_set_dynlock_destroy_callback); struct CRYPTO_dynlock_value * (*CRYPTO_get_dynlock_create_callback(void))( @@ -269,6 +289,7 @@ void { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_lock_callback); void (*CRYPTO_get_dynlock_destroy_callback(void))( @@ -276,6 +297,7 @@ void { return NULL; } +LCRYPTO_ALIAS(CRYPTO_get_dynlock_destroy_callback); void CRYPTO_THREADID_current(CRYPTO_THREADID *id) @@ -380,3 +402,4 @@ CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) return x; } +LCRYPTO_ALIAS(CRYPTO_memcmp); diff --git a/lib/libcrypto/crypto.h b/lib/libcrypto/crypto.h index d6ea7771c..40d3a43f4 100644 --- a/lib/libcrypto/crypto.h +++ b/lib/libcrypto/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.72 2024/03/02 15:40:05 tb Exp $ */ +/* $OpenBSD: crypto.h,v 1.74 2024/04/10 15:13:23 beck Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -265,6 +265,7 @@ DECLARE_STACK_OF(void) #ifndef LIBRESSL_INTERNAL #define CRYPTO_malloc_init() (0) #define CRYPTO_malloc_debug_init() (0) +#endif /* LIBRESSL_INTERNAL */ #if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD # ifndef CRYPTO_MDEBUG /* avoid duplicate #define */ @@ -277,7 +278,6 @@ int CRYPTO_mem_ctrl(int mode); #define OPENSSL_malloc(num) CRYPTO_malloc((num),NULL,0) #define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0) #define OPENSSL_free(addr) CRYPTO_free((addr),NULL,0) -#endif const char *OpenSSL_version(int type); #define OPENSSL_VERSION 0 @@ -316,7 +316,6 @@ int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file, /* Don't use this structure directly. */ typedef struct crypto_threadid_st CRYPTO_THREADID; -#ifndef LIBRESSL_INTERNAL /* These functions are deprecated no-op stubs */ void CRYPTO_set_id_callback(unsigned long (*func)(void)); unsigned long (*CRYPTO_get_id_callback(void))(void); @@ -349,7 +348,6 @@ void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)(struct CRY struct CRYPTO_dynlock_value *(*CRYPTO_get_dynlock_create_callback(void))(const char *file, int line); void (*CRYPTO_get_dynlock_lock_callback(void))(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line); void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l, const char *file, int line); -#endif /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- * call the latter last if you need different functions */ @@ -357,15 +355,11 @@ int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), voi int CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), void *(*r)(void *, size_t, const char *, int), void (*f)(void *)); -#ifndef LIBRESSL_INTERNAL void *CRYPTO_malloc(size_t num, const char *file, int line); char *CRYPTO_strdup(const char *str, const char *file, int line); void CRYPTO_free(void *ptr, const char *file, int line); -#endif -#ifndef LIBRESSL_INTERNAL void OPENSSL_cleanse(void *ptr, size_t len); -#endif /* * Because this is a public header, use a portable method of indicating the @@ -381,7 +375,6 @@ void OpenSSLDie(const char *file, int line, const char *assertion); uint64_t OPENSSL_cpu_caps(void); -#ifndef LIBRESSL_INTERNAL int FIPS_mode(void); int FIPS_mode_set(int r); @@ -393,7 +386,6 @@ void OPENSSL_init(void); * defined order as the return value when a != b is undefined, other than to be * non-zero. */ int CRYPTO_memcmp(const void *a, const void *b, size_t len); -#endif /* * OpenSSL compatible OPENSSL_INIT options. diff --git a/lib/libcrypto/crypto_init.c b/lib/libcrypto/crypto_init.c index ddd3ec19b..d2d06f87d 100644 --- a/lib/libcrypto/crypto_init.c +++ b/lib/libcrypto/crypto_init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_init.c,v 1.19 2024/03/19 19:27:33 tb Exp $ */ +/* $OpenBSD: crypto_init.c,v 1.21 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2018 Bob Beck * @@ -41,6 +41,7 @@ void OPENSSL_init(void) { } +LCRYPTO_ALIAS(OPENSSL_init); static void OPENSSL_init_crypto_internal(void) @@ -98,19 +99,23 @@ void OpenSSL_add_all_ciphers(void) { } +LCRYPTO_ALIAS(OpenSSL_add_all_ciphers); void OpenSSL_add_all_digests(void) { } +LCRYPTO_ALIAS(OpenSSL_add_all_digests); void OPENSSL_add_all_algorithms_noconf(void) { } +LCRYPTO_ALIAS(OPENSSL_add_all_algorithms_noconf); void OPENSSL_add_all_algorithms_conf(void) { OPENSSL_config(NULL); } +LCRYPTO_ALIAS(OPENSSL_add_all_algorithms_conf); diff --git a/lib/libcrypto/ec/ec.h b/lib/libcrypto/ec/ec.h index 9e3354df4..be3f146d4 100644 --- a/lib/libcrypto/ec/ec.h +++ b/lib/libcrypto/ec/ec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.h,v 1.46 2023/08/11 04:45:27 tb Exp $ */ +/* $OpenBSD: ec.h,v 1.47 2024/04/10 15:01:31 beck Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -108,9 +108,7 @@ const EC_METHOD *EC_GFp_mont_method(void); EC_GROUP *EC_GROUP_new(const EC_METHOD *meth); void EC_GROUP_free(EC_GROUP *group); -#ifndef LIBRESSL_INTERNAL void EC_GROUP_clear_free(EC_GROUP *group); -#endif int EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src); EC_GROUP *EC_GROUP_dup(const EC_GROUP *src); @@ -145,12 +143,10 @@ int EC_GROUP_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, int EC_GROUP_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); -#if !defined(LIBRESSL_INTERNAL) int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); -#endif int EC_GROUP_get_degree(const EC_GROUP *group); @@ -176,9 +172,7 @@ int EC_curve_nist2nid(const char *name); EC_POINT *EC_POINT_new(const EC_GROUP *group); void EC_POINT_free(EC_POINT *point); -#ifndef LIBRESSL_INTERNAL void EC_POINT_clear_free(EC_POINT *point); -#endif int EC_POINT_copy(EC_POINT *dst, const EC_POINT *src); EC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group); @@ -193,7 +187,6 @@ int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p, int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx); -#ifndef LIBRESSL_INTERNAL int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, @@ -204,7 +197,6 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, const BIGNUM *x, int y_bit, BN_CTX *ctx); -#endif /* !LIBRESSL_INTERNAL */ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p, point_conversion_form_t form, unsigned char *buf, size_t len, BN_CTX *ctx); int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c index 00a4a703f..dff412458 100644 --- a/lib/libcrypto/ec/ec_lib.c +++ b/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.65 2023/07/25 06:57:26 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.66 2024/04/10 15:01:31 beck Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -136,6 +136,7 @@ EC_GROUP_clear_free(EC_GROUP *group) { EC_GROUP_free(group); } +LCRYPTO_ALIAS(EC_GROUP_clear_free); int EC_GROUP_copy(EC_GROUP *dest, const EC_GROUP *src) @@ -542,6 +543,7 @@ EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, { return EC_GROUP_set_curve(group, p, a, b, ctx); } +LCRYPTO_ALIAS(EC_GROUP_set_curve_GFp); int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, @@ -549,6 +551,7 @@ EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, { return EC_GROUP_get_curve(group, p, a, b, ctx); } +LCRYPTO_ALIAS(EC_GROUP_get_curve_GFp); int EC_GROUP_get_degree(const EC_GROUP *group) @@ -727,6 +730,7 @@ EC_POINT_clear_free(EC_POINT *point) { EC_POINT_free(point); } +LCRYPTO_ALIAS(EC_POINT_clear_free); int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) @@ -862,6 +866,7 @@ EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, { return EC_POINT_set_Jprojective_coordinates(group, point, x, y, z, ctx); } +LCRYPTO_ALIAS(EC_POINT_set_Jprojective_coordinates_GFp); int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, @@ -869,6 +874,7 @@ EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, { return EC_POINT_get_Jprojective_coordinates(group, point, x, y, z, ctx); } +LCRYPTO_ALIAS(EC_POINT_get_Jprojective_coordinates_GFp); int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *point, @@ -914,6 +920,7 @@ EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, { return EC_POINT_set_affine_coordinates(group, point, x, y, ctx); } +LCRYPTO_ALIAS(EC_POINT_set_affine_coordinates_GFp); int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *point, @@ -951,6 +958,7 @@ EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, const EC_POINT *point { return EC_POINT_get_affine_coordinates(group, point, x, y, ctx); } +LCRYPTO_ALIAS(EC_POINT_get_affine_coordinates_GFp); int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, diff --git a/lib/libcrypto/ec/ec_oct.c b/lib/libcrypto/ec/ec_oct.c index 9308d409c..824986650 100644 --- a/lib/libcrypto/ec/ec_oct.c +++ b/lib/libcrypto/ec/ec_oct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_oct.c,v 1.16 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: ec_oct.c,v 1.17 2024/04/10 15:01:31 beck Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -107,6 +107,7 @@ EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, { return EC_POINT_set_compressed_coordinates(group, point, x, y_bit, ctx); } +LCRYPTO_ALIAS(EC_POINT_set_compressed_coordinates_GFp); size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, diff --git a/lib/libcrypto/evp/bio_b64.c b/lib/libcrypto/evp/bio_b64.c index 3c47628f5..32cd1f06d 100644 --- a/lib/libcrypto/evp/bio_b64.c +++ b/lib/libcrypto/evp/bio_b64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_b64.c,v 1.28 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: bio_b64.c,v 1.29 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -111,6 +111,7 @@ BIO_f_base64(void) { return (&methods_b64); } +LCRYPTO_ALIAS(BIO_f_base64); static int b64_new(BIO *bi) diff --git a/lib/libcrypto/evp/bio_enc.c b/lib/libcrypto/evp/bio_enc.c index f9a95f53e..62712830a 100644 --- a/lib/libcrypto/evp/bio_enc.c +++ b/lib/libcrypto/evp/bio_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_enc.c,v 1.31 2024/03/25 04:05:22 joshua Exp $ */ +/* $OpenBSD: bio_enc.c,v 1.32 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -107,6 +107,7 @@ BIO_f_cipher(void) { return (&methods_enc); } +LCRYPTO_ALIAS(BIO_f_cipher); static void bio_enc_ctx_free(BIO_ENC_CTX *ctx) @@ -426,3 +427,4 @@ BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k, return 1; } +LCRYPTO_ALIAS(BIO_set_cipher); diff --git a/lib/libcrypto/evp/bio_md.c b/lib/libcrypto/evp/bio_md.c index ccfcd1ea1..420192d23 100644 --- a/lib/libcrypto/evp/bio_md.c +++ b/lib/libcrypto/evp/bio_md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_md.c,v 1.21 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: bio_md.c,v 1.22 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -94,6 +94,7 @@ BIO_f_md(void) { return (&methods_md); } +LCRYPTO_ALIAS(BIO_f_md); static int md_new(BIO *bi) diff --git a/lib/libcrypto/evp/e_aes.c b/lib/libcrypto/evp/e_aes.c index 6ef3fb37c..6135c7d84 100644 --- a/lib/libcrypto/evp/e_aes.c +++ b/lib/libcrypto/evp/e_aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_aes.c,v 1.56 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_aes.c,v 1.58 2024/04/09 13:52:41 beck Exp $ */ /* ==================================================================== * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. * @@ -572,6 +572,7 @@ EVP_aes_128_cbc(void) return &aes_128_cbc; #endif } +LCRYPTO_ALIAS(EVP_aes_128_cbc); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_ecb = { @@ -606,6 +607,7 @@ EVP_aes_128_ecb(void) return &aes_128_ecb; #endif } +LCRYPTO_ALIAS(EVP_aes_128_ecb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_ofb = { @@ -640,6 +642,7 @@ EVP_aes_128_ofb(void) return &aes_128_ofb; #endif } +LCRYPTO_ALIAS(EVP_aes_128_ofb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_cfb = { @@ -666,7 +669,7 @@ static const EVP_CIPHER aes_128_cfb = { }; const EVP_CIPHER * -EVP_aes_128_cfb(void) +EVP_aes_128_cfb128(void) { #ifdef AESNI_CAPABLE return AESNI_CAPABLE ? &aesni_128_cfb : &aes_128_cfb; @@ -674,6 +677,7 @@ EVP_aes_128_cfb(void) return &aes_128_cfb; #endif } +LCRYPTO_ALIAS(EVP_aes_128_cfb128); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_cfb1 = { @@ -708,6 +712,7 @@ EVP_aes_128_cfb1(void) return &aes_128_cfb1; #endif } +LCRYPTO_ALIAS(EVP_aes_128_cfb1); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_cfb8 = { @@ -742,6 +747,7 @@ EVP_aes_128_cfb8(void) return &aes_128_cfb8; #endif } +LCRYPTO_ALIAS(EVP_aes_128_cfb8); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_128_ctr = { @@ -776,6 +782,7 @@ EVP_aes_128_ctr(void) return &aes_128_ctr; #endif } +LCRYPTO_ALIAS(EVP_aes_128_ctr); #ifdef AESNI_CAPABLE @@ -811,6 +818,7 @@ EVP_aes_192_cbc(void) return &aes_192_cbc; #endif } +LCRYPTO_ALIAS(EVP_aes_192_cbc); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_ecb = { @@ -845,6 +853,7 @@ EVP_aes_192_ecb(void) return &aes_192_ecb; #endif } +LCRYPTO_ALIAS(EVP_aes_192_ecb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_ofb = { @@ -879,6 +888,7 @@ EVP_aes_192_ofb(void) return &aes_192_ofb; #endif } +LCRYPTO_ALIAS(EVP_aes_192_ofb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_cfb = { @@ -905,7 +915,7 @@ static const EVP_CIPHER aes_192_cfb = { }; const EVP_CIPHER * -EVP_aes_192_cfb(void) +EVP_aes_192_cfb128(void) { #ifdef AESNI_CAPABLE return AESNI_CAPABLE ? &aesni_192_cfb : &aes_192_cfb; @@ -913,6 +923,7 @@ EVP_aes_192_cfb(void) return &aes_192_cfb; #endif } +LCRYPTO_ALIAS(EVP_aes_192_cfb128); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_cfb1 = { @@ -947,6 +958,7 @@ EVP_aes_192_cfb1(void) return &aes_192_cfb1; #endif } +LCRYPTO_ALIAS(EVP_aes_192_cfb1); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_cfb8 = { @@ -981,6 +993,7 @@ EVP_aes_192_cfb8(void) return &aes_192_cfb8; #endif } +LCRYPTO_ALIAS(EVP_aes_192_cfb8); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_ctr = { @@ -1015,6 +1028,7 @@ EVP_aes_192_ctr(void) return &aes_192_ctr; #endif } +LCRYPTO_ALIAS(EVP_aes_192_ctr); #ifdef AESNI_CAPABLE @@ -1050,6 +1064,7 @@ EVP_aes_256_cbc(void) return &aes_256_cbc; #endif } +LCRYPTO_ALIAS(EVP_aes_256_cbc); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_ecb = { @@ -1084,6 +1099,7 @@ EVP_aes_256_ecb(void) return &aes_256_ecb; #endif } +LCRYPTO_ALIAS(EVP_aes_256_ecb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_ofb = { @@ -1118,6 +1134,7 @@ EVP_aes_256_ofb(void) return &aes_256_ofb; #endif } +LCRYPTO_ALIAS(EVP_aes_256_ofb); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_cfb = { @@ -1144,7 +1161,7 @@ static const EVP_CIPHER aes_256_cfb = { }; const EVP_CIPHER * -EVP_aes_256_cfb(void) +EVP_aes_256_cfb128(void) { #ifdef AESNI_CAPABLE return AESNI_CAPABLE ? &aesni_256_cfb : &aes_256_cfb; @@ -1152,6 +1169,7 @@ EVP_aes_256_cfb(void) return &aes_256_cfb; #endif } +LCRYPTO_ALIAS(EVP_aes_256_cfb128); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_cfb1 = { @@ -1186,6 +1204,7 @@ EVP_aes_256_cfb1(void) return &aes_256_cfb1; #endif } +LCRYPTO_ALIAS(EVP_aes_256_cfb1); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_cfb8 = { @@ -1220,6 +1239,7 @@ EVP_aes_256_cfb8(void) return &aes_256_cfb8; #endif } +LCRYPTO_ALIAS(EVP_aes_256_cfb8); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_ctr = { @@ -1254,6 +1274,7 @@ EVP_aes_256_ctr(void) return &aes_256_ctr; #endif } +LCRYPTO_ALIAS(EVP_aes_256_ctr); static int aes_gcm_cleanup(EVP_CIPHER_CTX *c) @@ -1677,6 +1698,7 @@ EVP_aes_128_gcm(void) return &aes_128_gcm; #endif } +LCRYPTO_ALIAS(EVP_aes_128_gcm); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_gcm = { @@ -1715,6 +1737,7 @@ EVP_aes_192_gcm(void) return &aes_192_gcm; #endif } +LCRYPTO_ALIAS(EVP_aes_192_gcm); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_gcm = { @@ -1753,6 +1776,7 @@ EVP_aes_256_gcm(void) return &aes_256_gcm; #endif } +LCRYPTO_ALIAS(EVP_aes_256_gcm); static int aes_xts_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) @@ -1919,6 +1943,7 @@ EVP_aes_128_xts(void) return &aes_128_xts; #endif } +LCRYPTO_ALIAS(EVP_aes_128_xts); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_xts = { @@ -1957,6 +1982,7 @@ EVP_aes_256_xts(void) return &aes_256_xts; #endif } +LCRYPTO_ALIAS(EVP_aes_256_xts); static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) @@ -2157,6 +2183,7 @@ EVP_aes_128_ccm(void) return &aes_128_ccm; #endif } +LCRYPTO_ALIAS(EVP_aes_128_ccm); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_192_ccm = { @@ -2195,6 +2222,7 @@ EVP_aes_192_ccm(void) return &aes_192_ccm; #endif } +LCRYPTO_ALIAS(EVP_aes_192_ccm); #ifdef AESNI_CAPABLE static const EVP_CIPHER aesni_256_ccm = { @@ -2233,6 +2261,7 @@ EVP_aes_256_ccm(void) return &aes_256_ccm; #endif } +LCRYPTO_ALIAS(EVP_aes_256_ccm); #define EVP_AEAD_AES_GCM_TAG_LEN 16 @@ -2423,12 +2452,14 @@ EVP_aead_aes_128_gcm(void) { return &aead_aes_128_gcm; } +LCRYPTO_ALIAS(EVP_aead_aes_128_gcm); const EVP_AEAD * EVP_aead_aes_256_gcm(void) { return &aead_aes_256_gcm; } +LCRYPTO_ALIAS(EVP_aead_aes_256_gcm); typedef struct { union { @@ -2557,6 +2588,7 @@ EVP_aes_128_wrap(void) { return &aes_128_wrap; } +LCRYPTO_ALIAS(EVP_aes_128_wrap); static const EVP_CIPHER aes_192_wrap = { .nid = NID_id_aes192_wrap, @@ -2578,6 +2610,7 @@ EVP_aes_192_wrap(void) { return &aes_192_wrap; } +LCRYPTO_ALIAS(EVP_aes_192_wrap); static const EVP_CIPHER aes_256_wrap = { .nid = NID_id_aes256_wrap, @@ -2599,5 +2632,6 @@ EVP_aes_256_wrap(void) { return &aes_256_wrap; } +LCRYPTO_ALIAS(EVP_aes_256_wrap); #endif diff --git a/lib/libcrypto/evp/e_bf.c b/lib/libcrypto/evp/e_bf.c index 90a589c60..4f3799975 100644 --- a/lib/libcrypto/evp/e_bf.c +++ b/lib/libcrypto/evp/e_bf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_bf.c,v 1.18 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_bf.c,v 1.19 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -177,6 +177,7 @@ EVP_bf_cbc(void) { return &bf_cbc; } +LCRYPTO_ALIAS(EVP_bf_cbc); static const EVP_CIPHER bf_cfb64 = { .nid = NID_bf_cfb64, @@ -198,6 +199,7 @@ EVP_bf_cfb64(void) { return &bf_cfb64; } +LCRYPTO_ALIAS(EVP_bf_cfb64); static const EVP_CIPHER bf_ofb = { .nid = NID_bf_ofb64, @@ -219,6 +221,7 @@ EVP_bf_ofb(void) { return &bf_ofb; } +LCRYPTO_ALIAS(EVP_bf_ofb); static const EVP_CIPHER bf_ecb = { .nid = NID_bf_ecb, @@ -240,4 +243,5 @@ EVP_bf_ecb(void) { return &bf_ecb; } +LCRYPTO_ALIAS(EVP_bf_ecb); #endif diff --git a/lib/libcrypto/evp/e_camellia.c b/lib/libcrypto/evp/e_camellia.c index 6d9bedbbc..55dcc7992 100644 --- a/lib/libcrypto/evp/e_camellia.c +++ b/lib/libcrypto/evp/e_camellia.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_camellia.c,v 1.19 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_camellia.c,v 1.20 2024/04/09 13:52:41 beck Exp $ */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * @@ -178,6 +178,7 @@ EVP_camellia_128_cbc(void) { return &camellia_128_cbc; } +LCRYPTO_ALIAS(EVP_camellia_128_cbc); static const EVP_CIPHER camellia_128_cfb128 = { .nid = NID_camellia_128_cfb128, @@ -199,6 +200,7 @@ EVP_camellia_128_cfb128(void) { return &camellia_128_cfb128; } +LCRYPTO_ALIAS(EVP_camellia_128_cfb128); static const EVP_CIPHER camellia_128_ofb = { .nid = NID_camellia_128_ofb128, @@ -220,6 +222,7 @@ EVP_camellia_128_ofb(void) { return &camellia_128_ofb; } +LCRYPTO_ALIAS(EVP_camellia_128_ofb); static const EVP_CIPHER camellia_128_ecb = { .nid = NID_camellia_128_ecb, @@ -241,6 +244,7 @@ EVP_camellia_128_ecb(void) { return &camellia_128_ecb; } +LCRYPTO_ALIAS(EVP_camellia_128_ecb); static int camellia_192_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -332,6 +336,7 @@ EVP_camellia_192_cbc(void) { return &camellia_192_cbc; } +LCRYPTO_ALIAS(EVP_camellia_192_cbc); static const EVP_CIPHER camellia_192_cfb128 = { .nid = NID_camellia_192_cfb128, @@ -353,6 +358,7 @@ EVP_camellia_192_cfb128(void) { return &camellia_192_cfb128; } +LCRYPTO_ALIAS(EVP_camellia_192_cfb128); static const EVP_CIPHER camellia_192_ofb = { .nid = NID_camellia_192_ofb128, @@ -374,6 +380,7 @@ EVP_camellia_192_ofb(void) { return &camellia_192_ofb; } +LCRYPTO_ALIAS(EVP_camellia_192_ofb); static const EVP_CIPHER camellia_192_ecb = { .nid = NID_camellia_192_ecb, @@ -395,6 +402,7 @@ EVP_camellia_192_ecb(void) { return &camellia_192_ecb; } +LCRYPTO_ALIAS(EVP_camellia_192_ecb); static int camellia_256_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -486,6 +494,7 @@ EVP_camellia_256_cbc(void) { return &camellia_256_cbc; } +LCRYPTO_ALIAS(EVP_camellia_256_cbc); static const EVP_CIPHER camellia_256_cfb128 = { .nid = NID_camellia_256_cfb128, @@ -507,6 +516,7 @@ EVP_camellia_256_cfb128(void) { return &camellia_256_cfb128; } +LCRYPTO_ALIAS(EVP_camellia_256_cfb128); static const EVP_CIPHER camellia_256_ofb = { .nid = NID_camellia_256_ofb128, @@ -528,6 +538,7 @@ EVP_camellia_256_ofb(void) { return &camellia_256_ofb; } +LCRYPTO_ALIAS(EVP_camellia_256_ofb); static const EVP_CIPHER camellia_256_ecb = { .nid = NID_camellia_256_ecb, @@ -549,6 +560,7 @@ EVP_camellia_256_ecb(void) { return &camellia_256_ecb; } +LCRYPTO_ALIAS(EVP_camellia_256_ecb); static int camellia_128_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -592,6 +604,7 @@ EVP_camellia_128_cfb1(void) { return &camellia_128_cfb1; } +LCRYPTO_ALIAS(EVP_camellia_128_cfb1); static int camellia_192_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -635,6 +648,7 @@ EVP_camellia_192_cfb1(void) { return &camellia_192_cfb1; } +LCRYPTO_ALIAS(EVP_camellia_192_cfb1); static int camellia_256_cfb1_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -678,6 +692,7 @@ EVP_camellia_256_cfb1(void) { return &camellia_256_cfb1; } +LCRYPTO_ALIAS(EVP_camellia_256_cfb1); static int @@ -720,6 +735,7 @@ EVP_camellia_128_cfb8(void) { return &camellia_128_cfb8; } +LCRYPTO_ALIAS(EVP_camellia_128_cfb8); static int camellia_192_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -761,6 +777,7 @@ EVP_camellia_192_cfb8(void) { return &camellia_192_cfb8; } +LCRYPTO_ALIAS(EVP_camellia_192_cfb8); static int camellia_256_cfb8_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) @@ -802,4 +819,5 @@ EVP_camellia_256_cfb8(void) { return &camellia_256_cfb8; } +LCRYPTO_ALIAS(EVP_camellia_256_cfb8); #endif diff --git a/lib/libcrypto/evp/e_cast.c b/lib/libcrypto/evp/e_cast.c index 5c3e50483..1575a7a5b 100644 --- a/lib/libcrypto/evp/e_cast.c +++ b/lib/libcrypto/evp/e_cast.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_cast.c,v 1.17 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_cast.c,v 1.18 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -177,6 +177,7 @@ EVP_cast5_cbc(void) { return &cast5_cbc; } +LCRYPTO_ALIAS(EVP_cast5_cbc); static const EVP_CIPHER cast5_cfb64 = { .nid = NID_cast5_cfb64, @@ -198,6 +199,7 @@ EVP_cast5_cfb64(void) { return &cast5_cfb64; } +LCRYPTO_ALIAS(EVP_cast5_cfb64); static const EVP_CIPHER cast5_ofb = { .nid = NID_cast5_ofb64, @@ -219,6 +221,7 @@ EVP_cast5_ofb(void) { return &cast5_ofb; } +LCRYPTO_ALIAS(EVP_cast5_ofb); static const EVP_CIPHER cast5_ecb = { .nid = NID_cast5_ecb, @@ -240,4 +243,5 @@ EVP_cast5_ecb(void) { return &cast5_ecb; } +LCRYPTO_ALIAS(EVP_cast5_ecb); #endif diff --git a/lib/libcrypto/evp/e_chacha.c b/lib/libcrypto/evp/e_chacha.c index 5cd03c7c8..4c801b392 100644 --- a/lib/libcrypto/evp/e_chacha.c +++ b/lib/libcrypto/evp/e_chacha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_chacha.c,v 1.13 2023/08/24 04:20:57 tb Exp $ */ +/* $OpenBSD: e_chacha.c,v 1.14 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -72,5 +72,6 @@ EVP_chacha20(void) { return (&chacha20_cipher); } +LCRYPTO_ALIAS(EVP_chacha20); #endif diff --git a/lib/libcrypto/evp/e_chacha20poly1305.c b/lib/libcrypto/evp/e_chacha20poly1305.c index 796824aee..cc2e0157e 100644 --- a/lib/libcrypto/evp/e_chacha20poly1305.c +++ b/lib/libcrypto/evp/e_chacha20poly1305.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_chacha20poly1305.c,v 1.34 2023/12/30 18:24:09 tb Exp $ */ +/* $OpenBSD: e_chacha20poly1305.c,v 1.35 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2022 Joel Sing @@ -349,6 +349,7 @@ EVP_aead_chacha20_poly1305(void) { return &aead_chacha20_poly1305; } +LCRYPTO_ALIAS(EVP_aead_chacha20_poly1305); static const EVP_AEAD aead_xchacha20_poly1305 = { .key_len = 32, @@ -367,6 +368,7 @@ EVP_aead_xchacha20_poly1305(void) { return &aead_xchacha20_poly1305; } +LCRYPTO_ALIAS(EVP_aead_xchacha20_poly1305); struct chacha20_poly1305_ctx { ChaCha_ctx chacha; @@ -614,5 +616,6 @@ EVP_chacha20_poly1305(void) { return &cipher_chacha20_poly1305; } +LCRYPTO_ALIAS(EVP_chacha20_poly1305); #endif /* !OPENSSL_NO_CHACHA && !OPENSSL_NO_POLY1305 */ diff --git a/lib/libcrypto/evp/e_des.c b/lib/libcrypto/evp/e_des.c index 7a0b24c1a..fb335e95b 100644 --- a/lib/libcrypto/evp/e_des.c +++ b/lib/libcrypto/evp/e_des.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_des.c,v 1.23 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_des.c,v 1.24 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -241,6 +241,7 @@ EVP_des_cbc(void) { return &des_cbc; } +LCRYPTO_ALIAS(EVP_des_cbc); static const EVP_CIPHER des_cfb64 = { .nid = NID_des_cfb64, @@ -262,6 +263,7 @@ EVP_des_cfb64(void) { return &des_cfb64; } +LCRYPTO_ALIAS(EVP_des_cfb64); static const EVP_CIPHER des_ofb = { .nid = NID_des_ofb64, @@ -283,6 +285,7 @@ EVP_des_ofb(void) { return &des_ofb; } +LCRYPTO_ALIAS(EVP_des_ofb); static const EVP_CIPHER des_ecb = { .nid = NID_des_ecb, @@ -304,6 +307,7 @@ EVP_des_ecb(void) { return &des_ecb; } +LCRYPTO_ALIAS(EVP_des_ecb); static const EVP_CIPHER des_cfb1 = { .nid = NID_des_cfb1, @@ -325,6 +329,7 @@ EVP_des_cfb1(void) { return &des_cfb1; } +LCRYPTO_ALIAS(EVP_des_cfb1); static const EVP_CIPHER des_cfb8 = { .nid = NID_des_cfb8, @@ -346,4 +351,5 @@ EVP_des_cfb8(void) { return &des_cfb8; } +LCRYPTO_ALIAS(EVP_des_cfb8); #endif diff --git a/lib/libcrypto/evp/e_des3.c b/lib/libcrypto/evp/e_des3.c index f283be291..48fbcdb36 100644 --- a/lib/libcrypto/evp/e_des3.c +++ b/lib/libcrypto/evp/e_des3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_des3.c,v 1.29 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_des3.c,v 1.30 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -273,6 +273,7 @@ EVP_des_ede_cbc(void) { return &des_ede_cbc; } +LCRYPTO_ALIAS(EVP_des_ede_cbc); static const EVP_CIPHER des_ede_cfb64 = { .nid = NID_des_ede_cfb64, @@ -294,6 +295,7 @@ EVP_des_ede_cfb64(void) { return &des_ede_cfb64; } +LCRYPTO_ALIAS(EVP_des_ede_cfb64); static const EVP_CIPHER des_ede_ofb = { .nid = NID_des_ede_ofb64, @@ -315,6 +317,7 @@ EVP_des_ede_ofb(void) { return &des_ede_ofb; } +LCRYPTO_ALIAS(EVP_des_ede_ofb); static const EVP_CIPHER des_ede_ecb = { .nid = NID_des_ede_ecb, @@ -336,6 +339,7 @@ EVP_des_ede_ecb(void) { return &des_ede_ecb; } +LCRYPTO_ALIAS(EVP_des_ede_ecb); #define des_ede3_cfb64_cipher des_ede_cfb64_cipher @@ -363,6 +367,7 @@ EVP_des_ede3_cbc(void) { return &des_ede3_cbc; } +LCRYPTO_ALIAS(EVP_des_ede3_cbc); static const EVP_CIPHER des_ede3_cfb64 = { .nid = NID_des_ede3_cfb64, @@ -384,6 +389,7 @@ EVP_des_ede3_cfb64(void) { return &des_ede3_cfb64; } +LCRYPTO_ALIAS(EVP_des_ede3_cfb64); static const EVP_CIPHER des_ede3_ofb = { .nid = NID_des_ede3_ofb64, @@ -405,6 +411,7 @@ EVP_des_ede3_ofb(void) { return &des_ede3_ofb; } +LCRYPTO_ALIAS(EVP_des_ede3_ofb); static const EVP_CIPHER des_ede3_ecb = { .nid = NID_des_ede3_ecb, @@ -426,6 +433,7 @@ EVP_des_ede3_ecb(void) { return &des_ede3_ecb; } +LCRYPTO_ALIAS(EVP_des_ede3_ecb); static const EVP_CIPHER des_ede3_cfb1 = { @@ -448,6 +456,7 @@ EVP_des_ede3_cfb1(void) { return &des_ede3_cfb1; } +LCRYPTO_ALIAS(EVP_des_ede3_cfb1); static const EVP_CIPHER des_ede3_cfb8 = { @@ -470,16 +479,19 @@ EVP_des_ede3_cfb8(void) { return &des_ede3_cfb8; } +LCRYPTO_ALIAS(EVP_des_ede3_cfb8); const EVP_CIPHER * EVP_des_ede(void) { return &des_ede_ecb; } +LCRYPTO_ALIAS(EVP_des_ede); const EVP_CIPHER * EVP_des_ede3(void) { return &des_ede3_ecb; } +LCRYPTO_ALIAS(EVP_des_ede3); #endif diff --git a/lib/libcrypto/evp/e_idea.c b/lib/libcrypto/evp/e_idea.c index 025a1f508..86cf77602 100644 --- a/lib/libcrypto/evp/e_idea.c +++ b/lib/libcrypto/evp/e_idea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_idea.c,v 1.21 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_idea.c,v 1.22 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -196,6 +196,7 @@ EVP_idea_cbc(void) { return &idea_cbc; } +LCRYPTO_ALIAS(EVP_idea_cbc); static const EVP_CIPHER idea_cfb64 = { .nid = NID_idea_cfb64, @@ -217,6 +218,7 @@ EVP_idea_cfb64(void) { return &idea_cfb64; } +LCRYPTO_ALIAS(EVP_idea_cfb64); static const EVP_CIPHER idea_ofb = { .nid = NID_idea_ofb64, @@ -238,6 +240,7 @@ EVP_idea_ofb(void) { return &idea_ofb; } +LCRYPTO_ALIAS(EVP_idea_ofb); static const EVP_CIPHER idea_ecb = { .nid = NID_idea_ecb, @@ -259,4 +262,5 @@ EVP_idea_ecb(void) { return &idea_ecb; } +LCRYPTO_ALIAS(EVP_idea_ecb); #endif diff --git a/lib/libcrypto/evp/e_null.c b/lib/libcrypto/evp/e_null.c index be46c1cca..bcb8a1e56 100644 --- a/lib/libcrypto/evp/e_null.c +++ b/lib/libcrypto/evp/e_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_null.c,v 1.20 2024/01/07 15:42:57 tb Exp $ */ +/* $OpenBSD: e_null.c,v 1.21 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -89,6 +89,7 @@ EVP_enc_null(void) { return (&n_cipher); } +LCRYPTO_ALIAS(EVP_enc_null); static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/lib/libcrypto/evp/e_rc2.c b/lib/libcrypto/evp/e_rc2.c index 25caef6e3..dc404cff2 100644 --- a/lib/libcrypto/evp/e_rc2.c +++ b/lib/libcrypto/evp/e_rc2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_rc2.c,v 1.28 2024/03/26 06:58:21 tb Exp $ */ +/* $OpenBSD: e_rc2.c,v 1.29 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -179,6 +179,7 @@ EVP_rc2_cbc(void) { return &rc2_cbc; } +LCRYPTO_ALIAS(EVP_rc2_cbc); static const EVP_CIPHER rc2_cfb64 = { .nid = NID_rc2_cfb64, @@ -200,6 +201,7 @@ EVP_rc2_cfb64(void) { return &rc2_cfb64; } +LCRYPTO_ALIAS(EVP_rc2_cfb64); static const EVP_CIPHER rc2_ofb = { .nid = NID_rc2_ofb64, @@ -221,6 +223,7 @@ EVP_rc2_ofb(void) { return &rc2_ofb; } +LCRYPTO_ALIAS(EVP_rc2_ofb); static const EVP_CIPHER rc2_ecb = { .nid = NID_rc2_ecb, @@ -242,6 +245,7 @@ EVP_rc2_ecb(void) { return &rc2_ecb; } +LCRYPTO_ALIAS(EVP_rc2_ecb); #define RC2_40_MAGIC 0xa0 #define RC2_64_MAGIC 0x78 @@ -282,12 +286,14 @@ EVP_rc2_64_cbc(void) { return (&r2_64_cbc_cipher); } +LCRYPTO_ALIAS(EVP_rc2_64_cbc); const EVP_CIPHER * EVP_rc2_40_cbc(void) { return (&r2_40_cbc_cipher); } +LCRYPTO_ALIAS(EVP_rc2_40_cbc); static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/lib/libcrypto/evp/e_rc4.c b/lib/libcrypto/evp/e_rc4.c index c0f12fb03..df0748341 100644 --- a/lib/libcrypto/evp/e_rc4.c +++ b/lib/libcrypto/evp/e_rc4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_rc4.c,v 1.19 2024/01/07 15:42:57 tb Exp $ */ +/* $OpenBSD: e_rc4.c,v 1.20 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -117,12 +117,14 @@ EVP_rc4(void) { return (&r4_cipher); } +LCRYPTO_ALIAS(EVP_rc4); const EVP_CIPHER * EVP_rc4_40(void) { return (&r4_40_cipher); } +LCRYPTO_ALIAS(EVP_rc4_40); static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/lib/libcrypto/evp/e_sm4.c b/lib/libcrypto/evp/e_sm4.c index 85b4d3ca0..cde2f6c64 100644 --- a/lib/libcrypto/evp/e_sm4.c +++ b/lib/libcrypto/evp/e_sm4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sm4.c,v 1.12 2024/01/04 17:38:36 tb Exp $ */ +/* $OpenBSD: e_sm4.c,v 1.13 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2017, 2019 Ribose Inc * @@ -164,6 +164,7 @@ EVP_sm4_cbc(void) { return &sm4_cbc; } +LCRYPTO_ALIAS(EVP_sm4_cbc); static const EVP_CIPHER sm4_cfb128 = { .nid = NID_sm4_cfb128, @@ -185,6 +186,7 @@ EVP_sm4_cfb128(void) { return &sm4_cfb128; } +LCRYPTO_ALIAS(EVP_sm4_cfb128); static const EVP_CIPHER sm4_ofb = { .nid = NID_sm4_ofb128, @@ -206,6 +208,7 @@ EVP_sm4_ofb(void) { return &sm4_ofb; } +LCRYPTO_ALIAS(EVP_sm4_ofb); static const EVP_CIPHER sm4_ecb = { .nid = NID_sm4_ecb, @@ -227,6 +230,7 @@ EVP_sm4_ecb(void) { return &sm4_ecb; } +LCRYPTO_ALIAS(EVP_sm4_ecb); static int sm4_ctr_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, @@ -259,4 +263,5 @@ EVP_sm4_ctr(void) { return &sm4_ctr_mode; } +LCRYPTO_ALIAS(EVP_sm4_ctr); #endif diff --git a/lib/libcrypto/evp/e_xcbc_d.c b/lib/libcrypto/evp/e_xcbc_d.c index dc01cbb98..1e3bee079 100644 --- a/lib/libcrypto/evp/e_xcbc_d.c +++ b/lib/libcrypto/evp/e_xcbc_d.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_xcbc_d.c,v 1.17 2024/01/07 15:42:57 tb Exp $ */ +/* $OpenBSD: e_xcbc_d.c,v 1.18 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -103,6 +103,7 @@ EVP_desx_cbc(void) { return (&d_xcbc_cipher); } +LCRYPTO_ALIAS(EVP_desx_cbc); static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index f6123963e..26695dc3d 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.132 2024/03/02 10:21:12 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.133 2024/04/10 15:00:38 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -442,9 +442,7 @@ int EVP_Cipher(EVP_CIPHER_CTX *c, unsigned char *out, const unsigned char *in, EVP_MD_CTX *EVP_MD_CTX_new(void); void EVP_MD_CTX_free(EVP_MD_CTX *ctx); -#ifndef LIBRESSL_INTERNAL int EVP_MD_CTX_init(EVP_MD_CTX *ctx); -#endif int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); EVP_MD_CTX *EVP_MD_CTX_create(void); void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); @@ -486,9 +484,7 @@ int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); -#ifndef LIBRESSL_INTERNAL int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); -#endif int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv); @@ -497,9 +493,7 @@ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -#ifndef LIBRESSL_INTERNAL int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -#endif int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv, int enc); @@ -508,9 +502,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -#ifndef LIBRESSL_INTERNAL int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -#endif int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, EVP_PKEY *pkey); @@ -556,9 +548,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); -#ifndef LIBRESSL_INTERNAL int EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); -#endif int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); diff --git a/lib/libcrypto/evp/evp_aead.c b/lib/libcrypto/evp/evp_aead.c index 3579533e5..b35f5157e 100644 --- a/lib/libcrypto/evp/evp_aead.c +++ b/lib/libcrypto/evp/evp_aead.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_aead.c,v 1.10 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: evp_aead.c,v 1.11 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -28,24 +28,28 @@ EVP_AEAD_key_length(const EVP_AEAD *aead) { return aead->key_len; } +LCRYPTO_ALIAS(EVP_AEAD_key_length); size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead) { return aead->nonce_len; } +LCRYPTO_ALIAS(EVP_AEAD_nonce_length); size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead) { return aead->overhead; } +LCRYPTO_ALIAS(EVP_AEAD_max_overhead); size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead) { return aead->max_tag_len; } +LCRYPTO_ALIAS(EVP_AEAD_max_tag_len); int EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, @@ -58,6 +62,7 @@ EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, } return aead->init(ctx, key, key_len, tag_len); } +LCRYPTO_ALIAS(EVP_AEAD_CTX_init); void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx) @@ -67,12 +72,14 @@ EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx) ctx->aead->cleanup(ctx); ctx->aead = NULL; } +LCRYPTO_ALIAS(EVP_AEAD_CTX_cleanup); EVP_AEAD_CTX * EVP_AEAD_CTX_new(void) { return calloc(1, sizeof(EVP_AEAD_CTX)); } +LCRYPTO_ALIAS(EVP_AEAD_CTX_new); void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx) @@ -83,6 +90,7 @@ EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx) EVP_AEAD_CTX_cleanup(ctx); free(ctx); } +LCRYPTO_ALIAS(EVP_AEAD_CTX_free); /* check_alias returns 0 if out points within the buffer determined by in * and in_len and 1 otherwise. @@ -133,6 +141,7 @@ error: *out_len = 0; return 0; } +LCRYPTO_ALIAS(EVP_AEAD_CTX_seal); int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, unsigned char *out, size_t *out_len, @@ -158,3 +167,4 @@ error: *out_len = 0; return 0; } +LCRYPTO_ALIAS(EVP_AEAD_CTX_open); diff --git a/lib/libcrypto/evp/evp_cipher.c b/lib/libcrypto/evp/evp_cipher.c index 48aaea0f1..e9c266d1b 100644 --- a/lib/libcrypto/evp/evp_cipher.c +++ b/lib/libcrypto/evp/evp_cipher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_cipher.c,v 1.21 2024/03/02 09:55:30 tb Exp $ */ +/* $OpenBSD: evp_cipher.c,v 1.23 2024/04/10 15:00:38 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -127,6 +127,7 @@ EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, { return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, enc); } +LCRYPTO_ALIAS(EVP_CipherInit); int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, @@ -242,6 +243,7 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, return 1; } +LCRYPTO_ALIAS(EVP_CipherInit_ex); int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, @@ -252,6 +254,7 @@ EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, return EVP_DecryptUpdate(ctx, out, out_len, in, in_len); } +LCRYPTO_ALIAS(EVP_CipherUpdate); int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) @@ -261,6 +264,7 @@ EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) return EVP_DecryptFinal_ex(ctx, out, out_len); } +LCRYPTO_ALIAS(EVP_CipherFinal); int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) @@ -270,6 +274,7 @@ EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) return EVP_DecryptFinal_ex(ctx, out, out_len); } +LCRYPTO_ALIAS(EVP_CipherFinal_ex); int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, @@ -277,6 +282,7 @@ EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, { return EVP_CipherInit(ctx, cipher, key, iv, 1); } +LCRYPTO_ALIAS(EVP_EncryptInit); int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, @@ -284,6 +290,7 @@ EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine { return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 1); } +LCRYPTO_ALIAS(EVP_EncryptInit_ex); /* * EVP_Cipher() is an implementation detail of EVP_Cipher{Update,Final}(). @@ -303,6 +310,7 @@ EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, { return ctx->cipher->do_cipher(ctx, out, in, in_len); } +LCRYPTO_ALIAS(EVP_Cipher); static int evp_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, @@ -413,12 +421,14 @@ EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, return 1; } +LCRYPTO_ALIAS(EVP_EncryptUpdate); int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) { return EVP_EncryptFinal_ex(ctx, out, out_len); } +LCRYPTO_ALIAS(EVP_EncryptFinal); int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) @@ -453,6 +463,7 @@ EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) return evp_cipher(ctx, out, out_len, ctx->buf, block_size); } +LCRYPTO_ALIAS(EVP_EncryptFinal_ex); int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, @@ -460,6 +471,7 @@ EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, { return EVP_CipherInit(ctx, cipher, key, iv, 0); } +LCRYPTO_ALIAS(EVP_DecryptInit); int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine, @@ -467,6 +479,7 @@ EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *engine { return EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, 0); } +LCRYPTO_ALIAS(EVP_DecryptInit_ex); int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, @@ -536,12 +549,14 @@ EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len, return 1; } +LCRYPTO_ALIAS(EVP_DecryptUpdate); int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) { return EVP_DecryptFinal_ex(ctx, out, out_len); } +LCRYPTO_ALIAS(EVP_DecryptFinal); int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) @@ -594,12 +609,14 @@ EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *out_len) return 1; } +LCRYPTO_ALIAS(EVP_DecryptFinal_ex); EVP_CIPHER_CTX * EVP_CIPHER_CTX_new(void) { return calloc(1, sizeof(EVP_CIPHER_CTX)); } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_new); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) @@ -611,6 +628,7 @@ EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) free(ctx); } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_free); void EVP_CIPHER_CTX_legacy_clear(EVP_CIPHER_CTX *ctx) @@ -623,12 +641,14 @@ EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx) { return EVP_CIPHER_CTX_cleanup(ctx); } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_init); int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { return EVP_CIPHER_CTX_cleanup(ctx); } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_reset); int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *ctx) @@ -651,6 +671,7 @@ EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *ctx) return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_cleanup); int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) @@ -674,6 +695,7 @@ EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr) } return ret; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_ctrl); int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key) @@ -683,6 +705,7 @@ EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key) arc4random_buf(key, ctx->key_len); return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_rand_key); int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) @@ -722,6 +745,7 @@ EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_copy); /* * EVP_CIPHER_CTX accessors. @@ -732,12 +756,14 @@ EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx) { return ctx->cipher; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_cipher); int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) { return ctx->encrypt; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_encrypting); int EVP_CIPHER_CTX_get_iv(const EVP_CIPHER_CTX *ctx, unsigned char *iv, size_t len) @@ -757,6 +783,7 @@ EVP_CIPHER_CTX_get_iv(const EVP_CIPHER_CTX *ctx, unsigned char *iv, size_t len) } return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_get_iv); int EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, const unsigned char *iv, size_t len) @@ -776,30 +803,35 @@ EVP_CIPHER_CTX_set_iv(EVP_CIPHER_CTX *ctx, const unsigned char *iv, size_t len) } return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_iv); unsigned char * EVP_CIPHER_CTX_buf_noconst(EVP_CIPHER_CTX *ctx) { return ctx->buf; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_buf_noconst); void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx) { return ctx->app_data; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_get_app_data); void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) { ctx->app_data = data; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_app_data); int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) { return ctx->key_len; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_key_length); int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len) @@ -813,6 +845,7 @@ EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, int key_len) EVPerror(EVP_R_INVALID_KEY_LENGTH); return 0; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_key_length); int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad) @@ -823,30 +856,35 @@ EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad) ctx->flags |= EVP_CIPH_NO_PADDING; return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_padding); void EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags) { ctx->flags |= flags; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_flags); void EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags) { ctx->flags &= ~flags; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_clear_flags); int EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags) { return (ctx->flags & flags); } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_test_flags); void * EVP_CIPHER_CTX_get_cipher_data(const EVP_CIPHER_CTX *ctx) { return ctx->cipher_data; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_get_cipher_data); void * EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data) @@ -858,6 +896,7 @@ EVP_CIPHER_CTX_set_cipher_data(EVP_CIPHER_CTX *ctx, void *cipher_data) return old_cipher_data; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_set_cipher_data); /* * EVP_CIPHER_CTX getters that reach into the cipher attached to the context. @@ -868,12 +907,14 @@ EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->nid; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_nid); int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->block_size; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_block_size); int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) @@ -893,12 +934,14 @@ EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) return iv_length; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_iv_length); unsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->flags; } +LCRYPTO_ALIAS(EVP_CIPHER_CTX_flags); /* * Used by CMS and its predecessors. Only GOST and RC2 have a custom method. @@ -1020,6 +1063,7 @@ EVP_CIPHER_type(const EVP_CIPHER *cipher) return nid; } } +LCRYPTO_ALIAS(EVP_CIPHER_type); /* * Accessors. First the trivial getters, then the setters for the method API. @@ -1030,30 +1074,35 @@ EVP_CIPHER_nid(const EVP_CIPHER *cipher) { return cipher->nid; } +LCRYPTO_ALIAS(EVP_CIPHER_nid); int EVP_CIPHER_block_size(const EVP_CIPHER *cipher) { return cipher->block_size; } +LCRYPTO_ALIAS(EVP_CIPHER_block_size); int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) { return cipher->key_len; } +LCRYPTO_ALIAS(EVP_CIPHER_key_length); int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) { return cipher->iv_len; } +LCRYPTO_ALIAS(EVP_CIPHER_iv_length); unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher) { return cipher->flags; } +LCRYPTO_ALIAS(EVP_CIPHER_flags); EVP_CIPHER * EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len) @@ -1076,6 +1125,7 @@ EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len) return cipher; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_new); EVP_CIPHER * EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher) @@ -1089,12 +1139,14 @@ EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher) return copy; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_dup); void EVP_CIPHER_meth_free(EVP_CIPHER *cipher) { free(cipher); } +LCRYPTO_ALIAS(EVP_CIPHER_meth_free); int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len) @@ -1103,6 +1155,7 @@ EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len) return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_iv_length); int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags) @@ -1111,6 +1164,7 @@ EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags) return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_flags); int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size) @@ -1119,6 +1173,7 @@ EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size) return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_impl_ctx_size); int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, @@ -1129,6 +1184,7 @@ EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_init); int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, @@ -1139,6 +1195,7 @@ EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_do_cipher); int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, @@ -1148,6 +1205,7 @@ EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_cleanup); int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, @@ -1157,6 +1215,7 @@ EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_set_asn1_params); int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, @@ -1166,6 +1225,7 @@ EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_get_asn1_params); int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, @@ -1175,3 +1235,4 @@ EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, return 1; } +LCRYPTO_ALIAS(EVP_CIPHER_meth_set_ctrl); diff --git a/lib/libcrypto/evp/evp_digest.c b/lib/libcrypto/evp/evp_digest.c index d36076029..0a97d25c7 100644 --- a/lib/libcrypto/evp/evp_digest.c +++ b/lib/libcrypto/evp/evp_digest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_digest.c,v 1.12 2024/03/02 09:59:56 tb Exp $ */ +/* $OpenBSD: evp_digest.c,v 1.14 2024/04/10 15:00:38 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -126,6 +126,7 @@ EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) EVP_MD_CTX_legacy_clear(ctx); return EVP_DigestInit_ex(ctx, type, NULL); } +LCRYPTO_ALIAS(EVP_DigestInit); int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) @@ -161,12 +162,14 @@ EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) return 1; return ctx->digest->init(ctx); } +LCRYPTO_ALIAS(EVP_DigestInit_ex); int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) { return ctx->update(ctx, data, count); } +LCRYPTO_ALIAS(EVP_DigestUpdate); /* The caller can assume that this removes any secret data from the context */ int @@ -178,6 +181,7 @@ EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) EVP_MD_CTX_cleanup(ctx); return ret; } +LCRYPTO_ALIAS(EVP_DigestFinal); /* The caller can assume that this removes any secret data from the context */ int @@ -199,6 +203,7 @@ EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) memset(ctx->md_data, 0, ctx->digest->ctx_size); return ret; } +LCRYPTO_ALIAS(EVP_DigestFinal_ex); int EVP_Digest(const void *data, size_t count, @@ -216,12 +221,14 @@ EVP_Digest(const void *data, size_t count, return ret; } +LCRYPTO_ALIAS(EVP_Digest); EVP_MD_CTX * EVP_MD_CTX_new(void) { return calloc(1, sizeof(EVP_MD_CTX)); } +LCRYPTO_ALIAS(EVP_MD_CTX_new); void EVP_MD_CTX_free(EVP_MD_CTX *ctx) @@ -233,18 +240,21 @@ EVP_MD_CTX_free(EVP_MD_CTX *ctx) free(ctx); } +LCRYPTO_ALIAS(EVP_MD_CTX_free); EVP_MD_CTX * EVP_MD_CTX_create(void) { return EVP_MD_CTX_new(); } +LCRYPTO_ALIAS(EVP_MD_CTX_create); void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) { EVP_MD_CTX_free(ctx); } +LCRYPTO_ALIAS(EVP_MD_CTX_destroy); void EVP_MD_CTX_legacy_clear(EVP_MD_CTX *ctx) @@ -257,12 +267,14 @@ EVP_MD_CTX_init(EVP_MD_CTX *ctx) { return EVP_MD_CTX_cleanup(ctx); } +LCRYPTO_ALIAS(EVP_MD_CTX_init); int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { return EVP_MD_CTX_cleanup(ctx); } +LCRYPTO_ALIAS(EVP_MD_CTX_reset); int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) @@ -290,6 +302,7 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) return 1; } +LCRYPTO_ALIAS(EVP_MD_CTX_cleanup); int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) @@ -297,6 +310,7 @@ EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) EVP_MD_CTX_legacy_clear(out); return EVP_MD_CTX_copy_ex(out, in); } +LCRYPTO_ALIAS(EVP_MD_CTX_copy); int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) @@ -352,6 +366,7 @@ EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) return 1; } +LCRYPTO_ALIAS(EVP_MD_CTX_copy_ex); int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) @@ -375,6 +390,7 @@ EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) } return ret; } +LCRYPTO_ALIAS(EVP_MD_CTX_ctrl); const EVP_MD * EVP_MD_CTX_md(const EVP_MD_CTX *ctx) @@ -383,36 +399,42 @@ EVP_MD_CTX_md(const EVP_MD_CTX *ctx) return NULL; return ctx->digest; } +LCRYPTO_ALIAS(EVP_MD_CTX_md); void EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags) { ctx->flags &= ~flags; } +LCRYPTO_ALIAS(EVP_MD_CTX_clear_flags); void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags) { ctx->flags |= flags; } +LCRYPTO_ALIAS(EVP_MD_CTX_set_flags); int EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags) { return (ctx->flags & flags); } +LCRYPTO_ALIAS(EVP_MD_CTX_test_flags); void * EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx) { return ctx->md_data; } +LCRYPTO_ALIAS(EVP_MD_CTX_md_data); EVP_PKEY_CTX * EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx) { return ctx->pctx; } +LCRYPTO_ALIAS(EVP_MD_CTX_pkey_ctx); void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx) @@ -436,18 +458,21 @@ EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx) EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX); } } +LCRYPTO_ALIAS(EVP_MD_CTX_set_pkey_ctx); int EVP_MD_type(const EVP_MD *md) { return md->type; } +LCRYPTO_ALIAS(EVP_MD_type); int EVP_MD_pkey_type(const EVP_MD *md) { return md->pkey_type; } +LCRYPTO_ALIAS(EVP_MD_pkey_type); int EVP_MD_size(const EVP_MD *md) @@ -458,15 +483,18 @@ EVP_MD_size(const EVP_MD *md) } return md->md_size; } +LCRYPTO_ALIAS(EVP_MD_size); unsigned long EVP_MD_flags(const EVP_MD *md) { return md->flags; } +LCRYPTO_ALIAS(EVP_MD_flags); int EVP_MD_block_size(const EVP_MD *md) { return md->block_size; } +LCRYPTO_ALIAS(EVP_MD_block_size); diff --git a/lib/libcrypto/evp/evp_encode.c b/lib/libcrypto/evp/evp_encode.c index 199bdfa27..ae6ec476e 100644 --- a/lib/libcrypto/evp/evp_encode.c +++ b/lib/libcrypto/evp/evp_encode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_encode.c,v 1.2 2023/12/29 10:31:50 tb Exp $ */ +/* $OpenBSD: evp_encode.c,v 1.3 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -128,12 +128,14 @@ EVP_ENCODE_CTX_new(void) { return calloc(1, sizeof(EVP_ENCODE_CTX)); } +LCRYPTO_ALIAS(EVP_ENCODE_CTX_new); void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx) { free(ctx); } +LCRYPTO_ALIAS(EVP_ENCODE_CTX_free); void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) @@ -142,6 +144,7 @@ EVP_EncodeInit(EVP_ENCODE_CTX *ctx) ctx->num = 0; ctx->line_num = 0; } +LCRYPTO_ALIAS(EVP_EncodeInit); int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, @@ -192,6 +195,7 @@ EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, return 1; } +LCRYPTO_ALIAS(EVP_EncodeUpdate); void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) @@ -206,6 +210,7 @@ EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) } *outl = ret; } +LCRYPTO_ALIAS(EVP_EncodeFinal); int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) @@ -238,6 +243,7 @@ EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) *t = '\0'; return (ret); } +LCRYPTO_ALIAS(EVP_EncodeBlock); void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) @@ -247,6 +253,7 @@ EVP_DecodeInit(EVP_ENCODE_CTX *ctx) ctx->line_num = 0; ctx->expect_nl = 0; } +LCRYPTO_ALIAS(EVP_DecodeInit); int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, @@ -355,6 +362,7 @@ EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, ctx->num = n; return (rv); } +LCRYPTO_ALIAS(EVP_DecodeUpdate); int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) @@ -395,6 +403,7 @@ EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) } return (ret); } +LCRYPTO_ALIAS(EVP_DecodeBlock); int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) @@ -412,3 +421,4 @@ EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) } else return (1); } +LCRYPTO_ALIAS(EVP_DecodeFinal); diff --git a/lib/libcrypto/evp/evp_err.c b/lib/libcrypto/evp/evp_err.c index 039e17e6c..07515f4d9 100644 --- a/lib/libcrypto/evp/evp_err.c +++ b/lib/libcrypto/evp/evp_err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_err.c,v 1.32 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: evp_err.c,v 1.33 2024/04/09 13:52:41 beck Exp $ */ /* ==================================================================== * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. * @@ -164,3 +164,4 @@ ERR_load_EVP_strings(void) } #endif } +LCRYPTO_ALIAS(ERR_load_EVP_strings); diff --git a/lib/libcrypto/evp/evp_key.c b/lib/libcrypto/evp/evp_key.c index da103c853..e7c7ec329 100644 --- a/lib/libcrypto/evp/evp_key.c +++ b/lib/libcrypto/evp/evp_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_key.c,v 1.35 2024/03/25 10:58:06 joshua Exp $ */ +/* $OpenBSD: evp_key.c,v 1.36 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -78,6 +78,7 @@ EVP_set_pw_prompt(const char *prompt) else strlcpy(prompt_string, prompt, sizeof(prompt_string)); } +LCRYPTO_ALIAS(EVP_set_pw_prompt); char * EVP_get_pw_prompt(void) @@ -87,12 +88,14 @@ EVP_get_pw_prompt(void) return prompt_string; } +LCRYPTO_ALIAS(EVP_get_pw_prompt); int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) { return EVP_read_pw_string_min(buf, 0, len, prompt, verify); } +LCRYPTO_ALIAS(EVP_read_pw_string); int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, @@ -129,6 +132,7 @@ EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, return ret; } +LCRYPTO_ALIAS(EVP_read_pw_string_min); int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, @@ -216,3 +220,4 @@ err: explicit_bzero(md_buf, sizeof md_buf); return rv; } +LCRYPTO_ALIAS(EVP_BytesToKey); diff --git a/lib/libcrypto/evp/evp_names.c b/lib/libcrypto/evp/evp_names.c index d1e21d279..99ad53e3a 100644 --- a/lib/libcrypto/evp/evp_names.c +++ b/lib/libcrypto/evp/evp_names.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_names.c,v 1.15 2024/03/24 13:56:35 jca Exp $ */ +/* $OpenBSD: evp_names.c,v 1.16 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2023 Theo Buehler * @@ -1495,6 +1495,7 @@ EVP_CIPHER_do_all_sorted(void (*fn)(const EVP_CIPHER *, const char *, fn(evp_cipher, cipher->name, NULL, arg); } } +LCRYPTO_ALIAS(EVP_CIPHER_do_all_sorted); void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *, const char *, const char *, @@ -1502,6 +1503,7 @@ EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *, const char *, const char *, { EVP_CIPHER_do_all_sorted(fn, arg); } +LCRYPTO_ALIAS(EVP_CIPHER_do_all); void EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *, const char *, const char *, @@ -1525,6 +1527,7 @@ EVP_MD_do_all_sorted(void (*fn)(const EVP_MD *, const char *, const char *, fn(evp_md, digest->name, NULL, arg); } } +LCRYPTO_ALIAS(EVP_MD_do_all_sorted); void EVP_MD_do_all(void (*fn)(const EVP_MD *, const char *, const char *, void *), @@ -1532,6 +1535,7 @@ EVP_MD_do_all(void (*fn)(const EVP_MD *, const char *, const char *, void *), { EVP_MD_do_all_sorted(fn, arg); } +LCRYPTO_ALIAS(EVP_MD_do_all); /* * The OBJ_NAME API is completely misnamed. It has little to do with objects @@ -1652,6 +1656,7 @@ EVP_get_cipherbyname(const char *name) return cipher->cipher(); } +LCRYPTO_ALIAS(EVP_get_cipherbyname); static int digest_cmp(const void *a, const void *b) @@ -1676,6 +1681,7 @@ EVP_get_digestbyname(const char *name) return digest->digest(); } +LCRYPTO_ALIAS(EVP_get_digestbyname); /* * XXX - this is here because most of its job was to clean up the dynamic @@ -1687,3 +1693,4 @@ void EVP_cleanup(void) { } +LCRYPTO_ALIAS(EVP_cleanup); diff --git a/lib/libcrypto/evp/evp_pbe.c b/lib/libcrypto/evp/evp_pbe.c index 81fa0446e..88ceb1403 100644 --- a/lib/libcrypto/evp/evp_pbe.c +++ b/lib/libcrypto/evp/evp_pbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_pbe.c,v 1.49 2024/03/25 11:38:47 joshua Exp $ */ +/* $OpenBSD: evp_pbe.c,v 1.50 2024/04/09 13:52:41 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -398,6 +398,7 @@ PKCS5_PBKDF2_HMAC(const char *pass, int passlen, const unsigned char *salt, HMAC_CTX_cleanup(&hctx_tpl); return 1; } +LCRYPTO_ALIAS(PKCS5_PBKDF2_HMAC); int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, const unsigned char *salt, @@ -406,6 +407,7 @@ PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, const unsigned char *salt, return PKCS5_PBKDF2_HMAC(pass, passlen, salt, saltlen, iter, EVP_sha1(), keylen, out); } +LCRYPTO_ALIAS(PKCS5_PBKDF2_HMAC_SHA1); /* * Now the key derivation function itself. This is a bit evil because diff --git a/lib/libcrypto/evp/evp_pkey.c b/lib/libcrypto/evp/evp_pkey.c index 9e29a1ae6..591d066f4 100644 --- a/lib/libcrypto/evp/evp_pkey.c +++ b/lib/libcrypto/evp/evp_pkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: evp_pkey.c,v 1.27 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: evp_pkey.c,v 1.28 2024/04/09 13:55:02 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -105,6 +105,7 @@ error: EVP_PKEY_free(pkey); return NULL; } +LCRYPTO_ALIAS(EVP_PKCS82PKEY); /* Turn a private key into a PKCS8 structure */ @@ -138,6 +139,7 @@ error: PKCS8_PRIV_KEY_INFO_free(p8); return NULL; } +LCRYPTO_ALIAS(EVP_PKEY2PKCS8); /* EVP_PKEY attribute functions */ @@ -146,12 +148,14 @@ EVP_PKEY_get_attr_count(const EVP_PKEY *key) { return X509at_get_attr_count(key->attributes); } +LCRYPTO_ALIAS(EVP_PKEY_get_attr_count); int EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos) { return X509at_get_attr_by_NID(key->attributes, nid, lastpos); } +LCRYPTO_ALIAS(EVP_PKEY_get_attr_by_NID); int EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, @@ -159,18 +163,21 @@ EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, const ASN1_OBJECT *obj, { return X509at_get_attr_by_OBJ(key->attributes, obj, lastpos); } +LCRYPTO_ALIAS(EVP_PKEY_get_attr_by_OBJ); X509_ATTRIBUTE * EVP_PKEY_get_attr(const EVP_PKEY *key, int loc) { return X509at_get_attr(key->attributes, loc); } +LCRYPTO_ALIAS(EVP_PKEY_get_attr); X509_ATTRIBUTE * EVP_PKEY_delete_attr(EVP_PKEY *key, int loc) { return X509at_delete_attr(key->attributes, loc); } +LCRYPTO_ALIAS(EVP_PKEY_delete_attr); int EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr) @@ -179,6 +186,7 @@ EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr) return 1; return 0; } +LCRYPTO_ALIAS(EVP_PKEY_add1_attr); int EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, const ASN1_OBJECT *obj, int type, @@ -188,6 +196,7 @@ EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key, const ASN1_OBJECT *obj, int type, return 1; return 0; } +LCRYPTO_ALIAS(EVP_PKEY_add1_attr_by_OBJ); int EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, int nid, int type, @@ -197,6 +206,7 @@ EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key, int nid, int type, return 1; return 0; } +LCRYPTO_ALIAS(EVP_PKEY_add1_attr_by_NID); int EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, const char *attrname, int type, @@ -207,3 +217,4 @@ EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key, const char *attrname, int type, return 1; return 0; } +LCRYPTO_ALIAS(EVP_PKEY_add1_attr_by_txt); diff --git a/lib/libcrypto/evp/m_md4.c b/lib/libcrypto/evp/m_md4.c index 199dba848..a9d315094 100644 --- a/lib/libcrypto/evp/m_md4.c +++ b/lib/libcrypto/evp/m_md4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_md4.c,v 1.21 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_md4.c,v 1.22 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,4 +110,5 @@ EVP_md4(void) { return (&md4_md); } +LCRYPTO_ALIAS(EVP_md4); #endif diff --git a/lib/libcrypto/evp/m_md5.c b/lib/libcrypto/evp/m_md5.c index 0dfad89aa..1bba8c4e1 100644 --- a/lib/libcrypto/evp/m_md5.c +++ b/lib/libcrypto/evp/m_md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_md5.c,v 1.20 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_md5.c,v 1.21 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,4 +110,5 @@ EVP_md5(void) { return (&md5_md); } +LCRYPTO_ALIAS(EVP_md5); #endif diff --git a/lib/libcrypto/evp/m_md5_sha1.c b/lib/libcrypto/evp/m_md5_sha1.c index 7dd1ae127..87a801f01 100644 --- a/lib/libcrypto/evp/m_md5_sha1.c +++ b/lib/libcrypto/evp/m_md5_sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_md5_sha1.c,v 1.8 2023/09/02 04:55:18 tb Exp $ */ +/* $OpenBSD: m_md5_sha1.c,v 1.9 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2017 Joel Sing * @@ -87,3 +87,4 @@ EVP_md5_sha1(void) { return &md5_sha1_md; } +LCRYPTO_ALIAS(EVP_md5_sha1); diff --git a/lib/libcrypto/evp/m_null.c b/lib/libcrypto/evp/m_null.c index 28634d2da..65af387ea 100644 --- a/lib/libcrypto/evp/m_null.c +++ b/lib/libcrypto/evp/m_null.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_null.c,v 1.14 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_null.c,v 1.15 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -101,3 +101,4 @@ EVP_md_null(void) { return (&null_md); } +LCRYPTO_ALIAS(EVP_md_null); diff --git a/lib/libcrypto/evp/m_ripemd.c b/lib/libcrypto/evp/m_ripemd.c index 638d0cd27..d77151086 100644 --- a/lib/libcrypto/evp/m_ripemd.c +++ b/lib/libcrypto/evp/m_ripemd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_ripemd.c,v 1.17 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_ripemd.c,v 1.18 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,4 +110,5 @@ EVP_ripemd160(void) { return (&ripemd160_md); } +LCRYPTO_ALIAS(EVP_ripemd160); #endif diff --git a/lib/libcrypto/evp/m_sha1.c b/lib/libcrypto/evp/m_sha1.c index c65e0515c..cdceb99aa 100644 --- a/lib/libcrypto/evp/m_sha1.c +++ b/lib/libcrypto/evp/m_sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_sha1.c,v 1.25 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_sha1.c,v 1.26 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -110,6 +110,7 @@ EVP_sha1(void) { return &sha1_md; } +LCRYPTO_ALIAS(EVP_sha1); #endif #ifndef OPENSSL_NO_SHA256 @@ -155,6 +156,7 @@ EVP_sha224(void) { return &sha224_md; } +LCRYPTO_ALIAS(EVP_sha224); static int sha256_init(EVP_MD_CTX *ctx) @@ -193,6 +195,7 @@ EVP_sha256(void) { return &sha256_md; } +LCRYPTO_ALIAS(EVP_sha256); #endif /* ifndef OPENSSL_NO_SHA256 */ #ifndef OPENSSL_NO_SHA512 @@ -234,6 +237,7 @@ EVP_sha384(void) { return &sha384_md; } +LCRYPTO_ALIAS(EVP_sha384); static int sha512_init(EVP_MD_CTX *ctx) @@ -272,6 +276,7 @@ EVP_sha512(void) { return &sha512_md; } +LCRYPTO_ALIAS(EVP_sha512); static int sha512_224_init(EVP_MD_CTX *ctx) @@ -310,6 +315,7 @@ EVP_sha512_224(void) { return &sha512_224_md; } +LCRYPTO_ALIAS(EVP_sha512_224); static int sha512_256_init(EVP_MD_CTX *ctx) @@ -348,4 +354,5 @@ EVP_sha512_256(void) { return &sha512_256_md; } +LCRYPTO_ALIAS(EVP_sha512_256); #endif /* ifndef OPENSSL_NO_SHA512 */ diff --git a/lib/libcrypto/evp/m_sha3.c b/lib/libcrypto/evp/m_sha3.c index 67f94f795..a21833b60 100644 --- a/lib/libcrypto/evp/m_sha3.c +++ b/lib/libcrypto/evp/m_sha3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_sha3.c,v 1.3 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_sha3.c,v 1.4 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -57,6 +57,7 @@ EVP_sha3_224(void) { return &sha3_224_md; } +LCRYPTO_ALIAS(EVP_sha3_224); static int sha3_256_init(EVP_MD_CTX *ctx) @@ -95,6 +96,7 @@ EVP_sha3_256(void) { return &sha3_256_md; } +LCRYPTO_ALIAS(EVP_sha3_256); static int sha3_384_init(EVP_MD_CTX *ctx) @@ -133,6 +135,7 @@ EVP_sha3_384(void) { return &sha3_384_md; } +LCRYPTO_ALIAS(EVP_sha3_384); static int sha3_512_init(EVP_MD_CTX *ctx) @@ -171,3 +174,4 @@ EVP_sha3_512(void) { return &sha3_512_md; } +LCRYPTO_ALIAS(EVP_sha3_512); diff --git a/lib/libcrypto/evp/m_sigver.c b/lib/libcrypto/evp/m_sigver.c index d427e05db..a3353854f 100644 --- a/lib/libcrypto/evp/m_sigver.c +++ b/lib/libcrypto/evp/m_sigver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_sigver.c,v 1.26 2024/03/27 07:36:59 tb Exp $ */ +/* $OpenBSD: m_sigver.c,v 1.27 2024/04/09 13:52:41 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -128,6 +128,7 @@ EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, { return do_sigver_init(ctx, pctx, type, pkey, 0); } +LCRYPTO_ALIAS(EVP_DigestSignInit); int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, @@ -135,6 +136,7 @@ EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, { return do_sigver_init(ctx, pctx, type, pkey, 1); } +LCRYPTO_ALIAS(EVP_DigestVerifyInit); static int evp_digestsignfinal_sigctx_custom(EVP_MD_CTX *ctx, unsigned char *sigret, @@ -215,6 +217,7 @@ EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen) return ret; } +LCRYPTO_ALIAS(EVP_DigestSignFinal); int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen, @@ -231,6 +234,7 @@ EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen, return EVP_DigestSignFinal(ctx, sigret, siglen); } +LCRYPTO_ALIAS(EVP_DigestSign); int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen) @@ -249,6 +253,7 @@ EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen) return r; return EVP_PKEY_verify(ctx->pctx, sig, siglen, md, mdlen); } +LCRYPTO_ALIAS(EVP_DigestVerifyFinal); int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, size_t siglen, @@ -263,3 +268,4 @@ EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, size_t siglen, return EVP_DigestVerifyFinal(ctx, sigret, siglen); } +LCRYPTO_ALIAS(EVP_DigestVerify); diff --git a/lib/libcrypto/evp/m_sm3.c b/lib/libcrypto/evp/m_sm3.c index ea30d8d22..672d06f9f 100644 --- a/lib/libcrypto/evp/m_sm3.c +++ b/lib/libcrypto/evp/m_sm3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_sm3.c,v 1.6 2023/07/07 19:37:53 beck Exp $ */ +/* $OpenBSD: m_sm3.c,v 1.7 2024/04/09 13:52:41 beck Exp $ */ /* * Copyright (c) 2018, Ribose Inc * @@ -64,5 +64,6 @@ EVP_sm3(void) { return &sm3_md; } +LCRYPTO_ALIAS(EVP_sm3); #endif /* OPENSSL_NO_SM3 */ diff --git a/lib/libcrypto/evp/m_wp.c b/lib/libcrypto/evp/m_wp.c index 44d13b148..6755d56e4 100644 --- a/lib/libcrypto/evp/m_wp.c +++ b/lib/libcrypto/evp/m_wp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m_wp.c,v 1.13 2023/07/07 19:37:54 beck Exp $ */ +/* $OpenBSD: m_wp.c,v 1.14 2024/04/09 13:52:41 beck Exp $ */ #include @@ -50,4 +50,5 @@ EVP_whirlpool(void) { return (&whirlpool_md); } +LCRYPTO_ALIAS(EVP_whirlpool); #endif diff --git a/lib/libcrypto/evp/p_legacy.c b/lib/libcrypto/evp/p_legacy.c index adb6dc917..01cfdbcd6 100644 --- a/lib/libcrypto/evp/p_legacy.c +++ b/lib/libcrypto/evp/p_legacy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_legacy.c,v 1.5 2024/03/28 01:42:02 tb Exp $ */ +/* $OpenBSD: p_legacy.c,v 1.6 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -77,6 +77,7 @@ EVP_PKEY_decrypt_old(unsigned char *to, const unsigned char *from, int from_len, return RSA_private_decrypt(from_len, from, to, pkey->pkey.rsa, RSA_PKCS1_PADDING); } +LCRYPTO_ALIAS(EVP_PKEY_decrypt_old); int EVP_PKEY_encrypt_old(unsigned char *to, const unsigned char *from, int from_len, @@ -90,6 +91,7 @@ EVP_PKEY_encrypt_old(unsigned char *to, const unsigned char *from, int from_len, return RSA_public_encrypt(from_len, from, to, pkey->pkey.rsa, RSA_PKCS1_PADDING); } +LCRYPTO_ALIAS(EVP_PKEY_encrypt_old); int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, @@ -135,6 +137,7 @@ err: freezero(key, size); return (ret); } +LCRYPTO_ALIAS(EVP_OpenInit); int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -146,6 +149,7 @@ EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) i = EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL); return (i); } +LCRYPTO_ALIAS(EVP_OpenFinal); int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, @@ -181,6 +185,7 @@ EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, } return (npubk); } +LCRYPTO_ALIAS(EVP_SealInit); int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) @@ -192,3 +197,4 @@ EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) i = EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, NULL); return i; } +LCRYPTO_ALIAS(EVP_SealFinal); diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 8bf820560..4a6a6db4c 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.59 2024/03/02 11:17:27 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.60 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -170,6 +170,7 @@ EVP_PKEY_asn1_get_count(void) { return N_ASN1_METHODS; } +LCRYPTO_ALIAS(EVP_PKEY_asn1_get_count); const EVP_PKEY_ASN1_METHOD * EVP_PKEY_asn1_get0(int idx) @@ -179,6 +180,7 @@ EVP_PKEY_asn1_get0(int idx) return asn1_methods[idx]; } +LCRYPTO_ALIAS(EVP_PKEY_asn1_get0); const EVP_PKEY_ASN1_METHOD * EVP_PKEY_asn1_find(ENGINE **engine, int pkey_id) @@ -195,6 +197,7 @@ EVP_PKEY_asn1_find(ENGINE **engine, int pkey_id) return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_asn1_find); const EVP_PKEY_ASN1_METHOD * EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len) @@ -224,6 +227,7 @@ EVP_PKEY_asn1_find_str(ENGINE **engine, const char *str, int len) return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_asn1_find_str); int EVP_PKEY_asn1_get0_info(int *pkey_id, int *pkey_base_id, int *pkey_flags, @@ -246,12 +250,14 @@ EVP_PKEY_asn1_get0_info(int *pkey_id, int *pkey_base_id, int *pkey_flags, return 1; } +LCRYPTO_ALIAS(EVP_PKEY_asn1_get0_info); const EVP_PKEY_ASN1_METHOD* EVP_PKEY_get0_asn1(const EVP_PKEY *pkey) { return pkey->ameth; } +LCRYPTO_ALIAS(EVP_PKEY_get0_asn1); int EVP_PKEY_bits(const EVP_PKEY *pkey) @@ -260,6 +266,7 @@ EVP_PKEY_bits(const EVP_PKEY *pkey) return pkey->ameth->pkey_bits(pkey); return 0; } +LCRYPTO_ALIAS(EVP_PKEY_bits); int EVP_PKEY_security_bits(const EVP_PKEY *pkey) @@ -271,6 +278,7 @@ EVP_PKEY_security_bits(const EVP_PKEY *pkey) return pkey->ameth->pkey_security_bits(pkey); } +LCRYPTO_ALIAS(EVP_PKEY_security_bits); int EVP_PKEY_size(const EVP_PKEY *pkey) @@ -279,6 +287,7 @@ EVP_PKEY_size(const EVP_PKEY *pkey) return pkey->ameth->pkey_size(pkey); return 0; } +LCRYPTO_ALIAS(EVP_PKEY_size); int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) @@ -303,6 +312,7 @@ EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode) #endif return (0); } +LCRYPTO_ALIAS(EVP_PKEY_save_parameters); int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) @@ -322,6 +332,7 @@ EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) err: return 0; } +LCRYPTO_ALIAS(EVP_PKEY_copy_parameters); int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) @@ -330,6 +341,7 @@ EVP_PKEY_missing_parameters(const EVP_PKEY *pkey) return pkey->ameth->param_missing(pkey); return 0; } +LCRYPTO_ALIAS(EVP_PKEY_missing_parameters); int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) @@ -340,6 +352,7 @@ EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) return a->ameth->param_cmp(a, b); return -2; } +LCRYPTO_ALIAS(EVP_PKEY_cmp_parameters); int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) @@ -362,6 +375,7 @@ EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) return -2; } +LCRYPTO_ALIAS(EVP_PKEY_cmp); EVP_PKEY * EVP_PKEY_new(void) @@ -379,12 +393,14 @@ EVP_PKEY_new(void) return pkey; } +LCRYPTO_ALIAS(EVP_PKEY_new); int EVP_PKEY_up_ref(EVP_PKEY *pkey) { return CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY) > 1; } +LCRYPTO_ALIAS(EVP_PKEY_up_ref); static void evp_pkey_free_pkey_ptr(EVP_PKEY *pkey) @@ -409,6 +425,7 @@ EVP_PKEY_free(EVP_PKEY *pkey) sk_X509_ATTRIBUTE_pop_free(pkey->attributes, X509_ATTRIBUTE_free); freezero(pkey, sizeof(*pkey)); } +LCRYPTO_ALIAS(EVP_PKEY_free); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) @@ -428,6 +445,7 @@ EVP_PKEY_set_type(EVP_PKEY *pkey, int type) return 1; } +LCRYPTO_ALIAS(EVP_PKEY_set_type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) @@ -447,6 +465,7 @@ EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) return 1; } +LCRYPTO_ALIAS(EVP_PKEY_set_type_str); int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) @@ -456,6 +475,7 @@ EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) return (pkey->pkey.ptr = key) != NULL; } +LCRYPTO_ALIAS(EVP_PKEY_assign); EVP_PKEY * EVP_PKEY_new_raw_private_key(int type, ENGINE *engine, @@ -485,6 +505,7 @@ EVP_PKEY_new_raw_private_key(int type, ENGINE *engine, return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_new_raw_private_key); EVP_PKEY * EVP_PKEY_new_raw_public_key(int type, ENGINE *engine, @@ -514,6 +535,7 @@ EVP_PKEY_new_raw_public_key(int type, ENGINE *engine, return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_new_raw_public_key); int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, @@ -530,6 +552,7 @@ EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, return 1; } +LCRYPTO_ALIAS(EVP_PKEY_get_raw_private_key); int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, @@ -546,6 +569,7 @@ EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, return 1; } +LCRYPTO_ALIAS(EVP_PKEY_get_raw_public_key); EVP_PKEY * EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, size_t len, @@ -577,12 +601,14 @@ EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, size_t len, return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_new_CMAC_key); void * EVP_PKEY_get0(const EVP_PKEY *pkey) { return pkey->pkey.ptr; } +LCRYPTO_ALIAS(EVP_PKEY_get0); const unsigned char * EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len) @@ -599,6 +625,7 @@ EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len) return os->data; } +LCRYPTO_ALIAS(EVP_PKEY_get0_hmac); #ifndef OPENSSL_NO_RSA RSA * @@ -610,6 +637,7 @@ EVP_PKEY_get0_RSA(EVP_PKEY *pkey) EVPerror(EVP_R_EXPECTING_AN_RSA_KEY); return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_get0_RSA); RSA * EVP_PKEY_get1_RSA(EVP_PKEY *pkey) @@ -623,6 +651,7 @@ EVP_PKEY_get1_RSA(EVP_PKEY *pkey) return rsa; } +LCRYPTO_ALIAS(EVP_PKEY_get1_RSA); int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) @@ -632,6 +661,7 @@ EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key) RSA_up_ref(key); return ret; } +LCRYPTO_ALIAS(EVP_PKEY_set1_RSA); #endif #ifndef OPENSSL_NO_DSA @@ -644,6 +674,7 @@ EVP_PKEY_get0_DSA(EVP_PKEY *pkey) } return pkey->pkey.dsa; } +LCRYPTO_ALIAS(EVP_PKEY_get0_DSA); DSA * EVP_PKEY_get1_DSA(EVP_PKEY *pkey) @@ -657,6 +688,7 @@ EVP_PKEY_get1_DSA(EVP_PKEY *pkey) return dsa; } +LCRYPTO_ALIAS(EVP_PKEY_get1_DSA); int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) @@ -666,6 +698,7 @@ EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key) DSA_up_ref(key); return ret; } +LCRYPTO_ALIAS(EVP_PKEY_set1_DSA); #endif #ifndef OPENSSL_NO_EC @@ -678,6 +711,7 @@ EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) } return pkey->pkey.ec; } +LCRYPTO_ALIAS(EVP_PKEY_get0_EC_KEY); EC_KEY * EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) @@ -691,6 +725,7 @@ EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) return key; } +LCRYPTO_ALIAS(EVP_PKEY_get1_EC_KEY); int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) @@ -700,6 +735,7 @@ EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) EC_KEY_up_ref(key); return ret; } +LCRYPTO_ALIAS(EVP_PKEY_set1_EC_KEY); #endif @@ -713,6 +749,7 @@ EVP_PKEY_get0_DH(EVP_PKEY *pkey) } return pkey->pkey.dh; } +LCRYPTO_ALIAS(EVP_PKEY_get0_DH); DH * EVP_PKEY_get1_DH(EVP_PKEY *pkey) @@ -726,6 +763,7 @@ EVP_PKEY_get1_DH(EVP_PKEY *pkey) return dh; } +LCRYPTO_ALIAS(EVP_PKEY_get1_DH); int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) @@ -735,6 +773,7 @@ EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) DH_up_ref(key); return ret; } +LCRYPTO_ALIAS(EVP_PKEY_set1_DH); #endif int @@ -747,18 +786,21 @@ EVP_PKEY_type(int type) return NID_undef; } +LCRYPTO_ALIAS(EVP_PKEY_type); int EVP_PKEY_id(const EVP_PKEY *pkey) { return pkey->type; } +LCRYPTO_ALIAS(EVP_PKEY_id); int EVP_PKEY_base_id(const EVP_PKEY *pkey) { return EVP_PKEY_type(pkey->type); } +LCRYPTO_ALIAS(EVP_PKEY_base_id); static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent, const char *kstr) @@ -779,6 +821,7 @@ EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, int indent, return unsup_alg(out, pkey, indent, "Public Key"); } +LCRYPTO_ALIAS(EVP_PKEY_print_public); int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, @@ -789,6 +832,7 @@ EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, int indent, return unsup_alg(out, pkey, indent, "Private Key"); } +LCRYPTO_ALIAS(EVP_PKEY_print_private); int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, @@ -798,6 +842,7 @@ EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, int indent, return pkey->ameth->param_print(out, pkey, indent, pctx); return unsup_alg(out, pkey, indent, "Parameters"); } +LCRYPTO_ALIAS(EVP_PKEY_print_params); int EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid) @@ -807,3 +852,4 @@ EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid) return pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_DEFAULT_MD_NID, 0, pnid); } +LCRYPTO_ALIAS(EVP_PKEY_get_default_digest_nid); diff --git a/lib/libcrypto/evp/p_sign.c b/lib/libcrypto/evp/p_sign.c index 70290ed21..7f472ea71 100644 --- a/lib/libcrypto/evp/p_sign.c +++ b/lib/libcrypto/evp/p_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_sign.c,v 1.21 2024/03/26 06:08:51 joshua Exp $ */ +/* $OpenBSD: p_sign.c,v 1.22 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -104,3 +104,4 @@ EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY_CTX_free(pkctx); return ret; } +LCRYPTO_ALIAS(EVP_SignFinal); diff --git a/lib/libcrypto/evp/p_verify.c b/lib/libcrypto/evp/p_verify.c index 04b7c39c6..02132e2c3 100644 --- a/lib/libcrypto/evp/p_verify.c +++ b/lib/libcrypto/evp/p_verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_verify.c,v 1.20 2024/03/26 05:50:49 joshua Exp $ */ +/* $OpenBSD: p_verify.c,v 1.21 2024/04/09 13:52:41 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -96,3 +96,4 @@ EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, EVP_PKEY_CTX_free(pkctx); return ret; } +LCRYPTO_ALIAS(EVP_VerifyFinal); diff --git a/lib/libcrypto/evp/pmeth_fn.c b/lib/libcrypto/evp/pmeth_fn.c index a304752e6..f8ed555fd 100644 --- a/lib/libcrypto/evp/pmeth_fn.c +++ b/lib/libcrypto/evp/pmeth_fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmeth_fn.c,v 1.9 2023/07/07 19:37:54 beck Exp $ */ +/* $OpenBSD: pmeth_fn.c,v 1.10 2024/04/09 13:52:41 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -98,6 +98,7 @@ EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_sign_init); int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, @@ -114,6 +115,7 @@ EVP_PKEY_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, M_check_autoarg(ctx, sig, siglen, EVP_F_EVP_PKEY_SIGN) return ctx->pmeth->sign(ctx, sig, siglen, tbs, tbslen); } +LCRYPTO_ALIAS(EVP_PKEY_sign); int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) @@ -132,6 +134,7 @@ EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_verify_init); int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, @@ -147,6 +150,7 @@ EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, } return ctx->pmeth->verify(ctx, sig, siglen, tbs, tbslen); } +LCRYPTO_ALIAS(EVP_PKEY_verify); int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) @@ -165,6 +169,7 @@ EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_verify_recover_init); int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, unsigned char *rout, size_t *routlen, @@ -181,6 +186,7 @@ EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, unsigned char *rout, size_t *routlen, M_check_autoarg(ctx, rout, routlen, EVP_F_EVP_PKEY_VERIFY_RECOVER) return ctx->pmeth->verify_recover(ctx, rout, routlen, sig, siglen); } +LCRYPTO_ALIAS(EVP_PKEY_verify_recover); int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) @@ -199,6 +205,7 @@ EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_encrypt_init); int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, @@ -215,6 +222,7 @@ EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_ENCRYPT) return ctx->pmeth->encrypt(ctx, out, outlen, in, inlen); } +LCRYPTO_ALIAS(EVP_PKEY_encrypt); int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) @@ -233,6 +241,7 @@ EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_decrypt_init); int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, @@ -249,6 +258,7 @@ EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, M_check_autoarg(ctx, out, outlen, EVP_F_EVP_PKEY_DECRYPT) return ctx->pmeth->decrypt(ctx, out, outlen, in, inlen); } +LCRYPTO_ALIAS(EVP_PKEY_decrypt); int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx) @@ -267,6 +277,7 @@ EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_derive_init); int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer) @@ -328,6 +339,7 @@ EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer) CRYPTO_add(&peer->references, 1, CRYPTO_LOCK_EVP_PKEY); return 1; } +LCRYPTO_ALIAS(EVP_PKEY_derive_set_peer); int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen) @@ -343,3 +355,4 @@ EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen) M_check_autoarg(ctx, key, pkeylen, EVP_F_EVP_PKEY_DERIVE) return ctx->pmeth->derive(ctx, key, pkeylen); } +LCRYPTO_ALIAS(EVP_PKEY_derive); diff --git a/lib/libcrypto/evp/pmeth_gn.c b/lib/libcrypto/evp/pmeth_gn.c index ce7b107c7..2711ba1a9 100644 --- a/lib/libcrypto/evp/pmeth_gn.c +++ b/lib/libcrypto/evp/pmeth_gn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmeth_gn.c,v 1.15 2024/01/01 18:33:04 tb Exp $ */ +/* $OpenBSD: pmeth_gn.c,v 1.16 2024/04/09 13:52:41 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -85,6 +85,7 @@ EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_paramgen_init); int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) @@ -114,6 +115,7 @@ EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) } return ret; } +LCRYPTO_ALIAS(EVP_PKEY_paramgen); int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) @@ -132,6 +134,7 @@ EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) ctx->operation = EVP_PKEY_OP_UNDEFINED; return ret; } +LCRYPTO_ALIAS(EVP_PKEY_keygen_init); int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) @@ -160,18 +163,21 @@ EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) } return ret; } +LCRYPTO_ALIAS(EVP_PKEY_keygen); void EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb) { ctx->pkey_gencb = cb; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_set_cb); EVP_PKEY_gen_cb * EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx) { return ctx->pkey_gencb; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get_cb); /* "translation callback" to call EVP_PKEY_CTX callbacks using BN_GENCB * style callbacks. @@ -201,6 +207,7 @@ EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx) return 0; return ctx->keygen_info[idx]; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get_keygen_info); EVP_PKEY * EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key, int keylen) @@ -223,6 +230,7 @@ merr: EVP_PKEY_CTX_free(mac_ctx); return mac_key; } +LCRYPTO_ALIAS(EVP_PKEY_new_mac_key); int EVP_PKEY_check(EVP_PKEY_CTX *ctx) @@ -244,6 +252,7 @@ EVP_PKEY_check(EVP_PKEY_CTX *ctx) return pkey->ameth->pkey_check(pkey); } +LCRYPTO_ALIAS(EVP_PKEY_check); int EVP_PKEY_public_check(EVP_PKEY_CTX *ctx) @@ -265,6 +274,7 @@ EVP_PKEY_public_check(EVP_PKEY_CTX *ctx) return pkey->ameth->pkey_public_check(pkey); } +LCRYPTO_ALIAS(EVP_PKEY_public_check); int EVP_PKEY_param_check(EVP_PKEY_CTX *ctx) @@ -286,3 +296,4 @@ EVP_PKEY_param_check(EVP_PKEY_CTX *ctx) return pkey->ameth->pkey_param_check(pkey); } +LCRYPTO_ALIAS(EVP_PKEY_param_check); diff --git a/lib/libcrypto/evp/pmeth_lib.c b/lib/libcrypto/evp/pmeth_lib.c index a2a9ad9c7..a0a193da7 100644 --- a/lib/libcrypto/evp/pmeth_lib.c +++ b/lib/libcrypto/evp/pmeth_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmeth_lib.c,v 1.39 2024/03/02 11:17:27 tb Exp $ */ +/* $OpenBSD: pmeth_lib.c,v 1.40 2024/04/09 13:52:41 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -155,12 +155,14 @@ EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *engine) { return evp_pkey_ctx_new(pkey, -1); } +LCRYPTO_ALIAS(EVP_PKEY_CTX_new); EVP_PKEY_CTX * EVP_PKEY_CTX_new_id(int nid, ENGINE *engine) { return evp_pkey_ctx_new(NULL, nid); } +LCRYPTO_ALIAS(EVP_PKEY_CTX_new_id); EVP_PKEY_CTX * EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx) @@ -192,6 +194,7 @@ EVP_PKEY_CTX_dup(EVP_PKEY_CTX *pctx) EVP_PKEY_CTX_free(rctx); return NULL; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_dup); void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) @@ -204,6 +207,7 @@ EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) EVP_PKEY_free(ctx->peerkey); free(ctx); } +LCRYPTO_ALIAS(EVP_PKEY_CTX_free); int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, @@ -236,6 +240,7 @@ EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, return ret; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_ctrl); int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *name, const char *value) @@ -250,6 +255,7 @@ EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *name, const char *value) } return ctx->pmeth->ctrl_str(ctx, name, value); } +LCRYPTO_ALIAS(EVP_PKEY_CTX_ctrl_str); int EVP_PKEY_CTX_str2ctrl(EVP_PKEY_CTX *ctx, int cmd, const char *str) @@ -300,6 +306,7 @@ EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx) { return ctx->operation; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get_operation); void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen) @@ -307,39 +314,46 @@ EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen) ctx->keygen_info = dat; ctx->keygen_info_count = datlen; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_set0_keygen_info); void EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data) { ctx->data = data; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_set_data); void * EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx) { return ctx->data; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get_data); EVP_PKEY * EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx) { return ctx->pkey; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get0_pkey); EVP_PKEY * EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx) { return ctx->peerkey; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get0_peerkey); void EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data) { ctx->app_data = data; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_set_app_data); void * EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx) { return ctx->app_data; } +LCRYPTO_ALIAS(EVP_PKEY_CTX_get_app_data); diff --git a/lib/libcrypto/hidden/openssl/asn1.h b/lib/libcrypto/hidden/openssl/asn1.h index 12d9618f8..91595d1da 100644 --- a/lib/libcrypto/hidden/openssl/asn1.h +++ b/lib/libcrypto/hidden/openssl/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.12 2024/03/02 09:08:41 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.13 2024/04/10 14:55:12 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -231,5 +231,7 @@ LCRYPTO_USED(ASN1_item_print); LCRYPTO_USED(SMIME_crlf_copy); LCRYPTO_USED(SMIME_text); LCRYPTO_USED(ERR_load_ASN1_strings); +LCRYPTO_UNUSED(ASN1_UTCTIME_cmp_time_t); +LCRYPTO_UNUSED(ASN1_dup); #endif /* _LIBCRYPTO_ASN1_H */ diff --git a/lib/libcrypto/hidden/openssl/bn.h b/lib/libcrypto/hidden/openssl/bn.h index f6f00cf76..af3465c79 100644 --- a/lib/libcrypto/hidden/openssl/bn.h +++ b/lib/libcrypto/hidden/openssl/bn.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bn.h,v 1.6 2024/03/02 09:27:31 tb Exp $ */ +/* $OpenBSD: bn.h,v 1.7 2024/04/10 14:58:06 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -136,5 +136,10 @@ LCRYPTO_USED(BN_get_rfc3526_prime_4096); LCRYPTO_USED(BN_get_rfc3526_prime_6144); LCRYPTO_USED(BN_get_rfc3526_prime_8192); LCRYPTO_USED(ERR_load_BN_strings); +LCRYPTO_UNUSED(BN_div); +LCRYPTO_UNUSED(BN_mod_exp); +LCRYPTO_UNUSED(BN_mod_exp_mont); +LCRYPTO_UNUSED(BN_gcd); +LCRYPTO_UNUSED(BN_mod_inverse); #endif /* _LIBCRYPTO_BN_H */ diff --git a/lib/libcrypto/hidden/openssl/conf.h b/lib/libcrypto/hidden/openssl/conf.h new file mode 100644 index 000000000..9408a543e --- /dev/null +++ b/lib/libcrypto/hidden/openssl/conf.h @@ -0,0 +1,74 @@ +/* $OpenBSD: conf.h,v 1.1 2024/04/09 14:57:28 tb Exp $ */ +/* + * Copyright (c) 2024 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_CONF_H +#define _LIBCRYPTO_CONF_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/conf.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(CONF_set_default_method); +LCRYPTO_USED(CONF_set_nconf); +LCRYPTO_USED(CONF_load); +LCRYPTO_USED(CONF_load_fp); +LCRYPTO_USED(CONF_load_bio); +LCRYPTO_USED(CONF_get_section); +LCRYPTO_USED(CONF_get_string); +LCRYPTO_USED(CONF_get_number); +LCRYPTO_USED(CONF_free); +LCRYPTO_USED(CONF_dump_fp); +LCRYPTO_USED(CONF_dump_bio); +LCRYPTO_USED(OPENSSL_config); +LCRYPTO_USED(OPENSSL_no_config); +LCRYPTO_USED(NCONF_new); +LCRYPTO_USED(NCONF_default); +LCRYPTO_USED(NCONF_WIN32); +LCRYPTO_USED(NCONF_free); +LCRYPTO_USED(NCONF_free_data); +LCRYPTO_USED(NCONF_load); +LCRYPTO_USED(NCONF_load_fp); +LCRYPTO_USED(NCONF_load_bio); +LCRYPTO_USED(NCONF_get_section); +LCRYPTO_USED(NCONF_get_string); +LCRYPTO_USED(NCONF_get_number_e); +LCRYPTO_USED(NCONF_dump_fp); +LCRYPTO_USED(NCONF_dump_bio); +LCRYPTO_USED(CONF_modules_load); +LCRYPTO_USED(CONF_modules_load_file); +LCRYPTO_USED(CONF_modules_unload); +LCRYPTO_USED(CONF_modules_finish); +LCRYPTO_USED(CONF_modules_free); +LCRYPTO_USED(CONF_module_add); +LCRYPTO_USED(CONF_imodule_get_name); +LCRYPTO_USED(CONF_imodule_get_value); +LCRYPTO_USED(CONF_imodule_get_usr_data); +LCRYPTO_USED(CONF_imodule_set_usr_data); +LCRYPTO_USED(CONF_imodule_get_module); +LCRYPTO_USED(CONF_imodule_get_flags); +LCRYPTO_USED(CONF_imodule_set_flags); +LCRYPTO_USED(CONF_module_get_usr_data); +LCRYPTO_USED(CONF_module_set_usr_data); +LCRYPTO_USED(CONF_get1_default_config_file); +LCRYPTO_USED(CONF_parse_list); +LCRYPTO_USED(OPENSSL_load_builtin_modules); +LCRYPTO_USED(ERR_load_CONF_strings); + +#endif /* _LIBCRYPTO_CONF_H */ diff --git a/lib/libcrypto/hidden/openssl/crypto.h b/lib/libcrypto/hidden/openssl/crypto.h index 10daf41f5..fb1b215b9 100644 --- a/lib/libcrypto/hidden/openssl/crypto.h +++ b/lib/libcrypto/hidden/openssl/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.6 2024/03/02 11:37:13 tb Exp $ */ +/* $OpenBSD: crypto.h,v 1.7 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -46,5 +46,36 @@ LCRYPTO_USED(OPENSSL_init_crypto); LCRYPTO_USED(OPENSSL_cleanup); LCRYPTO_USED(OPENSSL_gmtime); LCRYPTO_USED(ERR_load_CRYPTO_strings); +LCRYPTO_UNUSED(CRYPTO_mem_ctrl); +LCRYPTO_UNUSED(CRYPTO_set_id_callback); +LCRYPTO_UNUSED(CRYPTO_get_id_callback); +LCRYPTO_UNUSED(CRYPTO_thread_id); +LCRYPTO_UNUSED(CRYPTO_get_new_lockid); +LCRYPTO_UNUSED(CRYPTO_get_lock_name); +LCRYPTO_UNUSED(CRYPTO_num_locks); +LCRYPTO_UNUSED(CRYPTO_set_locking_callback); +LCRYPTO_UNUSED(CRYPTO_get_locking_callback); +LCRYPTO_UNUSED(CRYPTO_set_add_lock_callback); +LCRYPTO_UNUSED(CRYPTO_get_add_lock_callback); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_numeric); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_pointer); +LCRYPTO_UNUSED(CRYPTO_THREADID_set_callback); +LCRYPTO_UNUSED(CRYPTO_THREADID_get_callback); +LCRYPTO_UNUSED(CRYPTO_get_new_dynlockid); +LCRYPTO_UNUSED(CRYPTO_destroy_dynlockid); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_value); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_create_callback); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_lock_callback); +LCRYPTO_UNUSED(CRYPTO_set_dynlock_destroy_callback); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_lock_callback); +LCRYPTO_UNUSED(CRYPTO_get_dynlock_destroy_callback); +LCRYPTO_UNUSED(CRYPTO_malloc); +LCRYPTO_UNUSED(CRYPTO_strdup); +LCRYPTO_UNUSED(CRYPTO_free); +LCRYPTO_UNUSED(OPENSSL_cleanse); +LCRYPTO_UNUSED(FIPS_mode); +LCRYPTO_UNUSED(FIPS_mode_set); +LCRYPTO_UNUSED(OPENSSL_init); +LCRYPTO_UNUSED(CRYPTO_memcmp); #endif /* _LIBCRYPTO_CRYPTO_H */ diff --git a/lib/libcrypto/hidden/openssl/ec.h b/lib/libcrypto/hidden/openssl/ec.h index 4e82f4846..cb6975551 100644 --- a/lib/libcrypto/hidden/openssl/ec.h +++ b/lib/libcrypto/hidden/openssl/ec.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ec.h,v 1.4 2023/07/28 09:25:12 tb Exp $ */ +/* $OpenBSD: ec.h,v 1.5 2024/04/10 15:01:31 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -161,5 +161,14 @@ LCRYPTO_USED(EC_KEY_METHOD_get_sign); LCRYPTO_USED(EC_KEY_METHOD_get_verify); LCRYPTO_USED(ECParameters_dup); LCRYPTO_USED(ERR_load_EC_strings); +LCRYPTO_UNUSED(EC_GROUP_clear_free); +LCRYPTO_UNUSED(EC_GROUP_set_curve_GFp); +LCRYPTO_UNUSED(EC_GROUP_get_curve_GFp); +LCRYPTO_UNUSED(EC_POINT_clear_free); +LCRYPTO_UNUSED(EC_POINT_set_Jprojective_coordinates_GFp); +LCRYPTO_UNUSED(EC_POINT_get_Jprojective_coordinates_GFp); +LCRYPTO_UNUSED(EC_POINT_set_affine_coordinates_GFp); +LCRYPTO_UNUSED(EC_POINT_get_affine_coordinates_GFp); +LCRYPTO_UNUSED(EC_POINT_set_compressed_coordinates_GFp); #endif /* _LIBCRYPTO_EC_H */ diff --git a/lib/libcrypto/hidden/openssl/evp.h b/lib/libcrypto/hidden/openssl/evp.h new file mode 100644 index 000000000..7721a2f41 --- /dev/null +++ b/lib/libcrypto/hidden/openssl/evp.h @@ -0,0 +1,383 @@ +/* $OpenBSD: evp.h,v 1.4 2024/04/10 15:00:38 beck Exp $ */ +/* + * Copyright (c) 2024 Bob Beck + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _LIBCRYPTO_EVP_H +#define _LIBCRYPTO_EVP_H + +#ifndef _MSC_VER +#include_next +#else +#include "../include/openssl/evp.h" +#endif +#include "crypto_namespace.h" + +LCRYPTO_USED(EVP_MD_type); +LCRYPTO_USED(EVP_MD_pkey_type); +LCRYPTO_USED(EVP_MD_size); +LCRYPTO_USED(EVP_MD_block_size); +LCRYPTO_USED(EVP_MD_flags); +LCRYPTO_USED(EVP_MD_CTX_md); +LCRYPTO_USED(EVP_MD_CTX_md_data); +LCRYPTO_USED(EVP_MD_CTX_pkey_ctx); +LCRYPTO_USED(EVP_MD_CTX_set_pkey_ctx); +LCRYPTO_USED(EVP_CIPHER_nid); +LCRYPTO_USED(EVP_CIPHER_block_size); +LCRYPTO_USED(EVP_CIPHER_key_length); +LCRYPTO_USED(EVP_CIPHER_iv_length); +LCRYPTO_USED(EVP_CIPHER_flags); +LCRYPTO_USED(EVP_CIPHER_CTX_cipher); +LCRYPTO_USED(EVP_CIPHER_CTX_encrypting); +LCRYPTO_USED(EVP_CIPHER_CTX_nid); +LCRYPTO_USED(EVP_CIPHER_CTX_block_size); +LCRYPTO_USED(EVP_CIPHER_CTX_key_length); +LCRYPTO_USED(EVP_CIPHER_CTX_iv_length); +LCRYPTO_USED(EVP_CIPHER_CTX_get_iv); +LCRYPTO_USED(EVP_CIPHER_CTX_set_iv); +LCRYPTO_USED(EVP_CIPHER_CTX_copy); +LCRYPTO_USED(EVP_CIPHER_CTX_get_app_data); +LCRYPTO_USED(EVP_CIPHER_CTX_set_app_data); +LCRYPTO_USED(EVP_CIPHER_CTX_get_cipher_data); +LCRYPTO_USED(EVP_CIPHER_CTX_set_cipher_data); +LCRYPTO_USED(EVP_CIPHER_CTX_buf_noconst); +LCRYPTO_USED(EVP_CIPHER_CTX_flags); +LCRYPTO_USED(EVP_CIPHER_meth_new); +LCRYPTO_USED(EVP_CIPHER_meth_dup); +LCRYPTO_USED(EVP_CIPHER_meth_free); +LCRYPTO_USED(EVP_CIPHER_meth_set_iv_length); +LCRYPTO_USED(EVP_CIPHER_meth_set_flags); +LCRYPTO_USED(EVP_CIPHER_meth_set_impl_ctx_size); +LCRYPTO_USED(EVP_CIPHER_meth_set_init); +LCRYPTO_USED(EVP_CIPHER_meth_set_do_cipher); +LCRYPTO_USED(EVP_CIPHER_meth_set_cleanup); +LCRYPTO_USED(EVP_CIPHER_meth_set_set_asn1_params); +LCRYPTO_USED(EVP_CIPHER_meth_set_get_asn1_params); +LCRYPTO_USED(EVP_CIPHER_meth_set_ctrl); +LCRYPTO_USED(EVP_PKEY_new_raw_private_key); +LCRYPTO_USED(EVP_PKEY_new_raw_public_key); +LCRYPTO_USED(EVP_PKEY_get_raw_private_key); +LCRYPTO_USED(EVP_PKEY_get_raw_public_key); +LCRYPTO_USED(EVP_Cipher); +LCRYPTO_USED(EVP_MD_CTX_new); +LCRYPTO_USED(EVP_MD_CTX_free); +LCRYPTO_USED(EVP_MD_CTX_reset); +LCRYPTO_USED(EVP_MD_CTX_create); +LCRYPTO_USED(EVP_MD_CTX_destroy); +LCRYPTO_USED(EVP_MD_CTX_cleanup); +LCRYPTO_USED(EVP_MD_CTX_copy_ex); +LCRYPTO_USED(EVP_MD_CTX_set_flags); +LCRYPTO_USED(EVP_MD_CTX_clear_flags); +LCRYPTO_USED(EVP_MD_CTX_ctrl); +LCRYPTO_USED(EVP_MD_CTX_test_flags); +LCRYPTO_USED(EVP_DigestInit_ex); +LCRYPTO_USED(EVP_DigestUpdate); +LCRYPTO_USED(EVP_DigestFinal_ex); +LCRYPTO_USED(EVP_Digest); +LCRYPTO_USED(EVP_MD_CTX_copy); +LCRYPTO_USED(EVP_DigestInit); +LCRYPTO_USED(EVP_DigestFinal); +LCRYPTO_USED(EVP_read_pw_string); +LCRYPTO_USED(EVP_read_pw_string_min); +LCRYPTO_USED(EVP_set_pw_prompt); +LCRYPTO_USED(EVP_get_pw_prompt); +LCRYPTO_USED(EVP_BytesToKey); +LCRYPTO_USED(EVP_CIPHER_CTX_set_flags); +LCRYPTO_USED(EVP_CIPHER_CTX_clear_flags); +LCRYPTO_USED(EVP_CIPHER_CTX_test_flags); +LCRYPTO_USED(EVP_EncryptInit); +LCRYPTO_USED(EVP_EncryptInit_ex); +LCRYPTO_USED(EVP_EncryptUpdate); +LCRYPTO_USED(EVP_EncryptFinal_ex); +LCRYPTO_USED(EVP_DecryptInit); +LCRYPTO_USED(EVP_DecryptInit_ex); +LCRYPTO_USED(EVP_DecryptUpdate); +LCRYPTO_USED(EVP_DecryptFinal_ex); +LCRYPTO_USED(EVP_CipherInit); +LCRYPTO_USED(EVP_CipherInit_ex); +LCRYPTO_USED(EVP_CipherUpdate); +LCRYPTO_USED(EVP_CipherFinal_ex); +LCRYPTO_USED(EVP_SignFinal); +LCRYPTO_USED(EVP_VerifyFinal); +LCRYPTO_USED(EVP_DigestSignInit); +LCRYPTO_USED(EVP_DigestSignFinal); +LCRYPTO_USED(EVP_DigestSign); +LCRYPTO_USED(EVP_DigestVerifyInit); +LCRYPTO_USED(EVP_DigestVerifyFinal); +LCRYPTO_USED(EVP_DigestVerify); +LCRYPTO_USED(EVP_OpenInit); +LCRYPTO_USED(EVP_OpenFinal); +LCRYPTO_USED(EVP_SealInit); +LCRYPTO_USED(EVP_SealFinal); +LCRYPTO_USED(EVP_ENCODE_CTX_new); +LCRYPTO_USED(EVP_ENCODE_CTX_free); +LCRYPTO_USED(EVP_EncodeInit); +LCRYPTO_USED(EVP_EncodeUpdate); +LCRYPTO_USED(EVP_EncodeFinal); +LCRYPTO_USED(EVP_EncodeBlock); +LCRYPTO_USED(EVP_DecodeInit); +LCRYPTO_USED(EVP_DecodeUpdate); +LCRYPTO_USED(EVP_DecodeFinal); +LCRYPTO_USED(EVP_DecodeBlock); +LCRYPTO_USED(EVP_CIPHER_CTX_cleanup); +LCRYPTO_USED(EVP_CIPHER_CTX_new); +LCRYPTO_USED(EVP_CIPHER_CTX_free); +LCRYPTO_USED(EVP_CIPHER_CTX_reset); +LCRYPTO_USED(EVP_CIPHER_CTX_set_key_length); +LCRYPTO_USED(EVP_CIPHER_CTX_set_padding); +LCRYPTO_USED(EVP_CIPHER_CTX_ctrl); +LCRYPTO_USED(EVP_CIPHER_CTX_rand_key); +LCRYPTO_USED(BIO_f_md); +LCRYPTO_USED(BIO_f_base64); +LCRYPTO_USED(BIO_f_cipher); +LCRYPTO_USED(BIO_set_cipher); +LCRYPTO_USED(EVP_md_null); +LCRYPTO_USED(EVP_md4); +LCRYPTO_USED(EVP_md5); +LCRYPTO_USED(EVP_md5_sha1); +LCRYPTO_USED(EVP_sha1); +LCRYPTO_USED(EVP_sha224); +LCRYPTO_USED(EVP_sha256); +LCRYPTO_USED(EVP_sha384); +LCRYPTO_USED(EVP_sha512); +LCRYPTO_USED(EVP_sha512_224); +LCRYPTO_USED(EVP_sha512_256); +LCRYPTO_USED(EVP_sha3_224); +LCRYPTO_USED(EVP_sha3_256); +LCRYPTO_USED(EVP_sha3_384); +LCRYPTO_USED(EVP_sha3_512); +LCRYPTO_USED(EVP_sm3); +LCRYPTO_USED(EVP_ripemd160); +LCRYPTO_USED(EVP_whirlpool); +LCRYPTO_USED(EVP_enc_null); +LCRYPTO_USED(EVP_des_ecb); +LCRYPTO_USED(EVP_des_ede); +LCRYPTO_USED(EVP_des_ede3); +LCRYPTO_USED(EVP_des_ede_ecb); +LCRYPTO_USED(EVP_des_ede3_ecb); +LCRYPTO_USED(EVP_des_cfb64); +LCRYPTO_USED(EVP_des_cfb1); +LCRYPTO_USED(EVP_des_cfb8); +LCRYPTO_USED(EVP_des_ede_cfb64); +LCRYPTO_USED(EVP_des_ede3_cfb64); +LCRYPTO_USED(EVP_des_ede3_cfb1); +LCRYPTO_USED(EVP_des_ede3_cfb8); +LCRYPTO_USED(EVP_des_ofb); +LCRYPTO_USED(EVP_des_ede_ofb); +LCRYPTO_USED(EVP_des_ede3_ofb); +LCRYPTO_USED(EVP_des_cbc); +LCRYPTO_USED(EVP_des_ede_cbc); +LCRYPTO_USED(EVP_des_ede3_cbc); +LCRYPTO_USED(EVP_desx_cbc); +LCRYPTO_USED(EVP_rc4); +LCRYPTO_USED(EVP_rc4_40); +LCRYPTO_USED(EVP_idea_ecb); +LCRYPTO_USED(EVP_idea_cfb64); +LCRYPTO_USED(EVP_idea_ofb); +LCRYPTO_USED(EVP_idea_cbc); +LCRYPTO_USED(EVP_rc2_ecb); +LCRYPTO_USED(EVP_rc2_cbc); +LCRYPTO_USED(EVP_rc2_40_cbc); +LCRYPTO_USED(EVP_rc2_64_cbc); +LCRYPTO_USED(EVP_rc2_cfb64); +LCRYPTO_USED(EVP_rc2_ofb); +LCRYPTO_USED(EVP_bf_ecb); +LCRYPTO_USED(EVP_bf_cbc); +LCRYPTO_USED(EVP_bf_cfb64); +LCRYPTO_USED(EVP_bf_ofb); +LCRYPTO_USED(EVP_cast5_ecb); +LCRYPTO_USED(EVP_cast5_cbc); +LCRYPTO_USED(EVP_cast5_cfb64); +LCRYPTO_USED(EVP_cast5_ofb); +LCRYPTO_USED(EVP_aes_128_ecb); +LCRYPTO_USED(EVP_aes_128_cbc); +LCRYPTO_USED(EVP_aes_128_cfb1); +LCRYPTO_USED(EVP_aes_128_cfb8); +LCRYPTO_USED(EVP_aes_128_cfb128); +LCRYPTO_USED(EVP_aes_128_ofb); +LCRYPTO_USED(EVP_aes_128_ctr); +LCRYPTO_USED(EVP_aes_128_ccm); +LCRYPTO_USED(EVP_aes_128_gcm); +LCRYPTO_USED(EVP_aes_128_wrap); +LCRYPTO_USED(EVP_aes_128_xts); +LCRYPTO_USED(EVP_aes_192_ecb); +LCRYPTO_USED(EVP_aes_192_cbc); +LCRYPTO_USED(EVP_aes_192_cfb1); +LCRYPTO_USED(EVP_aes_192_cfb8); +LCRYPTO_USED(EVP_aes_192_cfb128); +LCRYPTO_USED(EVP_aes_192_ofb); +LCRYPTO_USED(EVP_aes_192_ctr); +LCRYPTO_USED(EVP_aes_192_ccm); +LCRYPTO_USED(EVP_aes_192_gcm); +LCRYPTO_USED(EVP_aes_192_wrap); +LCRYPTO_USED(EVP_aes_256_ecb); +LCRYPTO_USED(EVP_aes_256_cbc); +LCRYPTO_USED(EVP_aes_256_cfb1); +LCRYPTO_USED(EVP_aes_256_cfb8); +LCRYPTO_USED(EVP_aes_256_cfb128); +LCRYPTO_USED(EVP_aes_256_ofb); +LCRYPTO_USED(EVP_aes_256_ctr); +LCRYPTO_USED(EVP_aes_256_ccm); +LCRYPTO_USED(EVP_aes_256_gcm); +LCRYPTO_USED(EVP_aes_256_wrap); +LCRYPTO_USED(EVP_aes_256_xts); +LCRYPTO_USED(EVP_chacha20_poly1305); +LCRYPTO_USED(EVP_camellia_128_ecb); +LCRYPTO_USED(EVP_camellia_128_cbc); +LCRYPTO_USED(EVP_camellia_128_cfb1); +LCRYPTO_USED(EVP_camellia_128_cfb8); +LCRYPTO_USED(EVP_camellia_128_cfb128); +LCRYPTO_USED(EVP_camellia_128_ofb); +LCRYPTO_USED(EVP_camellia_192_ecb); +LCRYPTO_USED(EVP_camellia_192_cbc); +LCRYPTO_USED(EVP_camellia_192_cfb1); +LCRYPTO_USED(EVP_camellia_192_cfb8); +LCRYPTO_USED(EVP_camellia_192_cfb128); +LCRYPTO_USED(EVP_camellia_192_ofb); +LCRYPTO_USED(EVP_camellia_256_ecb); +LCRYPTO_USED(EVP_camellia_256_cbc); +LCRYPTO_USED(EVP_camellia_256_cfb1); +LCRYPTO_USED(EVP_camellia_256_cfb8); +LCRYPTO_USED(EVP_camellia_256_cfb128); +LCRYPTO_USED(EVP_camellia_256_ofb); +LCRYPTO_USED(EVP_chacha20); +LCRYPTO_USED(EVP_sm4_ecb); +LCRYPTO_USED(EVP_sm4_cbc); +LCRYPTO_USED(EVP_sm4_cfb128); +LCRYPTO_USED(EVP_sm4_ofb); +LCRYPTO_USED(EVP_sm4_ctr); +LCRYPTO_USED(OPENSSL_add_all_algorithms_noconf); +LCRYPTO_USED(OPENSSL_add_all_algorithms_conf); +LCRYPTO_USED(OpenSSL_add_all_ciphers); +LCRYPTO_USED(OpenSSL_add_all_digests); +LCRYPTO_USED(EVP_get_cipherbyname); +LCRYPTO_USED(EVP_get_digestbyname); +LCRYPTO_USED(EVP_cleanup); +LCRYPTO_USED(EVP_CIPHER_do_all); +LCRYPTO_USED(EVP_CIPHER_do_all_sorted); +LCRYPTO_USED(EVP_MD_do_all); +LCRYPTO_USED(EVP_MD_do_all_sorted); +LCRYPTO_USED(EVP_PKEY_decrypt_old); +LCRYPTO_USED(EVP_PKEY_encrypt_old); +LCRYPTO_USED(EVP_PKEY_type); +LCRYPTO_USED(EVP_PKEY_id); +LCRYPTO_USED(EVP_PKEY_base_id); +LCRYPTO_USED(EVP_PKEY_bits); +LCRYPTO_USED(EVP_PKEY_security_bits); +LCRYPTO_USED(EVP_PKEY_size); +LCRYPTO_USED(EVP_PKEY_set_type); +LCRYPTO_USED(EVP_PKEY_set_type_str); +LCRYPTO_USED(EVP_PKEY_assign); +LCRYPTO_USED(EVP_PKEY_get0); +LCRYPTO_USED(EVP_PKEY_get0_hmac); +LCRYPTO_USED(EVP_PKEY_get0_RSA); +LCRYPTO_USED(EVP_PKEY_get1_RSA); +LCRYPTO_USED(EVP_PKEY_set1_RSA); +LCRYPTO_USED(EVP_PKEY_get0_DSA); +LCRYPTO_USED(EVP_PKEY_get1_DSA); +LCRYPTO_USED(EVP_PKEY_set1_DSA); +LCRYPTO_USED(EVP_PKEY_get0_DH); +LCRYPTO_USED(EVP_PKEY_get1_DH); +LCRYPTO_USED(EVP_PKEY_set1_DH); +LCRYPTO_USED(EVP_PKEY_get0_EC_KEY); +LCRYPTO_USED(EVP_PKEY_get1_EC_KEY); +LCRYPTO_USED(EVP_PKEY_set1_EC_KEY); +LCRYPTO_USED(EVP_PKEY_new); +LCRYPTO_USED(EVP_PKEY_free); +LCRYPTO_USED(EVP_PKEY_up_ref); +LCRYPTO_USED(d2i_PublicKey); +LCRYPTO_USED(i2d_PublicKey); +LCRYPTO_USED(d2i_PrivateKey); +LCRYPTO_USED(d2i_AutoPrivateKey); +LCRYPTO_USED(i2d_PrivateKey); +LCRYPTO_USED(EVP_PKEY_copy_parameters); +LCRYPTO_USED(EVP_PKEY_missing_parameters); +LCRYPTO_USED(EVP_PKEY_save_parameters); +LCRYPTO_USED(EVP_PKEY_cmp_parameters); +LCRYPTO_USED(EVP_PKEY_cmp); +LCRYPTO_USED(EVP_PKEY_print_public); +LCRYPTO_USED(EVP_PKEY_print_private); +LCRYPTO_USED(EVP_PKEY_print_params); +LCRYPTO_USED(EVP_PKEY_get_default_digest_nid); +LCRYPTO_USED(EVP_CIPHER_type); +LCRYPTO_USED(PKCS5_PBKDF2_HMAC_SHA1); +LCRYPTO_USED(PKCS5_PBKDF2_HMAC); +LCRYPTO_USED(EVP_PKEY_asn1_get_count); +LCRYPTO_USED(EVP_PKEY_asn1_get0); +LCRYPTO_USED(EVP_PKEY_asn1_find); +LCRYPTO_USED(EVP_PKEY_asn1_find_str); +LCRYPTO_USED(EVP_PKEY_asn1_get0_info); +LCRYPTO_USED(EVP_PKEY_get0_asn1); +LCRYPTO_USED(EVP_PKEY_CTX_new); +LCRYPTO_USED(EVP_PKEY_CTX_new_id); +LCRYPTO_USED(EVP_PKEY_CTX_dup); +LCRYPTO_USED(EVP_PKEY_CTX_free); +LCRYPTO_USED(EVP_PKEY_CTX_ctrl); +LCRYPTO_USED(EVP_PKEY_CTX_ctrl_str); +LCRYPTO_USED(EVP_PKEY_CTX_get_operation); +LCRYPTO_USED(EVP_PKEY_CTX_set0_keygen_info); +LCRYPTO_USED(EVP_PKEY_new_mac_key); +LCRYPTO_USED(EVP_PKEY_new_CMAC_key); +LCRYPTO_USED(EVP_PKEY_CTX_set_data); +LCRYPTO_USED(EVP_PKEY_CTX_get_data); +LCRYPTO_USED(EVP_PKEY_CTX_get0_pkey); +LCRYPTO_USED(EVP_PKEY_CTX_get0_peerkey); +LCRYPTO_USED(EVP_PKEY_CTX_set_app_data); +LCRYPTO_USED(EVP_PKEY_CTX_get_app_data); +LCRYPTO_USED(EVP_PKEY_sign_init); +LCRYPTO_USED(EVP_PKEY_sign); +LCRYPTO_USED(EVP_PKEY_verify_init); +LCRYPTO_USED(EVP_PKEY_verify); +LCRYPTO_USED(EVP_PKEY_verify_recover_init); +LCRYPTO_USED(EVP_PKEY_verify_recover); +LCRYPTO_USED(EVP_PKEY_encrypt_init); +LCRYPTO_USED(EVP_PKEY_encrypt); +LCRYPTO_USED(EVP_PKEY_decrypt_init); +LCRYPTO_USED(EVP_PKEY_decrypt); +LCRYPTO_USED(EVP_PKEY_derive_init); +LCRYPTO_USED(EVP_PKEY_derive_set_peer); +LCRYPTO_USED(EVP_PKEY_derive); +LCRYPTO_USED(EVP_PKEY_paramgen_init); +LCRYPTO_USED(EVP_PKEY_paramgen); +LCRYPTO_USED(EVP_PKEY_keygen_init); +LCRYPTO_USED(EVP_PKEY_keygen); +LCRYPTO_USED(EVP_PKEY_check); +LCRYPTO_USED(EVP_PKEY_public_check); +LCRYPTO_USED(EVP_PKEY_param_check); +LCRYPTO_USED(EVP_PKEY_CTX_set_cb); +LCRYPTO_USED(EVP_PKEY_CTX_get_cb); +LCRYPTO_USED(EVP_PKEY_CTX_get_keygen_info); +LCRYPTO_USED(EVP_aead_aes_128_gcm); +LCRYPTO_USED(EVP_aead_aes_256_gcm); +LCRYPTO_USED(EVP_aead_chacha20_poly1305); +LCRYPTO_USED(EVP_aead_xchacha20_poly1305); +LCRYPTO_USED(EVP_AEAD_key_length); +LCRYPTO_USED(EVP_AEAD_nonce_length); +LCRYPTO_USED(EVP_AEAD_max_overhead); +LCRYPTO_USED(EVP_AEAD_max_tag_len); +LCRYPTO_USED(EVP_AEAD_CTX_new); +LCRYPTO_USED(EVP_AEAD_CTX_free); +LCRYPTO_USED(EVP_AEAD_CTX_init); +LCRYPTO_USED(EVP_AEAD_CTX_cleanup); +LCRYPTO_USED(EVP_AEAD_CTX_seal); +LCRYPTO_USED(EVP_AEAD_CTX_open); +LCRYPTO_USED(ERR_load_EVP_strings); +LCRYPTO_UNUSED(EVP_MD_CTX_init); +LCRYPTO_UNUSED(EVP_EncryptFinal); +LCRYPTO_UNUSED(EVP_DecryptFinal); +LCRYPTO_UNUSED(EVP_CipherFinal); +LCRYPTO_UNUSED(EVP_CIPHER_CTX_init); + +#endif /* _LIBCRYPTO_EVP_H */ diff --git a/lib/libcrypto/hidden/openssl/rand.h b/lib/libcrypto/hidden/openssl/rand.h index 978d10f70..d06442acd 100644 --- a/lib/libcrypto/hidden/openssl/rand.h +++ b/lib/libcrypto/hidden/openssl/rand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rand.h,v 1.3 2023/07/28 09:53:55 tb Exp $ */ +/* $OpenBSD: rand.h,v 1.4 2024/04/10 14:53:01 beck Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -29,5 +29,15 @@ LCRYPTO_USED(RAND_set_rand_method); LCRYPTO_USED(RAND_get_rand_method); LCRYPTO_USED(RAND_SSLeay); LCRYPTO_USED(ERR_load_RAND_strings); +LCRYPTO_UNUSED(RAND_cleanup); +LCRYPTO_UNUSED(RAND_bytes); +LCRYPTO_UNUSED(RAND_pseudo_bytes); +LCRYPTO_UNUSED(RAND_seed); +LCRYPTO_UNUSED(RAND_add); +LCRYPTO_UNUSED(RAND_load_file); +LCRYPTO_UNUSED(RAND_write_file); +LCRYPTO_UNUSED(RAND_file_name); +LCRYPTO_UNUSED(RAND_status); +LCRYPTO_UNUSED(RAND_poll); #endif /* _LIBCRYPTO_RAND_H */ diff --git a/lib/libcrypto/hidden/openssl/x509.h b/lib/libcrypto/hidden/openssl/x509.h index 35a4a67e0..6cf6ca5f6 100644 --- a/lib/libcrypto/hidden/openssl/x509.h +++ b/lib/libcrypto/hidden/openssl/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.4 2024/03/02 10:48:17 tb Exp $ */ +/* $OpenBSD: x509.h,v 1.5 2024/04/09 13:55:02 beck Exp $ */ /* * Copyright (c) 2022 Bob Beck * @@ -269,5 +269,199 @@ LCRYPTO_USED(X509_check_trust); LCRYPTO_USED(X509_up_ref); LCRYPTO_USED(X509_chain_up_ref); LCRYPTO_USED(ERR_load_X509_strings); +LCRYPTO_USED(X509_CRL_get_signature_nid); +LCRYPTO_USED(X509_CRL_get0_extensions); +LCRYPTO_USED(X509_CRL_get_version); +LCRYPTO_USED(X509_CRL_get0_lastUpdate); +LCRYPTO_USED(X509_CRL_get0_nextUpdate); +LCRYPTO_USED(X509_CRL_get_lastUpdate); +LCRYPTO_USED(X509_CRL_get_nextUpdate); +LCRYPTO_USED(X509_CRL_get_issuer); +LCRYPTO_USED(X509_CRL_get_REVOKED); +LCRYPTO_USED(X509_CRL_get0_signature); +LCRYPTO_USED(X509_CRL_get0_tbs_sigalg); +LCRYPTO_USED(X509_REQ_get_signature_nid); +LCRYPTO_USED(X509_REQ_get0_signature); +LCRYPTO_USED(X509_CRL_verify); +LCRYPTO_USED(NETSCAPE_SPKI_print); +LCRYPTO_USED(X509_signature_dump); +LCRYPTO_USED(X509_signature_print); +LCRYPTO_USED(d2i_RSA_PUBKEY_fp); +LCRYPTO_USED(i2d_RSA_PUBKEY_fp); +LCRYPTO_USED(d2i_DSA_PUBKEY_fp); +LCRYPTO_USED(i2d_DSA_PUBKEY_fp); +LCRYPTO_USED(d2i_EC_PUBKEY_fp); +LCRYPTO_USED(i2d_EC_PUBKEY_fp); +LCRYPTO_USED(i2d_PUBKEY_fp); +LCRYPTO_USED(d2i_PUBKEY_fp); +LCRYPTO_USED(d2i_RSA_PUBKEY_bio); +LCRYPTO_USED(i2d_RSA_PUBKEY_bio); +LCRYPTO_USED(d2i_DSA_PUBKEY_bio); +LCRYPTO_USED(i2d_DSA_PUBKEY_bio); +LCRYPTO_USED(d2i_EC_PUBKEY_bio); +LCRYPTO_USED(i2d_EC_PUBKEY_bio); +LCRYPTO_USED(i2d_PUBKEY_bio); +LCRYPTO_USED(d2i_PUBKEY_bio); +LCRYPTO_USED(X509_dup); +LCRYPTO_USED(X509_ATTRIBUTE_dup); +LCRYPTO_USED(X509_EXTENSION_dup); +LCRYPTO_USED(X509_CRL_dup); +LCRYPTO_USED(X509_REQ_dup); +LCRYPTO_USED(X509_ALGOR_dup); +LCRYPTO_USED(X509_ALGOR_set0); +LCRYPTO_USED(X509_ALGOR_get0); +LCRYPTO_USED(X509_ALGOR_cmp); +LCRYPTO_USED(X509_NAME_dup); +LCRYPTO_USED(X509_NAME_get0_der); +LCRYPTO_USED(X509_NAME_ENTRY_dup); +LCRYPTO_USED(X509_ALGOR_new); +LCRYPTO_USED(X509_ALGOR_free); +LCRYPTO_USED(d2i_X509_ALGOR); +LCRYPTO_USED(i2d_X509_ALGOR); +LCRYPTO_USED(d2i_X509_ALGORS); +LCRYPTO_USED(i2d_X509_ALGORS); +LCRYPTO_USED(X509_VAL_new); +LCRYPTO_USED(X509_VAL_free); +LCRYPTO_USED(d2i_X509_VAL); +LCRYPTO_USED(i2d_X509_VAL); +LCRYPTO_USED(X509_PUBKEY_new); +LCRYPTO_USED(X509_PUBKEY_free); +LCRYPTO_USED(d2i_X509_PUBKEY); +LCRYPTO_USED(i2d_X509_PUBKEY); +LCRYPTO_USED(X509_PUBKEY_set); +LCRYPTO_USED(X509_PUBKEY_get); +LCRYPTO_USED(X509_PUBKEY_get0); +LCRYPTO_USED(i2d_PUBKEY); +LCRYPTO_USED(d2i_PUBKEY); +LCRYPTO_USED(i2d_RSA_PUBKEY); +LCRYPTO_USED(d2i_RSA_PUBKEY); +LCRYPTO_USED(i2d_DSA_PUBKEY); +LCRYPTO_USED(d2i_DSA_PUBKEY); +LCRYPTO_USED(i2d_EC_PUBKEY); +LCRYPTO_USED(d2i_EC_PUBKEY); +LCRYPTO_USED(X509_SIG_new); +LCRYPTO_USED(X509_SIG_free); +LCRYPTO_USED(d2i_X509_SIG); +LCRYPTO_USED(i2d_X509_SIG); +LCRYPTO_USED(X509_SIG_get0); +LCRYPTO_USED(X509_SIG_getm); +LCRYPTO_USED(X509_REQ_INFO_new); +LCRYPTO_USED(X509_REQ_INFO_free); +LCRYPTO_USED(d2i_X509_REQ_INFO); +LCRYPTO_USED(i2d_X509_REQ_INFO); +LCRYPTO_USED(X509_REQ_new); +LCRYPTO_USED(X509_REQ_free); +LCRYPTO_USED(d2i_X509_REQ); +LCRYPTO_USED(i2d_X509_REQ); +LCRYPTO_USED(X509_ATTRIBUTE_new); +LCRYPTO_USED(X509_ATTRIBUTE_free); +LCRYPTO_USED(d2i_X509_ATTRIBUTE); +LCRYPTO_USED(i2d_X509_ATTRIBUTE); +LCRYPTO_USED(X509_ATTRIBUTE_create); +LCRYPTO_USED(X509_EXTENSION_new); +LCRYPTO_USED(X509_EXTENSION_free); +LCRYPTO_USED(d2i_X509_EXTENSION); +LCRYPTO_USED(i2d_X509_EXTENSION); +LCRYPTO_USED(d2i_X509_EXTENSIONS); +LCRYPTO_USED(i2d_X509_EXTENSIONS); +LCRYPTO_USED(X509_NAME_ENTRY_new); +LCRYPTO_USED(X509_NAME_ENTRY_free); +LCRYPTO_USED(d2i_X509_NAME_ENTRY); +LCRYPTO_USED(i2d_X509_NAME_ENTRY); +LCRYPTO_USED(X509_NAME_new); +LCRYPTO_USED(X509_NAME_free); +LCRYPTO_USED(d2i_X509_NAME); +LCRYPTO_USED(i2d_X509_NAME); +LCRYPTO_USED(X509_NAME_set); +LCRYPTO_USED(X509_CINF_new); +LCRYPTO_USED(X509_CINF_free); +LCRYPTO_USED(d2i_X509_CINF); +LCRYPTO_USED(i2d_X509_CINF); +LCRYPTO_USED(X509_new); +LCRYPTO_USED(X509_free); +LCRYPTO_USED(d2i_X509); +LCRYPTO_USED(i2d_X509); +LCRYPTO_USED(X509_get_ex_new_index); +LCRYPTO_USED(X509_set_ex_data); +LCRYPTO_USED(X509_get_ex_data); +LCRYPTO_USED(i2d_X509_AUX); +LCRYPTO_USED(d2i_X509_AUX); +LCRYPTO_USED(i2d_re_X509_tbs); +LCRYPTO_USED(X509_get0_signature); +LCRYPTO_USED(X509_get_signature_nid); +LCRYPTO_USED(X509_alias_set1); +LCRYPTO_USED(X509_keyid_set1); +LCRYPTO_USED(X509_alias_get0); +LCRYPTO_USED(X509_keyid_get0); +LCRYPTO_USED(X509_add1_trust_object); +LCRYPTO_USED(X509_add1_reject_object); +LCRYPTO_USED(X509_trust_clear); +LCRYPTO_USED(X509_reject_clear); +LCRYPTO_USED(X509_REVOKED_new); +LCRYPTO_USED(X509_REVOKED_free); +LCRYPTO_USED(X509_REVOKED_dup); +LCRYPTO_USED(d2i_X509_REVOKED); +LCRYPTO_USED(i2d_X509_REVOKED); +LCRYPTO_USED(X509_CRL_INFO_new); +LCRYPTO_USED(X509_CRL_INFO_free); +LCRYPTO_USED(d2i_X509_CRL_INFO); +LCRYPTO_USED(i2d_X509_CRL_INFO); +LCRYPTO_USED(X509_CRL_new); +LCRYPTO_USED(X509_CRL_free); +LCRYPTO_USED(d2i_X509_CRL); +LCRYPTO_USED(i2d_X509_CRL); +LCRYPTO_USED(X509_CRL_add0_revoked); +LCRYPTO_USED(X509_CRL_get0_by_serial); +LCRYPTO_USED(X509_CRL_get0_by_cert); +LCRYPTO_USED(X509_PKEY_new); +LCRYPTO_USED(X509_PKEY_free); +LCRYPTO_USED(NETSCAPE_SPKI_new); +LCRYPTO_USED(NETSCAPE_SPKI_free); +LCRYPTO_USED(d2i_NETSCAPE_SPKI); +LCRYPTO_USED(i2d_NETSCAPE_SPKI); +LCRYPTO_USED(NETSCAPE_SPKAC_new); +LCRYPTO_USED(NETSCAPE_SPKAC_free); +LCRYPTO_USED(d2i_NETSCAPE_SPKAC); +LCRYPTO_USED(i2d_NETSCAPE_SPKAC); +LCRYPTO_USED(X509_INFO_new); +LCRYPTO_USED(X509_INFO_free); +LCRYPTO_USED(ASN1_item_digest); +LCRYPTO_USED(ASN1_item_verify); +LCRYPTO_USED(ASN1_item_sign); +LCRYPTO_USED(ASN1_item_sign_ctx); +LCRYPTO_USED(X509_print_ex_fp); +LCRYPTO_USED(X509_print_fp); +LCRYPTO_USED(X509_CRL_print_fp); +LCRYPTO_USED(X509_REQ_print_fp); +LCRYPTO_USED(X509_NAME_print_ex_fp); +LCRYPTO_USED(X509_NAME_print); +LCRYPTO_USED(X509_NAME_print_ex); +LCRYPTO_USED(X509_print_ex); +LCRYPTO_USED(X509_print); +LCRYPTO_USED(X509_ocspid_print); +LCRYPTO_USED(X509_CRL_print); +LCRYPTO_USED(X509_REQ_print_ex); +LCRYPTO_USED(X509_REQ_print); +LCRYPTO_USED(EVP_PKEY_get_attr_count); +LCRYPTO_USED(EVP_PKEY_get_attr_by_NID); +LCRYPTO_USED(EVP_PKEY_get_attr_by_OBJ); +LCRYPTO_USED(EVP_PKEY_get_attr); +LCRYPTO_USED(EVP_PKEY_delete_attr); +LCRYPTO_USED(EVP_PKEY_add1_attr); +LCRYPTO_USED(EVP_PKEY_add1_attr_by_OBJ); +LCRYPTO_USED(EVP_PKEY_add1_attr_by_NID); +LCRYPTO_USED(EVP_PKEY_add1_attr_by_txt); +LCRYPTO_USED(PKCS8_PRIV_KEY_INFO_new); +LCRYPTO_USED(PKCS8_PRIV_KEY_INFO_free); +LCRYPTO_USED(d2i_PKCS8_PRIV_KEY_INFO); +LCRYPTO_USED(i2d_PKCS8_PRIV_KEY_INFO); +LCRYPTO_USED(EVP_PKCS82PKEY); +LCRYPTO_USED(EVP_PKEY2PKCS8); +LCRYPTO_USED(PKCS8_pkey_set0); +LCRYPTO_USED(PKCS8_pkey_get0); +LCRYPTO_USED(PKCS8_pkey_get0_attrs); +LCRYPTO_USED(PKCS8_pkey_add1_attr_by_NID); +LCRYPTO_USED(X509_PUBKEY_set0_param); +LCRYPTO_USED(X509_PUBKEY_get0_param); #endif /* _LIBCRYPTO_X509_H */ diff --git a/lib/libcrypto/malloc-wrapper.c b/lib/libcrypto/malloc-wrapper.c index fb42169b2..7330903c6 100644 --- a/lib/libcrypto/malloc-wrapper.c +++ b/lib/libcrypto/malloc-wrapper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc-wrapper.c,v 1.10 2024/03/02 11:35:09 tb Exp $ */ +/* $OpenBSD: malloc-wrapper.c,v 1.11 2024/04/10 14:51:02 beck Exp $ */ /* * Copyright (c) 2014 Bob Beck * @@ -41,15 +41,18 @@ CRYPTO_malloc(size_t num, const char *file, int line) { return malloc(num); } +LCRYPTO_ALIAS(CRYPTO_malloc); char * CRYPTO_strdup(const char *str, const char *file, int line) { return strdup(str); } +LCRYPTO_ALIAS(CRYPTO_strdup); void CRYPTO_free(void *ptr, const char *file, int line) { free(ptr); } +LCRYPTO_ALIAS(CRYPTO_free); diff --git a/lib/libcrypto/mem_clr.c b/lib/libcrypto/mem_clr.c index 9ee5e65a2..a936dcc5b 100644 --- a/lib/libcrypto/mem_clr.c +++ b/lib/libcrypto/mem_clr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem_clr.c,v 1.4 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: mem_clr.c,v 1.5 2024/04/10 14:51:02 beck Exp $ */ /* Ted Unangst places this file in the public domain. */ #include @@ -9,3 +9,4 @@ OPENSSL_cleanse(void *ptr, size_t len) { explicit_bzero(ptr, len); } +LCRYPTO_ALIAS(OPENSSL_cleanse); diff --git a/lib/libcrypto/mem_dbg.c b/lib/libcrypto/mem_dbg.c index 031db43e3..a7b386326 100644 --- a/lib/libcrypto/mem_dbg.c +++ b/lib/libcrypto/mem_dbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem_dbg.c,v 1.27 2024/03/02 11:32:31 tb Exp $ */ +/* $OpenBSD: mem_dbg.c,v 1.28 2024/04/10 14:51:02 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -116,3 +116,4 @@ CRYPTO_mem_ctrl(int mode) { return (CRYPTO_MEM_CHECK_OFF); } +LCRYPTO_ALIAS(CRYPTO_mem_ctrl); diff --git a/lib/libcrypto/o_fips.c b/lib/libcrypto/o_fips.c index 56037c15b..8a20417e8 100644 --- a/lib/libcrypto/o_fips.c +++ b/lib/libcrypto/o_fips.c @@ -1,4 +1,4 @@ -/* $OpenBSD: o_fips.c,v 1.6 2021/10/23 13:57:00 schwarze Exp $ */ +/* $OpenBSD: o_fips.c,v 1.7 2024/04/10 14:51:02 beck Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2011. */ @@ -65,6 +65,7 @@ FIPS_mode(void) { return 0; } +LCRYPTO_ALIAS(FIPS_mode); int FIPS_mode_set(int r) @@ -74,3 +75,4 @@ FIPS_mode_set(int r) CRYPTOerror(CRYPTO_R_FIPS_MODE_NOT_SUPPORTED); return 0; } +LCRYPTO_ALIAS(FIPS_mode_set); diff --git a/lib/libcrypto/rand/rand.h b/lib/libcrypto/rand/rand.h index d66d71579..1a2c8f715 100644 --- a/lib/libcrypto/rand/rand.h +++ b/lib/libcrypto/rand/rand.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rand.h,v 1.24 2023/11/19 15:46:10 tb Exp $ */ +/* $OpenBSD: rand.h,v 1.25 2024/04/10 14:53:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,7 +85,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth); const RAND_METHOD *RAND_get_rand_method(void); RAND_METHOD *RAND_SSLeay(void); -#ifndef LIBRESSL_INTERNAL void RAND_cleanup(void ); int RAND_bytes(unsigned char *buf, int num); int RAND_pseudo_bytes(unsigned char *buf, int num); @@ -96,7 +95,6 @@ int RAND_write_file(const char *file); const char *RAND_file_name(char *file, size_t num); int RAND_status(void); int RAND_poll(void); -#endif void ERR_load_RAND_strings(void); diff --git a/lib/libcrypto/rand/rand_lib.c b/lib/libcrypto/rand/rand_lib.c index b9ef0deeb..0c9810f84 100644 --- a/lib/libcrypto/rand/rand_lib.c +++ b/lib/libcrypto/rand/rand_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rand_lib.c,v 1.23 2023/11/19 15:46:10 tb Exp $ */ +/* $OpenBSD: rand_lib.c,v 1.24 2024/04/10 14:53:01 beck Exp $ */ /* * Copyright (c) 2014 Ted Unangst * @@ -50,30 +50,35 @@ RAND_cleanup(void) { } +LCRYPTO_ALIAS(RAND_cleanup); void RAND_seed(const void *buf, int num) { } +LCRYPTO_ALIAS(RAND_seed); void RAND_add(const void *buf, int num, double entropy) { } +LCRYPTO_ALIAS(RAND_add); int RAND_status(void) { return 1; } +LCRYPTO_ALIAS(RAND_status); int RAND_poll(void) { return 1; } +LCRYPTO_ALIAS(RAND_poll); /* * Hurray. You've made it to the good parts. @@ -85,6 +90,7 @@ RAND_bytes(unsigned char *buf, int num) arc4random_buf(buf, num); return 1; } +LCRYPTO_ALIAS(RAND_bytes); int RAND_pseudo_bytes(unsigned char *buf, int num) @@ -93,3 +99,4 @@ RAND_pseudo_bytes(unsigned char *buf, int num) arc4random_buf(buf, num); return 1; } +LCRYPTO_ALIAS(RAND_pseudo_bytes); diff --git a/lib/libcrypto/rand/randfile.c b/lib/libcrypto/rand/randfile.c index 00008af75..5fdfcb8dd 100644 --- a/lib/libcrypto/rand/randfile.c +++ b/lib/libcrypto/rand/randfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: randfile.c,v 1.44 2023/07/07 19:37:54 beck Exp $ */ +/* $OpenBSD: randfile.c,v 1.45 2024/04/10 14:53:01 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -85,6 +85,7 @@ RAND_load_file(const char *file, long bytes) else return bytes; } +LCRYPTO_ALIAS(RAND_load_file); int RAND_write_file(const char *file) @@ -133,6 +134,7 @@ RAND_write_file(const char *file) explicit_bzero(buf, BUFSIZE); return ret; } +LCRYPTO_ALIAS(RAND_write_file); const char * RAND_file_name(char * buf, size_t size) @@ -141,3 +143,4 @@ RAND_file_name(char * buf, size_t size) return (NULL); return buf; } +LCRYPTO_ALIAS(RAND_file_name); diff --git a/lib/libcrypto/x509/x509_purp.c b/lib/libcrypto/x509/x509_purp.c index 8f4e5934e..baa33d576 100644 --- a/lib/libcrypto/x509/x509_purp.c +++ b/lib/libcrypto/x509/x509_purp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_purp.c,v 1.40 2024/04/08 23:46:21 beck Exp $ */ +/* $OpenBSD: x509_purp.c,v 1.41 2024/04/09 15:00:44 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -398,6 +398,13 @@ x509v3_cache_extensions_internal(X509 *x) if (x->ex_flags & EXFLAG_SET) return; + /* + * XXX - this should really only set EXFLAG_INVALID if extensions are + * invalid. However, the X509_digest() failure matches OpenSSL/BoringSSL + * behavior and the version checks are at least vaguely related to + * extensions. + */ + if (!X509_digest(x, X509_CERT_HASH_EVP, x->hash, NULL)) x->ex_flags |= EXFLAG_INVALID; diff --git a/regress/lib/libcrypto/bn/Makefile b/regress/lib/libcrypto/bn/Makefile index 6342a6142..8f4905061 100644 --- a/regress/lib/libcrypto/bn/Makefile +++ b/regress/lib/libcrypto/bn/Makefile @@ -1,6 +1,7 @@ -# $OpenBSD: Makefile,v 1.37 2023/10/19 10:23:38 tb Exp $ +# $OpenBSD: Makefile,v 1.38 2024/04/09 14:59:57 jsing Exp $ PROGS += bn_add_sub +PROGS += bn_bits PROGS += bn_cmp PROGS += bn_convert PROGS += bn_gcd diff --git a/regress/lib/libcrypto/bn/bn_bits.c b/regress/lib/libcrypto/bn/bn_bits.c new file mode 100644 index 000000000..4ed13e424 --- /dev/null +++ b/regress/lib/libcrypto/bn/bn_bits.c @@ -0,0 +1,227 @@ +/* $OpenBSD: bn_bits.c,v 1.1 2024/04/09 14:59:57 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#include + +static int +test_bn_set_bit(void) +{ + BIGNUM *bn = NULL; + char *out_str = NULL; + size_t i; + int failed = 1; + + if ((bn = BN_new()) == NULL) + goto failure; + + for (i = 0; i < 128; i++) { + if (i % 2 == 0) { + if (!BN_set_bit(bn, i)) { + fprintf(stderr, "FAIL: failed to set bit\n"); + goto failure; + } + } + if (BN_is_bit_set(bn, i) != (i % 2 == 0)) { + fprintf(stderr, "FAIL: BN_is_bit_set() = %d, want %d\n", + BN_is_bit_set(bn, i), (i % 2 == 0)); + goto failure; + } + } + + if ((out_str = BN_bn2hex(bn)) == NULL) + goto failure; + if (strcmp(out_str, "55555555555555555555555555555555") != 0) { + fprintf(stderr, "FAIL: got 0x%s, want 0x%s\n", out_str, + "55555555555555555555555555555555"); + goto failure; + } + + failed = 0; + + failure: + BN_free(bn); + free(out_str); + + return failed; +} + +static int +test_bn_clear_bit(void) +{ + BIGNUM *bn = NULL; + char *out_str = NULL; + size_t i; + int failed = 1; + + if ((bn = BN_new()) == NULL) + goto failure; + + for (i = 0; i < 128; i++) { + if (!BN_set_bit(bn, i)) { + fprintf(stderr, "FAIL: failed to set bit\n"); + goto failure; + } + if (i % 2 == 0) { + if (!BN_clear_bit(bn, i)) { + fprintf(stderr, "FAIL: failed to clear bit\n"); + goto failure; + } + } + if (BN_is_bit_set(bn, i) != (i % 2 == 1)) { + fprintf(stderr, "FAIL: BN_is_bit_set() = %d, want %d\n", + BN_is_bit_set(bn, i), (i % 2 == 1)); + goto failure; + } + } + + if ((out_str = BN_bn2hex(bn)) == NULL) + goto failure; + if (strcmp(out_str, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") != 0) { + fprintf(stderr, "FAIL: got 0x%s, want 0x%s\n", out_str, + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + goto failure; + } + + /* Ensure that clearing results in non-negative zero. */ + if (!BN_one(bn)) + goto failure; + BN_set_negative(bn, 1); + if (!BN_clear_bit(bn, 0)) { + fprintf(stderr, "FAIL: failed to clear bit\n"); + goto failure; + } + if (!BN_is_zero(bn)) { + fprintf(stderr, "FAIL: clear bit did not result in zero\n"); + goto failure; + } +#if 0 + if (BN_is_negative(bn)) { + fprintf(stderr, "FAIL: clear bit resulted in -0\n"); + goto failure; + } +#endif + + failed = 0; + + failure: + BN_free(bn); + free(out_str); + + return failed; +} + +static int +test_bn_mask_bits(void) +{ + BIGNUM *bn = NULL; + char *out_str = NULL; + size_t i; + int failed = 1; + + if ((bn = BN_new()) == NULL) + goto failure; + + if (BN_mask_bits(bn, 0)) { + fprintf(stderr, "FAIL: mask bits should have failed\n"); + goto failure; + } + + for (i = 0; i < 128; i++) { + if (!BN_set_bit(bn, i)) { + fprintf(stderr, "FAIL: failed to set bit\n"); + goto failure; + } + } + + if ((out_str = BN_bn2hex(bn)) == NULL) + goto failure; + if (strcmp(out_str, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") != 0) { + fprintf(stderr, "FAIL: got 0x%s, want 0x%s\n", out_str, + "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + goto failure; + } + + if (!BN_mask_bits(bn, 127)) { + fprintf(stderr, "FAIL: failed to mask bits\n"); + goto failure; + } + + free(out_str); + if ((out_str = BN_bn2hex(bn)) == NULL) + goto failure; + if (strcmp(out_str, "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") != 0) { + fprintf(stderr, "FAIL: got 0x%s, want 0x%s\n", out_str, + "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"); + goto failure; + } + + if (!BN_mask_bits(bn, 65)) { + fprintf(stderr, "FAIL: failed to mask bits\n"); + goto failure; + } + + free(out_str); + if ((out_str = BN_bn2hex(bn)) == NULL) + goto failure; + if (strcmp(out_str, "01FFFFFFFFFFFFFFFF") != 0) { + fprintf(stderr, "FAIL: got 0x%s, want 0x%s\n", out_str, + "01FFFFFFFFFFFFFFFF"); + goto failure; + } + + /* Ensure that masking results in non-negative zero. */ + if (!BN_one(bn)) + goto failure; + BN_set_negative(bn, 1); + if (!BN_mask_bits(bn, 0)) { + fprintf(stderr, "FAIL: failed to mask bits\n"); + goto failure; + } + if (!BN_is_zero(bn)) { + fprintf(stderr, "FAIL: mask bits did not result in zero\n"); + goto failure; + } +#if 0 + if (BN_is_negative(bn)) { + fprintf(stderr, "FAIL: mask bits resulted in -0\n"); + goto failure; + } +#endif + + failed = 0; + + failure: + BN_free(bn); + free(out_str); + + return failed; +} + +int +main(int argc, char **argv) +{ + int failed = 0; + + failed |= test_bn_set_bit(); + failed |= test_bn_clear_bit(); + failed |= test_bn_mask_bits(); + + return failed; +} diff --git a/regress/lib/libcrypto/bn/bn_convert.c b/regress/lib/libcrypto/bn/bn_convert.c index 69f7da43b..c787036cc 100644 --- a/regress/lib/libcrypto/bn/bn_convert.c +++ b/regress/lib/libcrypto/bn/bn_convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bn_convert.c,v 1.3 2023/06/23 10:50:47 tb Exp $ */ +/* $OpenBSD: bn_convert.c,v 1.5 2024/04/09 16:06:01 tb Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -26,7 +26,6 @@ * - BN_bn2binpad() * - BN_bn2lebinpad() * - BN_lebin2bn() - * - BN_bn2mpi()/BN_mpi2bn() * - BN_print()/BN_print_fp() * * - Invalid inputs to {asc,dec,hex,mpi}2bn @@ -238,6 +237,8 @@ struct bn_convert_test { int neg; const char *dec; const char *hex; + const uint8_t mpi[64]; + int mpi_len; }; static const struct bn_convert_test bn_convert_tests[] = { @@ -247,6 +248,8 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "0", .hex = "0", + .mpi = { 0x00, 0x00, 0x00, 0x00, }, + .mpi_len = 4, }, { .bin = { 0x1, }, @@ -254,6 +257,17 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "1", .hex = "01", + .mpi = { 0x00, 0x00, 0x00, 0x01, 0x01, }, + .mpi_len = 5, + }, + { + .bin = { 0x1, }, + .bin_len = 1, + .neg = 1, + .dec = "-1", + .hex = "-01", + .mpi = { 0x00, 0x00, 0x00, 0x01, 0x81, }, + .mpi_len = 5, }, { .bin = { 0x7f, 0xff, 0xff, }, @@ -261,6 +275,8 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "8388607", .hex = "7FFFFF", + .mpi = { 0x00, 0x00, 0x00, 0x03, 0x7f, 0xff, 0xff }, + .mpi_len = 7, }, { .bin = { 0x7f, 0xff, 0xff, }, @@ -268,6 +284,8 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 1, .dec = "-8388607", .hex = "-7FFFFF", + .mpi = { 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff }, + .mpi_len = 7, }, { .bin = { 0xff, 0xff, 0xff, 0xff, }, @@ -275,6 +293,11 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "4294967295", .hex = "FFFFFFFF", + .mpi = { + 0x00, 0x00, 0x00, 0x05, 0x00, 0xff, 0xff, 0xff, + 0xff, + }, + .mpi_len = 9, }, { .bin = { 0xff, 0xff, 0xff, 0xff, }, @@ -282,6 +305,11 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 1, .dec = "-4294967295", .hex = "-FFFFFFFF", + .mpi = { + 0x00, 0x00, 0x00, 0x05, 0x80, 0xff, 0xff, 0xff, + 0xff, + }, + .mpi_len = 9, }, { .bin = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, }, @@ -289,6 +317,11 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "18446744069414584320", .hex = "FFFFFFFF00000000", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x00, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, + }, + .mpi_len = 13, }, { .bin = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, }, @@ -296,6 +329,11 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 1, .dec = "-18446744069414584320", .hex = "-FFFFFFFF00000000", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x80, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, + }, + .mpi_len = 13, }, { .bin = { 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, }, @@ -303,6 +341,11 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "9223794255762391041", .hex = "8001800180018001", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x00, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, + }, + .mpi_len = 13, }, { .bin = { 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, }, @@ -310,20 +353,41 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 1, .dec = "-9223794255762391041", .hex = "-8001800180018001", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x80, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, + }, + .mpi_len = 13, }, { - .bin = { 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, }, + .bin = { + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, + 0x01, + }, .bin_len = 9, .neg = 0, .dec = "27670538329471942657", .hex = "018001800180018001", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x01, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, + }, + .mpi_len = 13, }, { - .bin = { 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, }, + .bin = { + 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, + 0x01, + }, .bin_len = 9, .neg = 1, .dec = "-27670538329471942657", .hex = "-018001800180018001", + .mpi = { + 0x00, 0x00, 0x00, 0x09, 0x81, 0x80, 0x01, 0x80, + 0x01, 0x80, 0x01, 0x80, 0x01, + }, + .mpi_len = 13, }, { .bin = { @@ -336,6 +400,14 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 0, .dec = "57895161181645529494837117048595051142566530671229791132691030063130991362047", .hex = "7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF", + .mpi = { + 0x00, 0x00, 0x00, 0x20, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, + }, + .mpi_len = 36, }, { .bin = { @@ -348,6 +420,14 @@ static const struct bn_convert_test bn_convert_tests[] = { .neg = 1, .dec = "-57895161181645529494837117048595051142566530671229791132691030063130991362047", .hex = "-7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF7FFF", + .mpi = { + 0x00, 0x00, 0x00, 0x20, 0xff, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, + 0x7f, 0xff, 0x7f, 0xff, + }, + .mpi_len = 36, }, }; @@ -358,8 +438,10 @@ static int test_bn_convert(void) { const struct bn_convert_test *bct; + uint8_t *mpi_out = NULL; char *out_str = NULL; BIGNUM *bn = NULL; + int mpi_len; size_t i; int failed = 1; @@ -399,6 +481,30 @@ test_bn_convert(void) goto failure; } + free(mpi_out); + mpi_out = NULL; + + if ((mpi_len = BN_bn2mpi(bn, NULL)) != bct->mpi_len) { + fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() returned " + "%d, want %d", i, mpi_len, bct->mpi_len); + goto failure; + } + if ((mpi_out = calloc(1, bct->mpi_len)) == NULL) + goto failure; + if ((mpi_len = BN_bn2mpi(bn, mpi_out)) != bct->mpi_len) { + fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() returned " + "%d, want %d", i, mpi_len, bct->mpi_len); + goto failure; + } + if (memcmp(mpi_out, bct->mpi, bct->mpi_len) != 0) { + fprintf(stderr, "FAIL: Test %zu - BN_bn2mpi() " + "generated:\n", i); + hexdump(mpi_out, bct->mpi_len); + fprintf(stderr, "Want:\n"); + hexdump(bct->mpi, bct->mpi_len); + goto failure; + } + if (BN_dec2bn(&bn, bct->dec) != (int)strlen(bct->dec)) { fprintf(stderr, "FAIL: BN_dec2bn() failed\n"); goto failure; @@ -409,7 +515,6 @@ test_bn_convert(void) bct->neg); goto failure; } - if (check_bin_output(i, "BN_dec2bn()", bct->bin, bct->bin_len, bn) != 0) goto failure; @@ -424,15 +529,29 @@ test_bn_convert(void) bct->neg); goto failure; } - if (check_bin_output(i, "BN_hex2bn()", bct->bin, bct->bin_len, bn) != 0) goto failure; + + if (BN_mpi2bn(bct->mpi, bct->mpi_len, bn) == NULL) { + fprintf(stderr, "FAIL: BN_mpi2bn() failed\n"); + goto failure; + } + if (BN_is_negative(bn) != bct->neg) { + fprintf(stderr, "FAIL: Test %zu - BN_mpi2bn() resulted " + "in negative %d, want %d", i, BN_is_negative(bn), + bct->neg); + goto failure; + } + if (check_bin_output(i, "BN_mpi2bn()", bct->bin, bct->bin_len, + bn) != 0) + goto failure; } failed = 0; failure: + free(mpi_out); free(out_str); BN_free(bn); diff --git a/regress/lib/libcrypto/symbols/symbols.awk b/regress/lib/libcrypto/symbols/symbols.awk index de41d0529..5ad467781 100644 --- a/regress/lib/libcrypto/symbols/symbols.awk +++ b/regress/lib/libcrypto/symbols/symbols.awk @@ -1,4 +1,4 @@ -# $OpenBSD: symbols.awk,v 1.9 2024/03/29 02:30:25 jsing Exp $ +# $OpenBSD: symbols.awk,v 1.10 2024/04/10 16:12:10 tb Exp $ # Copyright (c) 2018,2020 Theo Buehler # @@ -52,15 +52,9 @@ BEGIN { printf("extern int ASN1_time_tm_clamp_notafter(struct tm *);\n") } -/^OBJ_bsearch_$/ { - printf("const void *OBJ_bsearch_(const void *key, const void *base, int num,\n") - printf(" int size, int (*cmp)(const void *, const void *));\n") -} - -# These are machdep (at least cpuid_setup and ia32cap_P are internal on amd64). +# These are machdep. /^OPENSSL_cpuid_setup$/ || -/^OPENSSL_cpu_caps$/ || -/^OPENSSL_ia32cap_P$/ { +/^OPENSSL_cpu_caps$/ { printf("/* skipped %s */\n", $0) next } @@ -77,8 +71,6 @@ BEGIN { /^ECPARAMETERS_free$/ || /^ECPKPARAMETERS_free$/ || /^EC_PRIVATEKEY_free$/ || -/^NETSCAPE_ENCRYPTED_PKEY_free$/ || -/^NETSCAPE_PKEY_free$/ || /^X9_62_CHARACTERISTIC_TWO_free$/ || /^X9_62_PENTANOMIAL_free$/ { printf("extern void %s(void *);\n", $0) @@ -88,25 +80,19 @@ BEGIN { /^ECPARAMETERS_new$/ || /^ECPKPARAMETERS_new$/ || /^EC_PRIVATEKEY_new$/ || -/^NETSCAPE_ENCRYPTED_PKEY_new$/ || -/^NETSCAPE_PKEY_new$/ || /^X9_62_CHARACTERISTIC_TWO_new$/ || /^X9_62_PENTANOMIAL_new$/ { printf("extern void *%s(void);\n", $0) } /^d2i_ECPKPARAMETERS$/ || -/^d2i_EC_PRIVATEKEY$/ || -/^d2i_NETSCAPE_ENCRYPTED_PKEY$/ || -/^d2i_NETSCAPE_PKEY$/ { +/^d2i_EC_PRIVATEKEY$/ { printf("extern void *%s", $0) printf("(void *, const unsigned char *, const unsigned char *);\n") } /^i2d_ECPKPARAMETERS$/ || -/^i2d_EC_PRIVATEKEY$/ || -/^i2d_NETSCAPE_ENCRYPTED_PKEY$/ || -/^i2d_NETSCAPE_PKEY$/ { +/^i2d_EC_PRIVATEKEY$/ { printf("extern int %s", $0) printf("(const void *, unsigned char **);\n") } diff --git a/regress/lib/libcrypto/whirlpool/whirlpool_test.c b/regress/lib/libcrypto/whirlpool/whirlpool_test.c index f72f9c3bb..809edbba1 100644 --- a/regress/lib/libcrypto/whirlpool/whirlpool_test.c +++ b/regress/lib/libcrypto/whirlpool/whirlpool_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: whirlpool_test.c,v 1.1 2024/03/29 07:13:38 joshua Exp $ */ +/* $OpenBSD: whirlpool_test.c,v 1.3 2024/04/09 18:12:11 tb Exp $ */ /* * Copyright (c) 2024 Joshua Sing * @@ -46,98 +46,98 @@ static const struct whirlpool_test whirlpool_tests[] = { .in = "a", .in_len = 1, .out = { - 0x8a, 0xca, 0x26, 0x02, 0x79, 0x2a, 0xec, 0x6f, - 0x11, 0xa6, 0x72, 0x06, 0x53, 0x1f, 0xb7, 0xd7, - 0xf0, 0xdf, 0xf5, 0x94, 0x13, 0x14, 0x5e, 0x69, - 0x73, 0xc4, 0x50, 0x01, 0xd0, 0x08, 0x7b, 0x42, - 0xd1, 0x1b, 0xc6, 0x45, 0x41, 0x3a, 0xef, 0xf6, - 0x3a, 0x42, 0x39, 0x1a, 0x39, 0x14, 0x5a, 0x59, - 0x1a, 0x92, 0x20, 0x0d, 0x56, 0x01, 0x95, 0xe5, - 0x3b, 0x47, 0x85, 0x84, 0xfd, 0xae, 0x23, 0x1a, + 0x8a, 0xca, 0x26, 0x02, 0x79, 0x2a, 0xec, 0x6f, + 0x11, 0xa6, 0x72, 0x06, 0x53, 0x1f, 0xb7, 0xd7, + 0xf0, 0xdf, 0xf5, 0x94, 0x13, 0x14, 0x5e, 0x69, + 0x73, 0xc4, 0x50, 0x01, 0xd0, 0x08, 0x7b, 0x42, + 0xd1, 0x1b, 0xc6, 0x45, 0x41, 0x3a, 0xef, 0xf6, + 0x3a, 0x42, 0x39, 0x1a, 0x39, 0x14, 0x5a, 0x59, + 0x1a, 0x92, 0x20, 0x0d, 0x56, 0x01, 0x95, 0xe5, + 0x3b, 0x47, 0x85, 0x84, 0xfd, 0xae, 0x23, 0x1a, }, }, { .in = "abc", .in_len = 3, .out = { - 0x4e, 0x24, 0x48, 0xa4, 0xc6, 0xf4, 0x86, 0xbb, - 0x16, 0xb6, 0x56, 0x2c, 0x73, 0xb4, 0x02, 0x0b, - 0xf3, 0x04, 0x3e, 0x3a, 0x73, 0x1b, 0xce, 0x72, - 0x1a, 0xe1, 0xb3, 0x03, 0xd9, 0x7e, 0x6d, 0x4c, - 0x71, 0x81, 0xee, 0xbd, 0xb6, 0xc5, 0x7e, 0x27, - 0x7d, 0x0e, 0x34, 0x95, 0x71, 0x14, 0xcb, 0xd6, - 0xc7, 0x97, 0xfc, 0x9d, 0x95, 0xd8, 0xb5, 0x82, - 0xd2, 0x25, 0x29, 0x20, 0x76, 0xd4, 0xee, 0xf5, + 0x4e, 0x24, 0x48, 0xa4, 0xc6, 0xf4, 0x86, 0xbb, + 0x16, 0xb6, 0x56, 0x2c, 0x73, 0xb4, 0x02, 0x0b, + 0xf3, 0x04, 0x3e, 0x3a, 0x73, 0x1b, 0xce, 0x72, + 0x1a, 0xe1, 0xb3, 0x03, 0xd9, 0x7e, 0x6d, 0x4c, + 0x71, 0x81, 0xee, 0xbd, 0xb6, 0xc5, 0x7e, 0x27, + 0x7d, 0x0e, 0x34, 0x95, 0x71, 0x14, 0xcb, 0xd6, + 0xc7, 0x97, 0xfc, 0x9d, 0x95, 0xd8, 0xb5, 0x82, + 0xd2, 0x25, 0x29, 0x20, 0x76, 0xd4, 0xee, 0xf5, }, }, { .in = "message digest", .in_len = 14, .out = { - 0x37, 0x8c, 0x84, 0xa4, 0x12, 0x6e, 0x2d, 0xc6, - 0xe5, 0x6d, 0xcc, 0x74, 0x58, 0x37, 0x7a, 0xac, - 0x83, 0x8d, 0x00, 0x03, 0x22, 0x30, 0xf5, 0x3c, - 0xe1, 0xf5, 0x70, 0x0c, 0x0f, 0xfb, 0x4d, 0x3b, - 0x84, 0x21, 0x55, 0x76, 0x59, 0xef, 0x55, 0xc1, - 0x06, 0xb4, 0xb5, 0x2a, 0xc5, 0xa4, 0xaa, 0xa6, - 0x92, 0xed, 0x92, 0x00, 0x52, 0x83, 0x8f, 0x33, - 0x62, 0xe8, 0x6d, 0xbd, 0x37, 0xa8, 0x90, 0x3e, + 0x37, 0x8c, 0x84, 0xa4, 0x12, 0x6e, 0x2d, 0xc6, + 0xe5, 0x6d, 0xcc, 0x74, 0x58, 0x37, 0x7a, 0xac, + 0x83, 0x8d, 0x00, 0x03, 0x22, 0x30, 0xf5, 0x3c, + 0xe1, 0xf5, 0x70, 0x0c, 0x0f, 0xfb, 0x4d, 0x3b, + 0x84, 0x21, 0x55, 0x76, 0x59, 0xef, 0x55, 0xc1, + 0x06, 0xb4, 0xb5, 0x2a, 0xc5, 0xa4, 0xaa, 0xa6, + 0x92, 0xed, 0x92, 0x00, 0x52, 0x83, 0x8f, 0x33, + 0x62, 0xe8, 0x6d, 0xbd, 0x37, 0xa8, 0x90, 0x3e, }, }, { .in = "abcdefghijklmnopqrstuvwxyz", .in_len = 26, .out = { - 0xf1, 0xd7, 0x54, 0x66, 0x26, 0x36, 0xff, 0xe9, - 0x2c, 0x82, 0xeb, 0xb9, 0x21, 0x2a, 0x48, 0x4a, - 0x8d, 0x38, 0x63, 0x1e, 0xad, 0x42, 0x38, 0xf5, - 0x44, 0x2e, 0xe1, 0x3b, 0x80, 0x54, 0xe4, 0x1b, - 0x08, 0xbf, 0x2a, 0x92, 0x51, 0xc3, 0x0b, 0x6a, - 0x0b, 0x8a, 0xae, 0x86, 0x17, 0x7a, 0xb4, 0xa6, - 0xf6, 0x8f, 0x67, 0x3e, 0x72, 0x07, 0x86, 0x5d, - 0x5d, 0x98, 0x19, 0xa3, 0xdb, 0xa4, 0xeb, 0x3b, + 0xf1, 0xd7, 0x54, 0x66, 0x26, 0x36, 0xff, 0xe9, + 0x2c, 0x82, 0xeb, 0xb9, 0x21, 0x2a, 0x48, 0x4a, + 0x8d, 0x38, 0x63, 0x1e, 0xad, 0x42, 0x38, 0xf5, + 0x44, 0x2e, 0xe1, 0x3b, 0x80, 0x54, 0xe4, 0x1b, + 0x08, 0xbf, 0x2a, 0x92, 0x51, 0xc3, 0x0b, 0x6a, + 0x0b, 0x8a, 0xae, 0x86, 0x17, 0x7a, 0xb4, 0xa6, + 0xf6, 0x8f, 0x67, 0x3e, 0x72, 0x07, 0x86, 0x5d, + 0x5d, 0x98, 0x19, 0xa3, 0xdb, 0xa4, 0xeb, 0x3b, }, }, { .in = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", .in_len = 62, .out = { - 0xdc, 0x37, 0xe0, 0x08, 0xcf, 0x9e, 0xe6, 0x9b, - 0xf1, 0x1f, 0x00, 0xed, 0x9a, 0xba, 0x26, 0x90, - 0x1d, 0xd7, 0xc2, 0x8c, 0xde, 0xc0, 0x66, 0xcc, - 0x6a, 0xf4, 0x2e, 0x40, 0xf8, 0x2f, 0x3a, 0x1e, - 0x08, 0xeb, 0xa2, 0x66, 0x29, 0x12, 0x9d, 0x8f, - 0xb7, 0xcb, 0x57, 0x21, 0x1b, 0x92, 0x81, 0xa6, - 0x55, 0x17, 0xcc, 0x87, 0x9d, 0x7b, 0x96, 0x21, - 0x42, 0xc6, 0x5f, 0x5a, 0x7a, 0xf0, 0x14, 0x67, + 0xdc, 0x37, 0xe0, 0x08, 0xcf, 0x9e, 0xe6, 0x9b, + 0xf1, 0x1f, 0x00, 0xed, 0x9a, 0xba, 0x26, 0x90, + 0x1d, 0xd7, 0xc2, 0x8c, 0xde, 0xc0, 0x66, 0xcc, + 0x6a, 0xf4, 0x2e, 0x40, 0xf8, 0x2f, 0x3a, 0x1e, + 0x08, 0xeb, 0xa2, 0x66, 0x29, 0x12, 0x9d, 0x8f, + 0xb7, 0xcb, 0x57, 0x21, 0x1b, 0x92, 0x81, 0xa6, + 0x55, 0x17, 0xcc, 0x87, 0x9d, 0x7b, 0x96, 0x21, + 0x42, 0xc6, 0x5f, 0x5a, 0x7a, 0xf0, 0x14, 0x67, }, }, { .in = "12345678901234567890123456789012345678901234567890123456789012345678901234567890", .in_len = 80, .out = { - 0x46, 0x6e, 0xf1, 0x8b, 0xab, 0xb0, 0x15, 0x4d, - 0x25, 0xb9, 0xd3, 0x8a, 0x64, 0x14, 0xf5, 0xc0, - 0x87, 0x84, 0x37, 0x2b, 0xcc, 0xb2, 0x04, 0xd6, - 0x54, 0x9c, 0x4a, 0xfa, 0xdb, 0x60, 0x14, 0x29, - 0x4d, 0x5b, 0xd8, 0xdf, 0x2a, 0x6c, 0x44, 0xe5, - 0x38, 0xcd, 0x04, 0x7b, 0x26, 0x81, 0xa5, 0x1a, - 0x2c, 0x60, 0x48, 0x1e, 0x88, 0xc5, 0xa2, 0x0b, + 0x46, 0x6e, 0xf1, 0x8b, 0xab, 0xb0, 0x15, 0x4d, + 0x25, 0xb9, 0xd3, 0x8a, 0x64, 0x14, 0xf5, 0xc0, + 0x87, 0x84, 0x37, 0x2b, 0xcc, 0xb2, 0x04, 0xd6, + 0x54, 0x9c, 0x4a, 0xfa, 0xdb, 0x60, 0x14, 0x29, + 0x4d, 0x5b, 0xd8, 0xdf, 0x2a, 0x6c, 0x44, 0xe5, + 0x38, 0xcd, 0x04, 0x7b, 0x26, 0x81, 0xa5, 0x1a, + 0x2c, 0x60, 0x48, 0x1e, 0x88, 0xc5, 0xa2, 0x0b, 0x2c, 0X2A, 0X80, 0XCF, 0X3A, 0X9A, 0X08, 0X3B, }, - }, + }, { .in = "abcdbcdecdefdefgefghfghighijhijk", .in_len = 32, .out = { - 0x2a, 0x98, 0x7e, 0xa4, 0x0f, 0x91, 0x70, 0x61, - 0xf5, 0xd6, 0xf0, 0xa0, 0xe4, 0x64, 0x4f, 0x48, - 0x8a, 0x7a, 0x5a, 0x52, 0xde, 0xee, 0x65, 0x62, - 0x07, 0xc5, 0x62, 0xf9, 0x88, 0xe9, 0x5c, 0x69, - 0x16, 0xbd, 0xc8, 0x03, 0x1b, 0xc5, 0xbe, 0x1b, - 0x7b, 0x94, 0x76, 0x39, 0xfe, 0x05, 0x0b, 0x56, - 0x93, 0x9b, 0xaa, 0xa0, 0xad, 0xff, 0x9a, 0xe6, - 0x74, 0x5b, 0x7b, 0x18, 0x1c, 0x3b, 0xe3, 0xfd, + 0x2a, 0x98, 0x7e, 0xa4, 0x0f, 0x91, 0x70, 0x61, + 0xf5, 0xd6, 0xf0, 0xa0, 0xe4, 0x64, 0x4f, 0x48, + 0x8a, 0x7a, 0x5a, 0x52, 0xde, 0xee, 0x65, 0x62, + 0x07, 0xc5, 0x62, 0xf9, 0x88, 0xe9, 0x5c, 0x69, + 0x16, 0xbd, 0xc8, 0x03, 0x1b, 0xc5, 0xbe, 0x1b, + 0x7b, 0x94, 0x76, 0x39, 0xfe, 0x05, 0x0b, 0x56, + 0x93, 0x9b, 0xaa, 0xa0, 0xad, 0xff, 0x9a, 0xe6, + 0x74, 0x5b, 0x7b, 0x18, 0x1c, 0x3b, 0xe3, 0xfd, }, }, }; @@ -156,7 +156,7 @@ whirlpool_test(void) if ((md_ctx = EVP_MD_CTX_new()) == NULL) { fprintf(stderr, "FAIL: EVP_MD_CTX_new() failed\n"); - goto failed; + goto failed; } for (i = 0; i < N_WHIRLPOOL_TESTS; i++) { @@ -192,7 +192,9 @@ whirlpool_test(void) } for (l = 0; l < wt->in_len;) { - in_len = arc4random_uniform(wt->in_len / 2); + in_len = 1; + if (wt->in_len > 1) + in_len = arc4random_uniform(wt->in_len / 2); if (in_len < 1) in_len = 1; if (in_len > wt->in_len - l) diff --git a/regress/sys/arch/amd64/vmm/vcpu.c b/regress/sys/arch/amd64/vmm/vcpu.c index 84bd9492a..2c7287142 100644 --- a/regress/sys/arch/amd64/vmm/vcpu.c +++ b/regress/sys/arch/amd64/vmm/vcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vcpu.c,v 1.6 2023/05/13 23:15:28 dv Exp $ */ +/* $OpenBSD: vcpu.c,v 1.7 2024/04/09 21:55:16 dv Exp $ */ /* * Copyright (c) 2022 Dave Voutila @@ -34,43 +34,51 @@ #include #define KIB 1024 -#define MIB (1 << 20) +#define MIB (1UL << 20) +#define GIB (1024 * MIB) #define VMM_NODE "/dev/vmm" +#define LOW_MEM 0 +#define UPPER_MEM 1 + #define PCKBC_AUX 0x61 +#define PCJR_DISKCTRL 0xF0 const char *VM_NAME = "regress"; +const uint8_t PUSHW_DX[] = { 0x66, 0x52 }; // pushw %dx +const uint8_t INS[] = { 0x6C }; // ins es:[di],dx +const uint8_t IN_PCJR[] = { 0xE4, 0xF0 }; // in 0xF0 + /* Originally from vmd(8)'s vm.c */ const struct vcpu_reg_state vcpu_init_flat16 = { .vrs_gprs[VCPU_REGS_RFLAGS] = 0x2, .vrs_gprs[VCPU_REGS_RIP] = 0xFFF0, - .vrs_gprs[VCPU_REGS_RSP] = 0x0, + .vrs_gprs[VCPU_REGS_RDX] = PCKBC_AUX, /* Port used by INS */ + .vrs_gprs[VCPU_REGS_RSP] = 0x800, /* Set our stack in low mem. */ .vrs_crs[VCPU_REGS_CR0] = 0x60000010, - .vrs_crs[VCPU_REGS_CR3] = 0, - .vrs_sregs[VCPU_REGS_CS] = { 0xF000, 0xFFFF, 0x809F, 0xF0000}, - .vrs_sregs[VCPU_REGS_DS] = { 0x0, 0xFFFF, 0x8093, 0x0}, - .vrs_sregs[VCPU_REGS_ES] = { 0x0, 0xFFFF, 0x8093, 0x0}, - .vrs_sregs[VCPU_REGS_FS] = { 0x0, 0xFFFF, 0x8093, 0x0}, - .vrs_sregs[VCPU_REGS_GS] = { 0x0, 0xFFFF, 0x8093, 0x0}, - .vrs_sregs[VCPU_REGS_SS] = { 0x0, 0xFFFF, 0x8093, 0x0}, - .vrs_gdtr = { 0x0, 0xFFFF, 0x0, 0x0}, - .vrs_idtr = { 0x0, 0xFFFF, 0x0, 0x0}, + .vrs_sregs[VCPU_REGS_CS] = { 0xF000, 0xFFFF, 0x0093, 0xFFFF0000}, + .vrs_sregs[VCPU_REGS_DS] = { 0x0, 0xFFFF, 0x0093, 0x0}, + .vrs_sregs[VCPU_REGS_ES] = { 0x0, 0xFFFF, 0x0093, 0x0}, + .vrs_sregs[VCPU_REGS_FS] = { 0x0, 0xFFFF, 0x0093, 0x0}, + .vrs_sregs[VCPU_REGS_GS] = { 0x0, 0xFFFF, 0x0093, 0x0}, + .vrs_sregs[VCPU_REGS_SS] = { 0x0, 0xFFFF, 0x0093, 0x0}, + .vrs_gdtr = { 0x0, 0xFFFF, 0x0082, 0x0}, + .vrs_idtr = { 0x0, 0xFFFF, 0x0082, 0x0}, .vrs_sregs[VCPU_REGS_LDTR] = { 0x0, 0xFFFF, 0x0082, 0x0}, .vrs_sregs[VCPU_REGS_TR] = { 0x0, 0xFFFF, 0x008B, 0x0}, - .vrs_msrs[VCPU_REGS_EFER] = 0ULL, - .vrs_drs[VCPU_REGS_DR0] = 0x0, - .vrs_drs[VCPU_REGS_DR1] = 0x0, - .vrs_drs[VCPU_REGS_DR2] = 0x0, - .vrs_drs[VCPU_REGS_DR3] = 0x0, .vrs_drs[VCPU_REGS_DR6] = 0xFFFF0FF0, .vrs_drs[VCPU_REGS_DR7] = 0x400, - .vrs_msrs[VCPU_REGS_STAR] = 0ULL, - .vrs_msrs[VCPU_REGS_LSTAR] = 0ULL, - .vrs_msrs[VCPU_REGS_CSTAR] = 0ULL, - .vrs_msrs[VCPU_REGS_SFMASK] = 0ULL, - .vrs_msrs[VCPU_REGS_KGSBASE] = 0ULL, - .vrs_crs[VCPU_REGS_XCR0] = XFEATURE_X87 + .vrs_crs[VCPU_REGS_XCR0] = XFEATURE_X87, +}; + +struct intr_handler { + uint16_t offset; + uint16_t segment; +}; + +const struct intr_handler ivt[256] = { + [VMM_EX_GP] = { .segment = 0x0, .offset = 0x0B5D }, }; int @@ -87,7 +95,8 @@ main(int argc, char **argv) struct vm_mem_range *vmr; int fd, ret = 1; - size_t i, j; + size_t i; + off_t off, reset = 0xFFFFFFF0, stack = 0x800; void *p; fd = open(VMM_NODE, O_RDWR); @@ -95,7 +104,7 @@ main(int argc, char **argv) err(1, "open %s", VMM_NODE); /* - * 1. Create our VM with 1 vcpu and 2 MiB of memory. + * 1. Create our VM with 1 vcpu and 64 MiB of memory. */ memset(&vcp, 0, sizeof(vcp)); strlcpy(vcp.vcp_name, VM_NAME, sizeof(vcp.vcp_name)); @@ -103,34 +112,53 @@ main(int argc, char **argv) /* Split into two ranges, similar to how vmd(8) might do it. */ vcp.vcp_nmemranges = 2; - vcp.vcp_memranges[0].vmr_gpa = 0x0; - vcp.vcp_memranges[0].vmr_size = 640 * KIB; - vcp.vcp_memranges[1].vmr_gpa = 640 * KIB; - vcp.vcp_memranges[1].vmr_size = (2 * MIB) - (640 * KIB); + vcp.vcp_memranges[LOW_MEM].vmr_gpa = 0x0; + vcp.vcp_memranges[LOW_MEM].vmr_size = 640 * KIB; + vcp.vcp_memranges[UPPER_MEM].vmr_size = (64 * MIB) - (640 * KIB); + vcp.vcp_memranges[UPPER_MEM].vmr_gpa = (4 * GIB) + - vcp.vcp_memranges[UPPER_MEM].vmr_size; - /* Allocate memory. */ + /* Allocate and Initialize our guest memory. */ for (i = 0; i < vcp.vcp_nmemranges; i++) { vmr = &vcp.vcp_memranges[i]; + if (vmr->vmr_size % 2 != 0) + errx(1, "memory ranges must be multiple of 2"); + p = mmap(NULL, vmr->vmr_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); if (p == MAP_FAILED) err(1, "mmap"); - /* - * Fill with 2-byte IN instructions that read from what would - * be an ancient XT PC Keyboard status port. These reads will - * trigger vm exits. - */ - if (vmr->vmr_size % 2 != 0) - errx(1, "memory ranges must be multiple of 2"); - for (j = 0; j < vmr->vmr_size; j += 2) { - ((uint8_t*)p)[j + 0] = 0xE4; - ((uint8_t*)p)[j + 1] = PCKBC_AUX; - } vmr->vmr_va = (vaddr_t)p; printf("created mapped region %zu: { gpa: 0x%08lx, size: %lu," " hva: 0x%lx }\n", i, vmr->vmr_gpa, vmr->vmr_size, vmr->vmr_va); + + /* Fill with int3 instructions. */ + memset(p, 0xcc, vmr->vmr_size); + + if (i == LOW_MEM) { + /* Write our IVT. */ + memcpy(p, &ivt, sizeof(ivt)); + + /* + * Set up a #GP handler that does a read from a + * non-existent PC Jr. Disk Controller. + */ + p = (uint8_t*)((uint8_t*)p + 0xb5d); + memcpy(p, IN_PCJR, sizeof(IN_PCJR)); + } else { + /* + * Write our code to the reset vector: + * PUSHW %dx ; inits the stack + * INS dx, es:[di] ; read from port in dx + */ + off = reset - vmr->vmr_gpa; + p = (uint8_t*)p + off; + memcpy(p, PUSHW_DX, sizeof(PUSHW_DX)); + p = (uint8_t*)p + sizeof(PUSHW_DX); + memcpy(p, INS, sizeof(INS)); + } } if (ioctl(fd, VMM_IOC_CREATE, &vcp) == -1) @@ -172,11 +200,15 @@ main(int argc, char **argv) vmr = &vsp.vsp_memranges[i]; p = (void*)vmr->vmr_va; - for (j = 0; j < vmr->vmr_size; j += 2) { - if (((uint8_t*)p)[j + 0] != 0xE4) - errx(1, "bad byte"); - if (((uint8_t*)p)[j + 1] != PCKBC_AUX) - errx(1, "bad byte"); + if (i == LOW_MEM) { + /* Check if our IVT is there. */ + if (memcmp(&ivt, p, sizeof(ivt)) != 0) { + warnx("invalid ivt"); + goto out; + } + } else { + /* Check our code at the reset vector. */ + } printf("checked shared region %zu: { gpa: 0x%08lx, size: %lu," " hva: 0x%lx }\n", i, vmr->vmr_gpa, vmr->vmr_size, @@ -266,7 +298,6 @@ main(int argc, char **argv) vrunp.vrp_exit = exit; vrunp.vrp_vcpu_id = 0; /* XXX SP */ vrunp.vrp_vm_id = vcp.vcp_id; - vrunp.vrp_irq = 0x0; vrunp.vrp_irqready = 1; if (ioctl(fd, VMM_IOC_RUN, &vrunp) == -1) { @@ -283,8 +314,13 @@ main(int argc, char **argv) switch (vrunp.vrp_exit_reason) { case SVM_VMEXIT_IOIO: case VMX_EXIT_IO: - printf("vcpu %d on vm %d exited for io assist\n", - vrunp.vrp_vcpu_id, vrunp.vrp_vm_id); + printf("vcpu %d on vm %d exited for io assist @ ip = 0x%llx, " + "cs.base = 0x%llx, ss.base = 0x%llx, rsp = 0x%llx\n", + vrunp.vrp_vcpu_id, vrunp.vrp_vm_id, + vrunp.vrp_exit->vrs.vrs_gprs[VCPU_REGS_RIP], + vrunp.vrp_exit->vrs.vrs_sregs[VCPU_REGS_CS].vsi_base, + vrunp.vrp_exit->vrs.vrs_sregs[VCPU_REGS_SS].vsi_base, + vrunp.vrp_exit->vrs.vrs_gprs[VCPU_REGS_RSP]); break; default: warnx("unexpected vm exit reason: 0%04x", @@ -298,6 +334,49 @@ main(int argc, char **argv) exit->vei.vei_port); goto out; } + if (exit->vei.vei_string != 1) { + warnx("expected string instruction (INS)"); + goto out; + } else + printf("got expected string instruction\n"); + + /* Advance RIP? */ + printf("insn_len = %u\n", exit->vei.vei_insn_len); + exit->vrs.vrs_gprs[VCPU_REGS_RIP] += exit->vei.vei_insn_len; + + /* + * Inject a #GP and see if we end up at our isr. + */ + vrunp.vrp_inject.vie_vector = VMM_EX_GP; + vrunp.vrp_inject.vie_errorcode = 0x11223344; + vrunp.vrp_inject.vie_type = VCPU_INJECT_EX; + printf("injecting exception 0x%x\n", vrunp.vrp_inject.vie_vector); + if (ioctl(fd, VMM_IOC_RUN, &vrunp) == -1) { + warn("VMM_IOC_RUN 2"); + goto out; + } + + switch (vrunp.vrp_exit_reason) { + case SVM_VMEXIT_IOIO: + case VMX_EXIT_IO: + printf("vcpu %d on vm %d exited for io assist @ ip = 0x%llx, " + "cs.base = 0x%llx\n", vrunp.vrp_vcpu_id, vrunp.vrp_vm_id, + vrunp.vrp_exit->vrs.vrs_gprs[VCPU_REGS_RIP], + vrunp.vrp_exit->vrs.vrs_sregs[VCPU_REGS_CS].vsi_base); + break; + default: + warnx("unexpected vm exit reason: 0%04x", + vrunp.vrp_exit_reason); + goto out; + } + + if (exit->vei.vei_port != PCJR_DISKCTRL) { + warnx("expected NMI handler to poke PCJR_DISKCTLR, got 0x%02x", + exit->vei.vei_port); + printf("rip = 0x%llx\n", exit->vrs.vrs_gprs[VCPU_REGS_RIP]); + goto out; + } + printf("exception handler called\n"); /* * If we made it here, we're close to passing. Any failures during @@ -306,6 +385,22 @@ main(int argc, char **argv) ret = 0; out: + printf("--- RESET VECTOR @ gpa 0x%llx ---\n", reset); + for (i=0; i<10; i++) { + if (i > 0) + printf(" "); + printf("%02x", *(uint8_t*) + (vsp.vsp_memranges[UPPER_MEM].vmr_va + off + i)); + } + printf("\n--- STACK @ gpa 0x%llx ---\n", stack); + for (i=0; i<16; i++) { + if (i > 0) + printf(" "); + printf("%02x", *(uint8_t*)(vsp.vsp_memranges[LOW_MEM].vmr_va + + stack - i - 1)); + } + printf("\n"); + /* * 6. Terminate our VM and clean up. */ diff --git a/regress/usr.sbin/bgpd/config/Makefile b/regress/usr.sbin/bgpd/config/Makefile index 263b09f5d..97a69be6b 100644 --- a/regress/usr.sbin/bgpd/config/Makefile +++ b/regress/usr.sbin/bgpd/config/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.13 2023/04/12 09:09:41 claudio Exp $ +# $OpenBSD: Makefile,v 1.14 2024/04/09 09:33:46 claudio Exp $ -BGPDTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +BGPDTESTS=1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 .for n in ${BGPDTESTS} BGPD_TARGETS+=bgpd${n} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok index 07156ee40..286fc63c5 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.12.ok @@ -14,6 +14,7 @@ neighbor 127.0.0.2 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 127.0.0.3 { remote-as 3 @@ -21,10 +22,12 @@ neighbor 127.0.0.3 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 127.0.0.4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok index b3df41178..e59372685 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.13.ok @@ -13,18 +13,21 @@ neighbor 2001:db8:abcd::7 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.5 { remote-as 5 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::5 { remote-as 5 enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.6 { remote-as 6 @@ -33,6 +36,7 @@ neighbor 192.0.2.6 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::6 { remote-as 6 @@ -41,12 +45,14 @@ neighbor 2001:db8:abcd::6 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.7 { remote-as 7 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } group "TEST" { neighbor 192.0.2.2 { @@ -56,6 +62,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::2 { remote-as 2 @@ -64,6 +71,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.3 { remote-as 3 @@ -72,6 +80,7 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::3 { remote-as 3 @@ -80,18 +89,21 @@ group "TEST" { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } neighbor 192.0.2.4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 2001:db8:abcd::4 { remote-as 4 enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok index f09bc9d3d..54db40810 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.15.ok @@ -15,6 +15,7 @@ neighbor 192.0.2.1 { announce IPv4 unicast announce IPv4 vpn announce IPv4 flowspec + announce policy no } neighbor 2001:db8::1 { remote-as 64496 @@ -23,4 +24,5 @@ neighbor 2001:db8::1 { announce IPv6 unicast announce IPv6 vpn announce IPv6 flowspec + announce policy no } diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.16.in b/regress/usr.sbin/bgpd/config/bgpd.conf.16.in new file mode 100644 index 000000000..9ad5de3d2 --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.16.in @@ -0,0 +1,59 @@ +# $OpenBSD: bgpd.conf.16.in,v 1.1 2024/04/09 09:33:46 claudio Exp $ +# test announce statements + +AS 1 + +neighbor 192.0.2.1 { + remote-as 64496 + role peer + + announce inet unicast + announce inet vpn + announce inet flowspec + announce inet6 unicast + announce inet6 vpn + announce inet6 flowspec + + announce add-path recv yes + announce add-path send all + + announce as-4byte yes + announce enhanced refresh yes + announce policy yes + announce refresh yes + announce restart yes +} + +neighbor 192.0.2.2 { + remote-as 64496 + role peer + + announce inet none + announce inet6 none + + announce add-path recv no + announce add-path send no + + announce as-4byte no + announce enhanced refresh no + announce policy no + announce refresh no + announce restart no +} + +neighbor 192.0.2.3 { + remote-as 64496 + role peer + + announce inet unicast enforce + announce inet6 unicast enforce + + announce add-path recv enforce + announce add-path send best plus 3 enforce + + announce as-4byte enforce + announce enhanced refresh enforce + announce policy enforce + announce refresh enforce + announce restart enforce +} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok new file mode 100644 index 000000000..43f3041ac --- /dev/null +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.16.ok @@ -0,0 +1,53 @@ +AS 1 +router-id 127.0.0.1 +socket "/var/run/bgpd.sock.0" +listen on 0.0.0.0 +listen on :: + + +rde rib Adj-RIB-In no evaluate +rde rib Loc-RIB rtable 0 fib-update yes + +neighbor 192.0.2.1 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 unicast + announce IPv6 unicast + announce IPv4 vpn + announce IPv6 vpn + announce IPv4 flowspec + announce IPv6 flowspec + announce enhanced refresh yes + announce add-path recv yes + announce add-path send all + announce policy yes +} +neighbor 192.0.2.2 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 none + announce IPv6 none + announce refresh no + announce restart no + announce as4byte no + announce policy no +} +neighbor 192.0.2.3 { + remote-as 64496 + role peer + enforce neighbor-as yes + enforce local-as yes + announce IPv4 unicast enforce + announce IPv6 unicast enforce + announce refresh enforce + announce enhanced refresh enforce + announce restart enforce + announce as4byte enforce + announce add-path recv enforce + announce add-path send best plus 3 enforce + announce policy enforce +} diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok index 4478a03c8..62566aa05 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.3.ok @@ -18,6 +18,7 @@ neighbor 2001:db8::1 { enforce neighbor-as yes enforce local-as yes announce IPv6 unicast + announce policy no } allow from 2001:db8::1 prefix 2001:db8:300::/64 allow from 2001:db8::1 prefix 2001:db8:200::/64 diff --git a/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok b/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok index 674ba486b..3d597dae6 100644 --- a/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok +++ b/regress/usr.sbin/bgpd/config/bgpd.conf.4.ok @@ -13,12 +13,14 @@ neighbor 192.0.2.1 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.2 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.3 { descr "test-peer" @@ -26,6 +28,7 @@ neighbor 192.0.2.3 { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } group "testing" { neighbor 192.0.2.7 { @@ -33,12 +36,14 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.8 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.6 { descr "test2-peer" @@ -46,12 +51,14 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.4 { remote-as 64496 enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.5 { descr "test2-peer" @@ -59,6 +66,7 @@ group "testing" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } } @@ -68,6 +76,7 @@ group "test2" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } neighbor 192.0.2.11 { descr "test3-peer" @@ -75,6 +84,7 @@ group "test2" { enforce neighbor-as yes enforce local-as yes announce IPv4 unicast + announce policy no } } diff --git a/regress/usr.sbin/bgpd/integrationtests/Makefile b/regress/usr.sbin/bgpd/integrationtests/Makefile index 10e36ac40..5208dc2d2 100644 --- a/regress/usr.sbin/bgpd/integrationtests/Makefile +++ b/regress/usr.sbin/bgpd/integrationtests/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.23 2023/10/16 10:26:51 claudio Exp $ +# $OpenBSD: Makefile,v 1.24 2024/04/09 09:35:57 claudio Exp $ -REGRESS_TARGETS = network_statement md5 ovs policy pftable \ +REGRESS_TARGETS = network_statement md5 ovs capa policy pftable \ mrt maxprefix maxprefixout maxcomm l3vpn \ ixp lladdr \ as0 med eval_all attr @@ -21,6 +21,9 @@ md5: ovs: ${SUDO} ksh ${.CURDIR}/$@.sh ${BGPD} ${.CURDIR} 11 12 pair11 pair12 +capa: + ${SUDO} ksh ${.CURDIR}/$@.sh ${BGPD} ${.CURDIR} 11 12 pair11 pair12 + policy: ${SUDO} ksh ${.CURDIR}/$@.sh ${BGPD} ${.CURDIR} 11 12 pair11 pair12 diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.client.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.client.conf new file mode 100644 index 000000000..ed8421fd6 --- /dev/null +++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.client.conf @@ -0,0 +1,20 @@ +AS 65001 + +IP=10.12.57.$NUM + +router-id $IP +listen on $IP +fib-update no + +socket $SOCK + +neighbor 10.12.57.254 { + remote-as 65000 + local-address $IP + descr "MASTER" + + announce $CAPA +} + +allow from any +allow to any diff --git a/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.master.conf b/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.master.conf new file mode 100644 index 000000000..9d2a14ab9 --- /dev/null +++ b/regress/usr.sbin/bgpd/integrationtests/bgpd.capa.master.conf @@ -0,0 +1,40 @@ +AS 65000 +router-id 10.12.57.254 +listen on 10.12.57.254 +fib-update no + +# announce policy tested in own regress test + +group TEST { + remote-as 65001 + local-address 10.12.57.254 + + neighbor 10.12.57.1 { + descr "PEER1" + announce as-4byte enforce + } + neighbor 10.12.57.2 { + descr "PEER2" + announce enhanced refresh enforce + } + neighbor 10.12.57.3 { + descr "PEER3" + announce refresh enforce + } + neighbor 10.12.57.4 { + descr "PEER4" + announce restart enforce + } + neighbor 10.12.57.5 { + descr "PEER5" + announce inet vpn enforce + } + neighbor 10.12.57.6 { + descr "PEER6" + announce add-path recv enforce + } + neighbor 10.12.57.7 { + descr "PEER7" + announce add-path send best plus 3 enforce + } +} diff --git a/regress/usr.sbin/bgpd/integrationtests/capa.sh b/regress/usr.sbin/bgpd/integrationtests/capa.sh new file mode 100644 index 000000000..f861c9b5f --- /dev/null +++ b/regress/usr.sbin/bgpd/integrationtests/capa.sh @@ -0,0 +1,140 @@ +#!/bin/ksh +# $OpenBSD: capa.sh,v 1.1 2024/04/09 09:35:57 claudio Exp $ + +set -e + +BGPD=$1 +BGPDCONFIGDIR=$2 +RDOMAIN1=$3 +RDOMAIN2=$4 +PAIR1=$5 +PAIR2=$6 + +RDOMAINS="${RDOMAIN1} ${RDOMAIN2}" +PAIRS="${PAIR1} ${PAIR2}" +PAIR1IP=10.12.57.254 +PAIR2IP1=10.12.57.1 +PAIR2IP2=10.12.57.2 +PAIR2IP3=10.12.57.3 +PAIR2IP4=10.12.57.4 +PAIR2IP5=10.12.57.5 +PAIR2IP6=10.12.57.6 +PAIR2IP7=10.12.57.7 + +error_notify() { + echo cleanup + pkill -T ${RDOMAIN1} bgpd || true + pkill -T ${RDOMAIN2} bgpd || true + sleep 1 + ifconfig ${PAIR2} destroy || true + ifconfig ${PAIR1} destroy || true + route -qn -T ${RDOMAIN1} flush || true + route -qn -T ${RDOMAIN2} flush || true + ifconfig lo${RDOMAIN1} destroy || true + ifconfig lo${RDOMAIN2} destroy || true + if [ $1 -ne 0 ]; then + echo FAILED + exit 1 + else + echo SUCCESS + fi +} + +test_bgpd() { + + local e=$1 + local p=$2 + + case $p in + no) + local mpopt=none + local apopt=no + ;; + yes) + local mpopt=vpn + local apopt="best max 3" + ;; + enforce) + local mpopt="vpn enforce" + local apopt="best max 3 enforce" + ;; + esac + + set -A CAPA "as-4byte $p" \ + "enhanced refresh $p" \ + "refresh $p" "restart $p" \ + "inet $mpopt" \ + "add-path send $apopt" \ + "add-path recv $p" + + set -x + + route -T ${RDOMAIN1} exec ${BGPD} \ + -v -f ${BGPDCONFIGDIR}/bgpd.capa.master.conf + + for i in 1 2 3 4 5 6 7; do + route -T ${RDOMAIN2} exec ${BGPD} -DNUM=$i \ + -DCAPA="${CAPA[$(($i - 1))]}" \ + -DSOCK=\"/var/run/bgpd.sock.c$i\" \ + -v -f ${BGPDCONFIGDIR}/bgpd.capa.client.conf + done + + sleep 1 + route -T ${RDOMAIN1} exec bgpctl nei group TEST up + sleep 1 + + for i in 1 2 3 4 5 6 7; do + route -T ${RDOMAIN1} exec bgpctl show nei PEER$i | \ + grep "$e" + done + + pkill -T ${RDOMAIN1} bgpd || true + pkill -T ${RDOMAIN2} bgpd || true + + sleep 1 +} + +if [ "$(id -u)" -ne 0 ]; then + echo need root privileges >&2 + exit 1 +fi + +trap 'error_notify $?' EXIT + +echo check if rdomains are busy +for n in ${RDOMAINS}; do + if /sbin/ifconfig | grep -v "^lo${n}:" | grep " rdomain ${n} "; then + echo routing domain ${n} is already used >&2 + exit 1 + fi +done + +echo check if interfaces are busy +for n in ${PAIRS}; do + /sbin/ifconfig "${n}" >/dev/null 2>&1 && \ + ( echo interface ${n} is already used >&2; exit 1 ) +done + +set -x + +echo setup +ifconfig ${PAIR1} rdomain ${RDOMAIN1} ${PAIR1IP}/24 up +ifconfig ${PAIR2} rdomain ${RDOMAIN2} ${PAIR2IP1}/24 up +ifconfig ${PAIR2} alias ${PAIR2IP2}/32 up +ifconfig ${PAIR2} alias ${PAIR2IP3}/32 up +ifconfig ${PAIR2} alias ${PAIR2IP4}/32 up +ifconfig ${PAIR2} alias ${PAIR2IP5}/32 up +ifconfig ${PAIR2} alias ${PAIR2IP6}/32 up +ifconfig ${PAIR2} alias ${PAIR2IP7}/32 up +ifconfig ${PAIR1} patch ${PAIR2} +ifconfig lo${RDOMAIN1} inet 127.0.0.1/8 +ifconfig lo${RDOMAIN2} inet 127.0.0.1/8 + +echo test1: no capability +test_bgpd "Last error sent: error in OPEN message, unsupported capability" "no" + +echo test2: ok capability +test_bgpd "BGP state = Established, up" "yes" + +echo test3: enforce capability +test_bgpd "BGP state = Established, up" "enforce" diff --git a/sbin/iked/proc.c b/sbin/iked/proc.c index 186799182..337063f76 100644 --- a/sbin/iked/proc.c +++ b/sbin/iked/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.43 2024/04/08 12:50:05 tobhe Exp $ */ +/* $OpenBSD: proc.c,v 1.44 2024/04/09 15:48:01 tobhe Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter @@ -39,7 +39,7 @@ enum privsep_procid privsep_process; void proc_exec(struct privsep *, struct privsep_proc *, unsigned int, int, - int, char **); + char **); void proc_setup(struct privsep *, struct privsep_proc *, unsigned int); void proc_open(struct privsep *, int, int); void proc_accept(struct privsep *, int, enum privsep_procid, @@ -70,7 +70,7 @@ proc_getid(struct privsep_proc *procs, unsigned int nproc, void proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, - int debug, int argc, char **argv) + int argc, char **argv) { unsigned int proc, nargc, i, proc_i; char **nargv; @@ -119,10 +119,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, fatal("%s: fork", __func__); break; case 0: - /* First create a new session */ - if (setsid() == -1) - fatal("setsid"); - /* Prepare parent socket. */ if (fd != PROC_PARENT_SOCK_FILENO) { if (dup2(fd, PROC_PARENT_SOCK_FILENO) @@ -131,16 +127,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } else if (fcntl(fd, F_SETFD, 0) == -1) fatal("fcntl"); - /* Daemons detach from terminal. */ - if (!debug && (fd = - open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { - (void)dup2(fd, STDIN_FILENO); - (void)dup2(fd, STDOUT_FILENO); - (void)dup2(fd, STDERR_FILENO); - if (fd > 2) - (void)close(fd); - } - execvp(argv[0], nargv); fatal("%s: execvp", __func__); break; @@ -260,7 +246,7 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } /* Engage! */ - proc_exec(ps, procs, nproc, debug, argc, argv); + proc_exec(ps, procs, nproc, argc, argv); return; } @@ -546,9 +532,6 @@ proc_run(struct privsep *ps, struct privsep_proc *p, log_procinit(p->p_title); - /* Set the process group of the current process */ - setpgid(0, 0); - if (p->p_id == PROC_CONTROL && ps->ps_instance == 0) { if (control_init(ps, &ps->ps_csock) == -1) fatalx("%s: control_init", __func__); diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 7472cdb21..4749ed365 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: acpi.4,v 1.73 2023/12/11 15:21:14 jmc Exp $ +.\" $OpenBSD: acpi.4,v 1.74 2024/04/09 20:18:37 mglocker Exp $ .\" .\" Copyright (c) 2006 Alexander Yurchenko .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 11 2023 $ +.Dd $Mdocdate: April 9 2024 $ .Dt ACPI 4 .Os .Sh NAME @@ -94,6 +94,8 @@ ACPI thermal zone ACPI video .It Xr acpivout 4 ACPI video output +.It Xr ahci 4 +Advanced Host Controller Interface for Serial ATA .It Xr aibs 4 ASUSTeK AI Booster ACPI ATK0110 temperature, voltage, and fan sensor .It Xr amdgpio 4 diff --git a/share/man/man4/pci.4 b/share/man/man4/pci.4 index 051663987..c1a7b2672 100644 --- a/share/man/man4/pci.4 +++ b/share/man/man4/pci.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pci.4,v 1.405 2024/02/15 15:42:16 jmc Exp $ +.\" $OpenBSD: pci.4,v 1.406 2024/04/09 20:18:37 mglocker Exp $ .\" $NetBSD: pci.4,v 1.29 2000/04/01 00:32:23 tsarna Exp $ .\" .\" Copyright (c) 2000 Theo de Raadt. All rights reserved. @@ -31,7 +31,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: February 15 2024 $ +.Dd $Mdocdate: April 9 2024 $ .Dt PCI 4 .Os .Sh NAME @@ -135,6 +135,8 @@ QLogic ISP1000/1020/1x40/1x80/1x160 SCSI controller LSI/Symbios Logic/NCR 53c8xx SCSI interface .It Xr trm 4 TRM-S1040 based PCI SCSI interface +.It Xr ufshci 4 +Universal Flash Storage Host Controller Interface .It Xr vmwpvs 4 VMware Paravirtual SCSI .El diff --git a/share/man/man4/ufshci.4 b/share/man/man4/ufshci.4 index 12f3fa0b8..969cb4f72 100644 --- a/share/man/man4/ufshci.4 +++ b/share/man/man4/ufshci.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ufshci.4,v 1.1 2023/02/04 23:11:59 mglocker Exp $ +.\" $OpenBSD: ufshci.4,v 1.2 2024/04/09 14:58:41 mglocker Exp $ .\" .\" Copyright (c) 2023 Marcus Glocker .\" @@ -15,7 +15,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" -.Dd $Mdocdate: February 4 2023 $ +.Dd $Mdocdate: April 9 2024 $ .Dt UFSHCI 4 .Os .Sh NAME @@ -23,6 +23,7 @@ .Nd Universal Flash Storage Host Controller Interface .Sh SYNOPSIS .Cd "ufshci* at acpi?" +.Cd "ufshci* at pci?" .Sh DESCRIPTION The .Nm diff --git a/sys/arch/amd64/amd64/vmm_machdep.c b/sys/arch/amd64/amd64/vmm_machdep.c index 55c775c65..02f2c3cb6 100644 --- a/sys/arch/amd64/amd64/vmm_machdep.c +++ b/sys/arch/amd64/amd64/vmm_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm_machdep.c,v 1.22 2024/04/01 05:11:49 guenther Exp $ */ +/* $OpenBSD: vmm_machdep.c,v 1.23 2024/04/09 21:55:16 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -3694,6 +3694,10 @@ vm_run(struct vm_run_params *vrp) } } + vcpu->vc_inject.vie_type = vrp->vrp_inject.vie_type; + vcpu->vc_inject.vie_vector = vrp->vrp_inject.vie_vector; + vcpu->vc_inject.vie_errorcode = vrp->vrp_inject.vie_errorcode; + WRITE_ONCE(vcpu->vc_curcpu, curcpu()); /* Run the VCPU specified in vrp */ if (vcpu->vc_virt_mode == VMM_MODE_EPT) { @@ -3966,8 +3970,7 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) struct schedstate_percpu *spc; struct vmx_msr_store *msr_store; struct vmx_invvpid_descriptor vid; - uint64_t eii, procbased, int_st; - uint16_t irq; + uint64_t cr0, eii, procbased, int_st; u_long s; rw_assert_wrlock(&vcpu->vc_lock); @@ -3983,8 +3986,6 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) * needs to be fixed up depends on what vmd populated in the * exit data structure. */ - irq = vrp->vrp_irq; - if (vrp->vrp_intr_pending) vcpu->vc_intr = 1; else @@ -4062,7 +4063,7 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) /* Handle vmd(8) injected interrupts */ /* Is there an interrupt pending injection? */ - if (irq != 0xFFFF) { + if (vcpu->vc_inject.vie_type == VCPU_INJECT_INTR) { if (vmread(VMCS_GUEST_INTERRUPTIBILITY_ST, &int_st)) { printf("%s: can't get interruptibility state\n", __func__); @@ -4071,16 +4072,15 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) /* Interruptibility state 0x3 covers NMIs and STI */ if (!(int_st & 0x3) && vcpu->vc_irqready) { - eii = (irq & 0xFF); + eii = (uint64_t)vcpu->vc_inject.vie_vector; eii |= (1ULL << 31); /* Valid */ - eii |= (0ULL << 8); /* Hardware Interrupt */ if (vmwrite(VMCS_ENTRY_INTERRUPTION_INFO, eii)) { printf("vcpu_run_vmx: can't vector " "interrupt to guest\n"); return (EINVAL); } - irq = 0xFFFF; + vcpu->vc_inject.vie_type = VCPU_INJECT_NONE; } } else if (!vcpu->vc_intr) { /* @@ -4159,38 +4159,65 @@ vcpu_run_vmx(struct vcpu *vcpu, struct vm_run_params *vrp) } /* Inject event if present */ - if (vcpu->vc_event != 0) { - eii = (vcpu->vc_event & 0xFF); + if (vcpu->vc_inject.vie_type == VCPU_INJECT_EX) { + eii = (uint64_t)vcpu->vc_inject.vie_vector; eii |= (1ULL << 31); /* Valid */ - /* Set the "Send error code" flag for certain vectors */ - switch (vcpu->vc_event & 0xFF) { - case VMM_EX_DF: - case VMM_EX_TS: - case VMM_EX_NP: - case VMM_EX_SS: - case VMM_EX_GP: - case VMM_EX_PF: - case VMM_EX_AC: - eii |= (1ULL << 11); - } + switch (vcpu->vc_inject.vie_vector) { + case VMM_EX_BP: + case VMM_EX_OF: + /* Software Exceptions */ + eii |= (4ULL << 8); + break; + case VMM_EX_DF: + case VMM_EX_TS: + case VMM_EX_NP: + case VMM_EX_SS: + case VMM_EX_GP: + case VMM_EX_PF: + case VMM_EX_AC: + /* Hardware Exceptions */ + eii |= (3ULL << 8); + cr0 = 0; + if (vmread(VMCS_GUEST_IA32_CR0, &cr0)) { + printf("%s: vmread(VMCS_GUEST_IA32_CR0)" + "\n", __func__); + ret = EINVAL; + break; + } + + /* Don't set error codes if in real mode. */ + if (ret == EINVAL || !(cr0 & CR0_PE)) + break; + eii |= (1ULL << 11); + + /* Enforce a 0 error code for #AC. */ + if (vcpu->vc_inject.vie_vector == VMM_EX_AC) + vcpu->vc_inject.vie_errorcode = 0; + /* + * XXX: Intel SDM says if IA32_VMX_BASIC[56] is + * set, error codes can be injected for hw + * exceptions with or without error code, + * regardless of vector. See Vol 3D. A1. Ignore + * this capability for now. + */ + if (vmwrite(VMCS_ENTRY_EXCEPTION_ERROR_CODE, + vcpu->vc_inject.vie_errorcode)) { + printf("%s: can't write error code to " + "guest\n", __func__); + ret = EINVAL; + } + } /* switch */ + if (ret == EINVAL) + break; - eii |= (3ULL << 8); /* Hardware Exception */ if (vmwrite(VMCS_ENTRY_INTERRUPTION_INFO, eii)) { printf("%s: can't vector event to guest\n", __func__); ret = EINVAL; break; } - - if (vmwrite(VMCS_ENTRY_EXCEPTION_ERROR_CODE, 0)) { - printf("%s: can't write error code to guest\n", - __func__); - ret = EINVAL; - break; - } - - vcpu->vc_event = 0; + vcpu->vc_inject.vie_type = VCPU_INJECT_NONE; } if (vcpu->vc_vmx_vpid_enabled) { @@ -4771,7 +4798,9 @@ vmm_inject_gp(struct vcpu *vcpu) { DPRINTF("%s: injecting #GP at guest %%rip 0x%llx\n", __func__, vcpu->vc_gueststate.vg_rip); - vcpu->vc_event = VMM_EX_GP; + vcpu->vc_inject.vie_vector = VMM_EX_GP; + vcpu->vc_inject.vie_type = VCPU_INJECT_EX; + vcpu->vc_inject.vie_errorcode = 0; return (0); } @@ -4792,7 +4821,9 @@ vmm_inject_ud(struct vcpu *vcpu) { DPRINTF("%s: injecting #UD at guest %%rip 0x%llx\n", __func__, vcpu->vc_gueststate.vg_rip); - vcpu->vc_event = VMM_EX_UD; + vcpu->vc_inject.vie_vector = VMM_EX_UD; + vcpu->vc_inject.vie_type = VCPU_INJECT_EX; + vcpu->vc_inject.vie_errorcode = 0; return (0); } @@ -4813,7 +4844,9 @@ vmm_inject_db(struct vcpu *vcpu) { DPRINTF("%s: injecting #DB at guest %%rip 0x%llx\n", __func__, vcpu->vc_gueststate.vg_rip); - vcpu->vc_event = VMM_EX_DB; + vcpu->vc_inject.vie_vector = VMM_EX_DB; + vcpu->vc_inject.vie_type = VCPU_INJECT_EX; + vcpu->vc_inject.vie_errorcode = 0; return (0); } @@ -6463,11 +6496,8 @@ vcpu_run_svm(struct vcpu *vcpu, struct vm_run_params *vrp) struct cpu_info *ci = NULL; uint64_t exit_reason; struct schedstate_percpu *spc; - uint16_t irq; struct vmcb *vmcb = (struct vmcb *)vcpu->vc_control_va; - irq = vrp->vrp_irq; - if (vrp->vrp_intr_pending) vcpu->vc_intr = 1; else @@ -6541,30 +6571,58 @@ vcpu_run_svm(struct vcpu *vcpu, struct vm_run_params *vrp) /* Handle vmd(8) injected interrupts */ /* Is there an interrupt pending injection? */ - if (irq != 0xFFFF && vcpu->vc_irqready) { - vmcb->v_eventinj = (irq & 0xFF) | (1U << 31); - irq = 0xFFFF; + if (vcpu->vc_inject.vie_type == VCPU_INJECT_INTR && + vcpu->vc_irqready) { + vmcb->v_eventinj = vcpu->vc_inject.vie_vector | + (1U << 31); + vcpu->vc_inject.vie_type = VCPU_INJECT_NONE; } /* Inject event if present */ - if (vcpu->vc_event != 0) { - DPRINTF("%s: inject event %d\n", __func__, - vcpu->vc_event); - vmcb->v_eventinj = 0; + if (vcpu->vc_inject.vie_type == VCPU_INJECT_EX) { + vmcb->v_eventinj = vcpu->vc_inject.vie_vector; + /* Set the "Event Valid" flag for certain vectors */ - switch (vcpu->vc_event & 0xFF) { - case VMM_EX_DF: - case VMM_EX_TS: - case VMM_EX_NP: - case VMM_EX_SS: - case VMM_EX_GP: - case VMM_EX_PF: - case VMM_EX_AC: + switch (vcpu->vc_inject.vie_vector) { + case VMM_EX_BP: + case VMM_EX_OF: + case VMM_EX_DB: + /* + * Software exception. + * XXX check nRIP support. + */ + vmcb->v_eventinj |= (4ULL << 8); + break; + case VMM_EX_AC: + vcpu->vc_inject.vie_errorcode = 0; + /* fallthrough */ + case VMM_EX_DF: + case VMM_EX_TS: + case VMM_EX_NP: + case VMM_EX_SS: + case VMM_EX_GP: + case VMM_EX_PF: + /* Hardware exception. */ + vmcb->v_eventinj |= (3ULL << 8); + + if (vmcb->v_cr0 & CR0_PE) { + /* Error code valid. */ vmcb->v_eventinj |= (1ULL << 11); - } - vmcb->v_eventinj |= (vcpu->vc_event) | (1U << 31); - vmcb->v_eventinj |= (3ULL << 8); /* Exception */ - vcpu->vc_event = 0; + vmcb->v_eventinj |= (uint64_t) + vcpu->vc_inject.vie_errorcode << 32; + } + break; + default: + printf("%s: unsupported exception vector %u\n", + __func__, vcpu->vc_inject.vie_vector); + ret = EINVAL; + } /* switch */ + if (ret == EINVAL) + break; + + /* Event is valid. */ + vmcb->v_eventinj |= (1U << 31); + vcpu->vc_inject.vie_type = VCPU_INJECT_NONE; } TRACEPOINT(vmm, guest_enter, vcpu, vrp); diff --git a/sys/arch/amd64/include/vmmvar.h b/sys/arch/amd64/include/vmmvar.h index 82aa105d3..05567f5be 100644 --- a/sys/arch/amd64/include/vmmvar.h +++ b/sys/arch/amd64/include/vmmvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmvar.h,v 1.99 2024/04/01 05:11:49 guenther Exp $ */ +/* $OpenBSD: vmmvar.h,v 1.100 2024/04/09 21:55:16 dv Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -340,6 +340,7 @@ struct vm_exit_inout { uint32_t vei_data; /* data */ uint8_t vei_insn_len; /* Count of instruction bytes */ }; + /* * vm_exit_eptviolation : describes an EPT VIOLATION exit */ @@ -352,6 +353,19 @@ struct vm_exit_eptviolation { uint8_t vee_insn_bytes[15]; /* [SVM] bytes at {R,E,}IP */ }; +/* + * struct vcpu_inject_event : describes an exception or interrupt to inject. + */ +struct vcpu_inject_event { + uint8_t vie_vector; /* Exception or interrupt vector. */ + uint32_t vie_errorcode; /* Optional error code. */ + uint8_t vie_type; +#define VCPU_INJECT_NONE 0 +#define VCPU_INJECT_INTR 1 /* External hardware interrupt. */ +#define VCPU_INJECT_EX 2 /* HW or SW Exception */ +#define VCPU_INJECT_NMI 3 /* Non-maskable Interrupt */ +}; + /* * struct vcpu_segment_info * @@ -465,7 +479,7 @@ struct vm_run_params { uint32_t vrp_vm_id; uint32_t vrp_vcpu_id; uint8_t vrp_continue; /* Continuing from an exit */ - uint16_t vrp_irq; /* IRQ to inject */ + struct vcpu_inject_event vrp_inject; uint8_t vrp_intr_pending; /* Additional intrs pending? */ /* Input/output parameter to VMM_IOC_RUN */ @@ -873,8 +887,7 @@ struct vcpu { uint64_t vc_h_xcr0; /* [v] */ struct vcpu_gueststate vc_gueststate; /* [v] */ - - uint8_t vc_event; + struct vcpu_inject_event vc_inject; /* [v] */ uint32_t vc_pvclock_version; /* [v] */ paddr_t vc_pvclock_system_gpa; /* [v] */ diff --git a/sys/conf/files b/sys/conf/files index fd76e9934..93392b223 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.730 2024/02/03 18:51:57 beck Exp $ +# $OpenBSD: files,v 1.731 2024/04/10 13:59:05 naddy Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -1081,8 +1081,6 @@ file lib/libkern/arch/${MACHINE_ARCH}/strnlen.S | lib/libkern/strnlen.c file lib/libkern/arch/${MACHINE_ARCH}/strnstr.S | lib/libkern/strnstr.c file lib/libkern/arch/${MACHINE_ARCH}/scanc.S | lib/libkern/scanc.c file lib/libkern/arch/${MACHINE_ARCH}/skpc.S | lib/libkern/skpc.c -file lib/libkern/arch/${MACHINE_ARCH}/htonl.S | lib/libkern/htonl.c -file lib/libkern/arch/${MACHINE_ARCH}/htons.S | lib/libkern/htons.c file lib/libkern/arch/${MACHINE_ARCH}/strncasecmp.S | lib/libkern/strncasecmp.c file lib/libz/adler32.c ppp_deflate | ipsec | crypto | ddb | diff --git a/sys/dev/pci/drm/i915/display/intel_fbdev.c b/sys/dev/pci/drm/i915/display/intel_fbdev.c index 3a5fa7c99..1a499f2c6 100644 --- a/sys/dev/pci/drm/i915/display/intel_fbdev.c +++ b/sys/dev/pci/drm/i915/display/intel_fbdev.c @@ -288,7 +288,6 @@ static int intelfb_create(struct drm_fb_helper *helper, info->fbops = &intelfb_ops; -#ifdef __linux__ obj = intel_fb_obj(&intel_fb->base); if (i915_gem_object_is_lmem(obj)) { struct intel_memory_region *mem = obj->mm.region; @@ -336,21 +335,18 @@ static int intelfb_create(struct drm_fb_helper *helper, memset_io(info->screen_base, 0, info->screen_size); /* Use default scratch pixmap (info->pixmap.flags = FB_PIXMAP_SYSTEM) */ -#else + + drm_dbg_kms(&dev_priv->drm, "allocated %dx%d fb: 0x%08x\n", + ifbdev->fb->base.width, ifbdev->fb->base.height, + i915_ggtt_offset(vma)); + ifbdev->vma = vma; + ifbdev->vma_flags = flags; + + intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); + vga_switcheroo_client_fb_set(pdev, info); { struct drm_framebuffer *fb = ifbdev->helper.fb; struct rasops_info *ri = &dev_priv->ro; - bus_space_handle_t bsh; - int err; - - vaddr = i915_vma_pin_iomap(vma); - if (IS_ERR(vaddr)) { - DRM_ERROR("Failed to remap framebuffer into virtual memory\n"); - ret = PTR_ERR(vaddr); - goto out_unpin; - } - - drm_fb_helper_fill_info(info, &ifbdev->helper, sizes); ri->ri_bits = vaddr; ri->ri_depth = fb->format->cpp[0] * 8; @@ -376,20 +372,7 @@ static int intelfb_create(struct drm_fb_helper *helper, ri->ri_bpos = 0; break; } - - if (vma->obj->stolen && !prealloc) - memset(ri->ri_bits, 0, vma->node.size); } -#endif - - drm_dbg_kms(&dev_priv->drm, "allocated %dx%d fb: 0x%08x\n", - ifbdev->fb->base.width, ifbdev->fb->base.height, - i915_ggtt_offset(vma)); - ifbdev->vma = vma; - ifbdev->vma_flags = flags; - - intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); - vga_switcheroo_client_fb_set(pdev, info); return 0; out_unpin: diff --git a/sys/dev/pci/files.pci b/sys/dev/pci/files.pci index 4709015e6..a0d7d4058 100644 --- a/sys/dev/pci/files.pci +++ b/sys/dev/pci/files.pci @@ -1,4 +1,4 @@ -# $OpenBSD: files.pci,v 1.364 2024/02/21 10:48:10 claudio Exp $ +# $OpenBSD: files.pci,v 1.365 2024/04/09 14:58:41 mglocker Exp $ # $NetBSD: files.pci,v 1.20 1996/09/24 17:47:15 christos Exp $ # # Config file and device description for machine-independent PCI code. @@ -872,5 +872,9 @@ device mwx: ifnet, wlan, firmload attach mwx at pci file dev/pci/if_mwx.c mwx +# UFS HC +attach ufshci at pci with ufshci_pci +file dev/pci/ufshci_pci.c ufshci_pci + include "dev/pci/files.agp" include "dev/pci/drm/files.drm" diff --git a/sys/dev/pci/ufshci_pci.c b/sys/dev/pci/ufshci_pci.c new file mode 100644 index 000000000..e5e6c9859 --- /dev/null +++ b/sys/dev/pci/ufshci_pci.c @@ -0,0 +1,109 @@ +/* $OpenBSD: ufshci_pci.c,v 1.2 2024/04/10 10:40:27 mglocker Exp $ */ + +/* + * Copyright (c) 2024 Marcus Glocker + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#define UFSHCI_PCI_BAR 0x10 +#define UFSHCI_PCI_INTERFACE 0x01 + +struct ufshci_pci_softc { + struct ufshci_softc psc_ufshci; + + pci_chipset_tag_t psc_pc; + void *psc_ih; +}; + +int ufshci_pci_match(struct device *, void *, void *); +void ufshci_pci_attach(struct device *, struct device *, void *); +int ufshci_pci_detach(struct device *, int); +int ufshci_pci_activate(struct device *, int); + +const struct cfattach ufshci_pci_ca = { + sizeof(struct ufshci_pci_softc), + ufshci_pci_match, + ufshci_pci_attach, + ufshci_pci_detach +}; + +int +ufshci_pci_match(struct device *parent, void *match, void *aux) +{ + struct pci_attach_args *pa = (struct pci_attach_args *)aux; + + if (PCI_CLASS(pa->pa_class) == PCI_CLASS_MASS_STORAGE && + PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MASS_STORAGE_UFS && + PCI_INTERFACE(pa->pa_class) == UFSHCI_PCI_INTERFACE) + return 1; + + return 0; +} + +void +ufshci_pci_attach(struct device *parent, struct device *self, void *aux) +{ + struct ufshci_pci_softc *psc = (struct ufshci_pci_softc *)self; + struct ufshci_softc *sc = &psc->psc_ufshci; + struct pci_attach_args *pa = aux; + pcireg_t maptype; + pci_intr_handle_t ih; + + psc->psc_pc = pa->pa_pc; + sc->sc_dmat = pa->pa_dmat; + + /* Map registers */ + maptype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, UFSHCI_PCI_BAR); + if (pci_mapreg_map(pa, UFSHCI_PCI_BAR, maptype, 0, &sc->sc_iot, + &sc->sc_ioh, NULL, &sc->sc_ios, 0) != 0) { + printf(": can't map registers\n"); + return; + } + + /* Map interrupt */ + if (pci_intr_map(pa, &ih) != 0) { + printf(": can't map interrupt\n"); + return; + } + printf(": %s", pci_intr_string(pa->pa_pc, ih)); + + /* Establish interrupt */ + psc->psc_ih = pci_intr_establish(psc->psc_pc, ih, IPL_BIO, ufshci_intr, + sc, sc->sc_dev.dv_xname); + if (psc->psc_ih == NULL) { + printf(": can't establish interrupt\n"); + return; + } + + /* Call the driver attach */ + ufshci_attach(sc); +} + +int +ufshci_pci_detach(struct device *self, int flags) +{ + return 0; +} diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c0f37cde8..b8d30773a 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.323 2024/03/30 13:33:20 mpi Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.324 2024/04/10 10:05:26 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -472,10 +472,10 @@ sys_sigprocmask(struct proc *p, void *v, register_t *retval) switch (SCARG(uap, how)) { case SIG_BLOCK: - atomic_setbits_int(&p->p_sigmask, mask); + SET(p->p_sigmask, mask); break; case SIG_UNBLOCK: - atomic_clearbits_int(&p->p_sigmask, mask); + CLR(p->p_sigmask, mask); break; case SIG_SETMASK: p->p_sigmask = mask; @@ -504,8 +504,8 @@ dosigsuspend(struct proc *p, sigset_t newmask) KASSERT(p == curproc); p->p_oldmask = p->p_sigmask; - atomic_setbits_int(&p->p_flag, P_SIGSUSPEND); p->p_sigmask = newmask; + atomic_setbits_int(&p->p_flag, P_SIGSUSPEND); } /* @@ -770,7 +770,7 @@ void postsig_done(struct proc *p, int signum, sigset_t catchmask, int reset) { p->p_ru.ru_nsignals++; - atomic_setbits_int(&p->p_sigmask, catchmask); + SET(p->p_sigmask, catchmask); if (reset != 0) { sigset_t mask = sigmask(signum); struct sigacts *ps = p->p_p->ps_sigacts; @@ -922,7 +922,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type) { int s, prop; sig_t action; - int mask; + sigset_t mask, sigmask; int *siglist; struct process *pr = p->p_p; struct proc *q; @@ -940,8 +940,11 @@ ptsignal(struct proc *p, int signum, enum signal_type type) return; mask = sigmask(signum); + sigmask = READ_ONCE(p->p_sigmask); if (type == SPROCESS) { + sigset_t tmpmask; + /* Accept SIGKILL to coredumping processes */ if (pr->ps_flags & PS_COREDUMP && signum == SIGKILL) { atomic_setbits_int(&pr->ps_siglist, mask); @@ -953,10 +956,12 @@ ptsignal(struct proc *p, int signum, enum signal_type type) * immediately (it's unblocked) then have it take it. */ q = curproc; - if (q != NULL && q->p_p == pr && (q->p_flag & P_WEXIT) == 0 && - (q->p_sigmask & mask) == 0) + tmpmask = READ_ONCE(q->p_sigmask); + if (q->p_p == pr && (q->p_flag & P_WEXIT) == 0 && + (tmpmask & mask) == 0) { p = q; - else { + sigmask = tmpmask; + } else { /* * A process-wide signal can be diverted to a * different thread that's in sigwait() for this @@ -967,16 +972,19 @@ ptsignal(struct proc *p, int signum, enum signal_type type) * main thread. */ TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { + /* ignore exiting threads */ if (q->p_flag & P_WEXIT) continue; /* skip threads that have the signal blocked */ - if ((q->p_sigmask & mask) != 0) + tmpmask = READ_ONCE(q->p_sigmask); + if ((tmpmask & mask) != 0) continue; /* okay, could send to this thread */ p = q; + sigmask = tmpmask; /* * sigsuspend, sigwait, ppoll/pselect, etc? @@ -1016,7 +1024,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type) if (sigignore & mask) return; - if (p->p_sigmask & mask) { + if (sigmask & mask) { action = SIG_HOLD; } else if (sigcatch & mask) { action = SIG_CATCH; @@ -1090,6 +1098,16 @@ ptsignal(struct proc *p, int signum, enum signal_type type) */ if (pr->ps_flags & PS_TRACED) goto run; + + /* + * Recheck sigmask before waking up the process, + * there is a chance that while sending the signal + * the process changed sigmask and went to sleep. + */ + sigmask = READ_ONCE(p->p_sigmask); + if (sigmask & mask) + goto out; + /* * If SIGCONT is default (or ignored) and process is * asleep, we are finished; the process should not @@ -1582,10 +1600,12 @@ sigabort(struct proc *p) { struct sigaction sa; + KASSERT(p == curproc || panicstr || db_active); + memset(&sa, 0, sizeof sa); sa.sa_handler = SIG_DFL; setsigvec(p, SIGABRT, &sa); - atomic_clearbits_int(&p->p_sigmask, sigmask(SIGABRT)); + CLR(p->p_sigmask, sigmask(SIGABRT)); psignal(p, SIGABRT); } @@ -1599,6 +1619,8 @@ sigismasked(struct proc *p, int sig) struct process *pr = p->p_p; int rv; + KASSERT(p == curproc); + mtx_enter(&pr->ps_mtx); rv = (pr->ps_sigacts->ps_sigignore & sigmask(sig)) || (p->p_sigmask & sigmask(sig)); @@ -2000,8 +2022,8 @@ userret(struct proc *p) * time for signals to post. */ if (p->p_flag & P_SIGSUSPEND) { - atomic_clearbits_int(&p->p_flag, P_SIGSUSPEND); p->p_sigmask = p->p_oldmask; + atomic_clearbits_int(&p->p_flag, P_SIGSUSPEND); while ((signum = cursig(p, &ctx)) != 0) postsig(p, signum, &ctx); diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index e012d086b..8699daff5 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_generic.c,v 1.156 2023/05/09 14:22:17 visa Exp $ */ +/* $OpenBSD: sys_generic.c,v 1.157 2024/04/10 10:05:26 claudio Exp $ */ /* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */ /* @@ -644,11 +644,8 @@ dopselect(struct proc *p, int nd, fd_set *in, fd_set *ou, fd_set *ex, } #endif - if (sigmask) { - KERNEL_LOCK(); + if (sigmask) dosigsuspend(p, *sigmask &~ sigcantmask); - KERNEL_UNLOCK(); - } /* Register kqueue events */ error = pselregister(p, pibits, pobits, nd, &nevents, &ncollected); @@ -946,11 +943,8 @@ doppoll(struct proc *p, struct pollfd *fds, u_int nfds, if ((error = copyin(fds, pl, sz)) != 0) goto bad; - if (sigmask) { - KERNEL_LOCK(); + if (sigmask) dosigsuspend(p, *sigmask &~ sigcantmask); - KERNEL_UNLOCK(); - } /* Register kqueue events */ ppollregister(p, pl, nfds, &nevents, &ncollected); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 8c33b9def..e5f4c1c9c 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.327 2024/04/02 14:23:15 claudio Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.328 2024/04/10 12:04:41 mvs Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -65,6 +65,7 @@ void sotask(void *); void soreaper(void *); void soput(void *); int somove(struct socket *, int); +void sorflush(struct socket *); void filt_sordetach(struct knote *kn); int filt_soread(struct knote *kn, long hint); @@ -414,15 +415,6 @@ drop: if (so->so_options & SO_ACCEPTCONN) { int persocket = solock_persocket(so); - if (persocket) { - /* Wait concurrent sonewconn() threads. */ - while (so->so_newconn > 0) { - so->so_state |= SS_NEWCONN_WAIT; - sosleep_nsec(so, &so->so_newconn, PSOCK, - "newcon", INFSLP); - } - } - while ((so2 = TAILQ_FIRST(&so->so_q0)) != NULL) { if (persocket) solock(so2); diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 4fb48191b..9c52cf7b4 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.147 2024/03/31 13:50:00 mvs Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.148 2024/04/10 12:04:41 mvs Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -179,7 +179,7 @@ sonewconn(struct socket *head, int connstatus, int wait) { struct socket *so; int persocket = solock_persocket(head); - int error; + int soqueue = connstatus ? 1 : 0; /* * XXXSMP as long as `so' and `head' share the same lock, we @@ -232,41 +232,13 @@ sonewconn(struct socket *head, int connstatus, int wait) sigio_copy(&so->so_sigio, &head->so_sigio); - soqinsque(head, so, 0); - - /* - * We need to unlock `head' because PCB layer could release - * solock() to enforce desired lock order. - */ - if (persocket) { - head->so_newconn++; - sounlock(head); - } - - error = pru_attach(so, 0, wait); - - if (persocket) { - sounlock(so); - solock(head); - solock(so); - - if ((head->so_newconn--) == 0) { - if ((head->so_state & SS_NEWCONN_WAIT) != 0) { - head->so_state &= ~SS_NEWCONN_WAIT; - wakeup(&head->so_newconn); - } - } - } - - if (error) { - soqremque(so, 0); + soqinsque(head, so, soqueue); + if (pru_attach(so, 0, wait) != 0) { + soqremque(so, soqueue); goto fail; } - if (connstatus) { so->so_state |= connstatus; - soqremque(so, 0); - soqinsque(head, so, 1); sorwakeup(head); wakeup(&head->so_timeo); } diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index d11b30f96..c55ff320d 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.203 2024/03/26 09:46:47 mvs Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.204 2024/04/10 12:04:41 mvs Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -293,14 +293,10 @@ uipc_attach(struct socket *so, int proto, int wait) so->so_pcb = unp; getnanotime(&unp->unp_ctime); - /* - * Enforce `unp_gc_lock' -> `solock()' lock order. - */ - sounlock(so); rw_enter_write(&unp_gc_lock); LIST_INSERT_HEAD(&unp_head, unp, unp_link); rw_exit_write(&unp_gc_lock); - solock(so); + return (0); } @@ -753,7 +749,6 @@ unp_detach(struct unpcb *unp) unp->unp_vnode = NULL; /* - * Enforce `unp_gc_lock' -> `solock()' lock order. * Enforce `i_lock' -> `solock()' lock order. */ sounlock(so); @@ -1443,16 +1438,26 @@ unp_gc(void *arg __unused) if (nunref) { LIST_FOREACH(unp, &unp_head, unp_link) { if (unp->unp_gcflags & UNP_GCDEAD) { + struct sockbuf *sb = &unp->unp_socket->so_rcv; + struct mbuf *m; + /* * This socket could still be connected * and if so it's `so_rcv' is still * accessible by concurrent PRU_SEND * thread. */ - so = unp->unp_socket; - solock(so); - sorflush(so); - sounlock(so); + + mtx_enter(&sb->sb_mtx); + m = sb->sb_mb; + memset(&sb->sb_startzero, 0, + (caddr_t)&sb->sb_endzero - + (caddr_t)&sb->sb_startzero); + sb->sb_timeo_nsecs = INFSLP; + mtx_leave(&sb->sb_mtx); + + unp_scan(m, unp_discard); + m_purge(m); } } } diff --git a/sys/lib/libkern/arch/alpha/htonl.S b/sys/lib/libkern/arch/alpha/htonl.S deleted file mode 100644 index b34338a26..000000000 --- a/sys/lib/libkern/arch/alpha/htonl.S +++ /dev/null @@ -1 +0,0 @@ -/* No code here since kernel implements this itself */ diff --git a/sys/lib/libkern/arch/alpha/htons.S b/sys/lib/libkern/arch/alpha/htons.S deleted file mode 100644 index b34338a26..000000000 --- a/sys/lib/libkern/arch/alpha/htons.S +++ /dev/null @@ -1 +0,0 @@ -/* No code here since kernel implements this itself */ diff --git a/sys/lib/libkern/arch/amd64/htonl.S b/sys/lib/libkern/arch/amd64/htonl.S deleted file mode 100644 index cce7babf4..000000000 --- a/sys/lib/libkern/arch/amd64/htonl.S +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: byte_swap_4.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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 acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * from: @(#)htonl.s 5.3 (Berkeley) 12/17/90 - */ - -#include - -STRONG_ALIAS(ntohl, htonl) -STRONG_ALIAS(bswap32, htonl) - -ENTRY(htonl) - RETGUARD_SETUP(htonl, r11) - movl %edi,%eax - bswap %eax - RETGUARD_CHECK(htonl, r11) - ret - lfence -END(htonl) diff --git a/sys/lib/libkern/arch/amd64/htons.S b/sys/lib/libkern/arch/amd64/htons.S deleted file mode 100644 index 9cc236e9a..000000000 --- a/sys/lib/libkern/arch/amd64/htons.S +++ /dev/null @@ -1,53 +0,0 @@ -/* $NetBSD: byte_swap_2.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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 acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * from: @(#)htons.s 5.2 (Berkeley) 12/17/90 - */ - -#include - -STRONG_ALIAS(ntohs, htons) -STRONG_ALIAS(bswap16, htons) - -ENTRY(htons) - RETGUARD_SETUP(htons, r11) - movl %edi,%eax - xchgb %ah,%al - RETGUARD_CHECK(htons, r11) - ret - lfence -END(htons) diff --git a/sys/lib/libkern/arch/arm/htonl.S b/sys/lib/libkern/arch/arm/htonl.S deleted file mode 100644 index d223285a1..000000000 --- a/sys/lib/libkern/arch/arm/htonl.S +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: htonl.S,v 1.4 2022/12/08 01:25:46 guenther Exp $ */ -/* $NetBSD: byte_swap_4.S,v 1.1 2000/12/29 20:51:57 bjh21 Exp $ */ - -/*- - * Copyright (c) 1997 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Neil A. Carson - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS 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 FOUNDATION OR 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 - -_ENTRY(htonl) -_ENTRY(ntohl) -_ENTRY(bswap32) -_PROF_PROLOGUE - eor r1, r0, r0, ror #16 - bic r1, r1, #0x00FF0000 - mov r0, r0, ror #8 - eor r0, r0, r1, lsr #8 - mov pc, lr diff --git a/sys/lib/libkern/arch/arm/htons.S b/sys/lib/libkern/arch/arm/htons.S deleted file mode 100644 index 5323197f8..000000000 --- a/sys/lib/libkern/arch/arm/htons.S +++ /dev/null @@ -1,42 +0,0 @@ -/* $OpenBSD: htons.S,v 1.4 2022/12/08 01:25:46 guenther Exp $ */ -/* $NetBSD: byte_swap_2.S,v 1.1.20.1 2002/07/02 06:50:59 lukem Exp $ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Charles M. Hannum. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS 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 FOUNDATION OR 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 - -_ENTRY(htons) -_ENTRY(ntohs) -_ENTRY(bswap16) -_PROF_PROLOGUE - and r1, r0, #0xff - mov r0, r0, lsr #8 - orr r0, r0, r1, lsl #8 - mov pc, lr diff --git a/sys/lib/libkern/arch/i386/htonl.S b/sys/lib/libkern/arch/i386/htonl.S deleted file mode 100644 index 1d44d676c..000000000 --- a/sys/lib/libkern/arch/i386/htonl.S +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: htonl.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * from: @(#)htonl.s 5.3 (Berkeley) 12/17/90 - */ - -#include - -/* netorder = htonl(hostorder) AND hostorder = ntohl(netorder) */ -ENTRY(ntohl) -ENTRY(htonl) -ENTRY(swap32) - movl 4(%esp),%eax - rorw $8,%ax - roll $16,%eax - rorw $8,%ax - ret diff --git a/sys/lib/libkern/arch/i386/htons.S b/sys/lib/libkern/arch/i386/htons.S deleted file mode 100644 index d563ce8e6..000000000 --- a/sys/lib/libkern/arch/i386/htons.S +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: htons.S,v 1.4 2007/11/25 18:25:35 deraadt Exp $ */ - -/*- - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * from: @(#)htons.s 5.2 (Berkeley) 12/17/90 - */ - -#include - -/* netorder = htons(hostorder) AND hostorder = ntohs(netorder) */ -ENTRY(htons) -ENTRY(ntohs) -ENTRY(swap16) - movzwl 4(%esp),%eax - rorw $8,%ax - ret diff --git a/sys/lib/libkern/arch/mips64/htonl.S b/sys/lib/libkern/arch/mips64/htonl.S deleted file mode 100644 index 13c1d7024..000000000 --- a/sys/lib/libkern/arch/mips64/htonl.S +++ /dev/null @@ -1,59 +0,0 @@ -/* $OpenBSD: htonl.S,v 1.4 2009/12/12 20:03:54 miod Exp $ */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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 "DEFS.h" - - -/* - * netorder = htonl(hostorder) - * hostorder = ntohl(netorder) - */ -LEAF(htonl, 0) # a0 = 0x11223344, return 0x44332211 -ALEAF(ntohl) -#ifdef __MIPSEL__ - .set noreorder - srl v1, a0, 24 # v1 = 0x00000011 - sll v0, a0, 24 # v0 = 0x44000000 - or v0, v0, v1 - and v1, a0, 0xff00 - sll v1, v1, 8 # v1 = 0x00330000 - or v0, v0, v1 - srl v1, a0, 8 - and v1, v1, 0xff00 # v1 = 0x00002200 - j ra - or v0, v0, v1 -#else - j ra - move v0, a0 -#endif -END(htonl) diff --git a/sys/lib/libkern/arch/mips64/htons.S b/sys/lib/libkern/arch/mips64/htons.S deleted file mode 100644 index 1d956a324..000000000 --- a/sys/lib/libkern/arch/mips64/htons.S +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: htons.S,v 1.4 2009/12/12 20:03:54 miod Exp $ */ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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 "DEFS.h" - - -/* - * netorder = htons(hostorder) - * hostorder = ntohs(netorder) - */ -LEAF(htons, 0) -ALEAF(ntohs) -#ifdef __MIPSEL__ - .set noreorder - srl v0, a0, 8 - and v0, v0, 0xff - sll v1, a0, 8 - and v1, v1, 0xff00 - j ra - or v0, v0, v1 -#else - j ra - move v0, a0 -#endif -END(htons) diff --git a/sys/lib/libkern/arch/sparc64/htonl.S b/sys/lib/libkern/arch/sparc64/htonl.S deleted file mode 100644 index 71fbd5145..000000000 --- a/sys/lib/libkern/arch/sparc64/htonl.S +++ /dev/null @@ -1,46 +0,0 @@ -/* $OpenBSD: htonl.S,v 1.5 2019/11/05 08:16:43 mpi Exp $ */ -/* $NetBSD: htonl.S,v 1.1.1.1 1998/06/20 05:18:14 eeh Exp $ */ - -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * Header: htonl.s,v 1.1 92/06/25 12:47:05 torek Exp - */ - -/* netorder = htonl(hostorder) */ - -#include "DEFS.h" - -ENTRY(htonl) - retl - sra %o0, 0, %o0 ! sign extend -END(htonl) diff --git a/sys/lib/libkern/arch/sparc64/htons.S b/sys/lib/libkern/arch/sparc64/htons.S deleted file mode 100644 index fc4375b5e..000000000 --- a/sys/lib/libkern/arch/sparc64/htons.S +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: htons.S,v 1.5 2019/11/05 08:16:43 mpi Exp $ */ -/* - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This software was developed by the Computer Systems Engineering group - * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and - * contributed to Berkeley. - * - * 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. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS 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 REGENTS OR 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. - * - * Header: htons.s,v 1.1 92/06/25 12:47:05 torek Exp - */ - -/* netorder = htons(hostorder) */ - -#include "DEFS.h" - -ENTRY(htons) - sethi %hi(0xffff0000), %o1 - retl - andn %o0, %o1, %o0 -END(htons) diff --git a/sys/lib/libkern/htonl.c b/sys/lib/libkern/htonl.c deleted file mode 100644 index 6929e7e32..000000000 --- a/sys/lib/libkern/htonl.c +++ /dev/null @@ -1,23 +0,0 @@ -/* $OpenBSD: htonl.c,v 1.9 2014/12/20 18:15:29 miod Exp $ */ -/* - * Written by J.T. Conklin . - * Public domain. - */ - -#include -#include - -#undef htonl - -u_int32_t htonl(u_int32_t); - -u_int32_t -htonl(u_int32_t x) -{ -#if BYTE_ORDER == LITTLE_ENDIAN - u_char *s = (u_char *)&x; - return (u_int32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); -#else - return x; -#endif -} diff --git a/sys/lib/libkern/htons.c b/sys/lib/libkern/htons.c deleted file mode 100644 index 714eb37c1..000000000 --- a/sys/lib/libkern/htons.c +++ /dev/null @@ -1,23 +0,0 @@ -/* $OpenBSD: htons.c,v 1.9 2014/12/20 18:15:29 miod Exp $ */ -/* - * Written by J.T. Conklin . - * Public domain. - */ - -#include -#include - -#undef htons - -u_int16_t htons(u_int16_t); - -u_int16_t -htons(u_int16_t x) -{ -#if BYTE_ORDER == LITTLE_ENDIAN - u_char *s = (u_char *) &x; - return (u_int16_t)(s[0] << 8 | s[1]); -#else - return x; -#endif -} diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c index 8d26905c3..2bb5bfcff 100644 --- a/sys/net/if_wg.c +++ b/sys/net/if_wg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wg.c,v 1.37 2024/03/05 17:48:01 mvs Exp $ */ +/* $OpenBSD: if_wg.c,v 1.38 2024/04/09 12:53:08 claudio Exp $ */ /* * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. @@ -42,6 +42,7 @@ #include #include #include +#include #include #include diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 48108ce02..bc4f558a4 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.86 2024/03/26 10:01:57 bluhm Exp $ */ +/* $OpenBSD: rtable.c,v 1.87 2024/04/09 12:53:08 claudio Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -30,6 +30,7 @@ #include #include +#include /* * Structures used by rtable_get() to retrieve the corresponding diff --git a/sys/net/rtable.h b/sys/net/rtable.h index 441c4718f..143b517d9 100644 --- a/sys/net/rtable.h +++ b/sys/net/rtable.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.h,v 1.28 2023/11/12 17:51:41 bluhm Exp $ */ +/* $OpenBSD: rtable.h,v 1.29 2024/04/09 12:53:08 claudio Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -23,7 +23,6 @@ * Newer routing table implementation based on ART (Allotment Routing * Table). */ -#include #define rt_key(rt) ((rt)->rt_dest) #define rt_plen(rt) ((rt)->rt_plen) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 0a6069603..3154be349 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_output.c,v 1.396 2024/02/22 14:25:58 bluhm Exp $ */ +/* $OpenBSD: ip_output.c,v 1.397 2024/04/09 11:05:05 bluhm Exp $ */ /* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */ /* @@ -417,6 +417,8 @@ sendit: else if (m->m_pkthdr.pf.flags & PF_TAG_REROUTE) { /* tag as generated to skip over pf_test on rerun */ m->m_pkthdr.pf.flags |= PF_TAG_GENERATED; + if (ro == &iproute) + rtfree(ro->ro_rt); ro = NULL; if_put(ifp); /* drop reference since target changed */ ifp = NULL; @@ -481,7 +483,7 @@ sendit: ipstat_inc(ips_fragmented); done: - if (ro == &iproute && ro->ro_rt) + if (ro == &iproute) rtfree(ro->ro_rt); if_put(ifp); #ifdef IPSEC diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 94519429c..a2ba550fa 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_output.c,v 1.288 2024/02/28 10:57:20 bluhm Exp $ */ +/* $OpenBSD: ip6_output.c,v 1.289 2024/04/09 11:05:05 bluhm Exp $ */ /* $KAME: ip6_output.c,v 1.172 2001/03/25 09:55:56 itojun Exp $ */ /* @@ -635,6 +635,8 @@ reroute: /* tag as generated to skip over pf_test on rerun */ m->m_pkthdr.pf.flags |= PF_TAG_GENERATED; finaldst = ip6->ip6_dst; + if (ro == &iproute) + rtfree(ro->ro_rt); ro = NULL; if_put(ifp); /* drop reference since destination changed */ ifp = NULL; @@ -758,11 +760,10 @@ reroute: bad: m_freem(m); done: - if (ro == &iproute && ro->ro_rt) { + if (ro == &iproute) rtfree(ro->ro_rt); - } else if (ro_pmtu == &iproute && ro_pmtu->ro_rt) { + else if (ro_pmtu == &iproute) rtfree(ro_pmtu->ro_rt); - } if_put(ifp); #ifdef IPSEC tdb_unref(tdb); diff --git a/sys/sys/proc.h b/sys/sys/proc.h index f10b85236..83c8421e1 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.358 2024/04/02 08:39:16 deraadt Exp $ */ +/* $OpenBSD: proc.h,v 1.359 2024/04/10 10:05:26 claudio Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -321,7 +321,7 @@ struct p_inentry { * S scheduler lock * U uidinfolk * l read only reference, see lim_read_enter() - * o owned (read/modified only) by this thread + * o owned (modified only) by this thread */ struct proc { TAILQ_ENTRY(proc) p_runq; /* [S] current run/sleep queue */ @@ -379,7 +379,7 @@ struct proc { /* The following fields are all copied upon creation in fork. */ #define p_startcopy p_sigmask - sigset_t p_sigmask; /* [a] Current signal mask */ + sigset_t p_sigmask; /* [o] Current signal mask */ char p_name[_MAXCOMLEN]; /* thread name, incl NUL */ u_char p_slppri; /* [S] Sleeping priority */ @@ -398,7 +398,7 @@ struct proc { struct user *p_addr; /* Kernel virtual addr of u-area */ struct mdproc p_md; /* Any machine-dependent fields. */ - sigset_t p_oldmask; /* Saved mask from before sigpause */ + sigset_t p_oldmask; /* [o] Saved mask from before sigpause */ int p_sisig; /* For core dump/debugger XXX */ union sigval p_sigval; /* For core dump/debugger XXX */ long p_sitrapno; /* For core dump/debugger XXX */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 0169c6273..cca3780c0 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socketvar.h,v 1.127 2024/03/27 22:47:53 mvs Exp $ */ +/* $OpenBSD: socketvar.h,v 1.128 2024/04/10 12:04:41 mvs Exp $ */ /* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */ /*- @@ -86,7 +86,6 @@ struct socket { short so_q0len; /* partials on so_q0 */ short so_qlen; /* number of connections on so_q */ short so_qlimit; /* max number queued connections */ - u_long so_newconn; /* # of pending sonewconn() threads */ short so_timeo; /* connection timeout */ u_long so_oobmark; /* chars to oob mark */ u_int so_error; /* error affecting connection */ @@ -169,8 +168,7 @@ struct socket { #define SS_CONNECTOUT 0x1000 /* connect, not accept, at this end */ #define SS_ISSENDING 0x2000 /* hint for lower layer */ #define SS_DNS 0x4000 /* created using SOCK_DNS socket(2) */ -#define SS_NEWCONN_WAIT 0x8000 /* waiting sonewconn() relock */ -#define SS_YP 0x10000 /* created using ypconnect(2) */ +#define SS_YP 0x8000 /* created using ypconnect(2) */ #ifdef _KERNEL @@ -400,7 +398,6 @@ int sosend(struct socket *, struct mbuf *, struct uio *, struct mbuf *, struct mbuf *, int); int sosetopt(struct socket *, int, int, struct mbuf *); int soshutdown(struct socket *, int); -void sorflush(struct socket *); void sowakeup(struct socket *, struct sockbuf *); void sorwakeup(struct socket *); void sowwakeup(struct socket *); diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index 6d8dc76c0..75c2abf07 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.108 2023/05/13 09:24:59 mpi Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.109 2024/04/10 15:25:14 mpi Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -1398,7 +1398,7 @@ uao_pagein_page(struct uvm_aobj *aobj, int pageidx) { struct uvm_object *uobj = &aobj->u_obj; struct vm_page *pg; - int rv, slot, npages; + int rv, npages; pg = NULL; npages = 1; @@ -1429,8 +1429,7 @@ uao_pagein_page(struct uvm_aobj *aobj, int pageidx) * ok, we've got the page now. * mark it as dirty, clear its swslot and un-busy it. */ - slot = uao_set_swslot(&aobj->u_obj, pageidx, 0); - uvm_swap_free(slot, 1); + uao_dropswap(&aobj->u_obj, pageidx); atomic_clearbits_int(&pg->pg_flags, PG_BUSY|PG_CLEAN|PG_FAKE); UVM_PAGE_OWN(pg, NULL); diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c index 0c28e62d7..e94cae2b7 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.110 2024/03/24 10:29:35 mpi Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.111 2024/04/10 15:26:18 mpi Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -107,7 +107,7 @@ void uvmpd_scan_inactive(struct uvm_pmalloc *, struct uvm_constraint_range *, struct pglist *); void uvmpd_tune(void); void uvmpd_drop(struct pglist *); -void uvmpd_dropswap(struct vm_page *); +int uvmpd_dropswap(struct vm_page *); /* * uvm_wait: wait (sleep) for the page daemon to free some pages @@ -382,23 +382,29 @@ uvmpd_trylockowner(struct vm_page *pg) return slock; } - /* * uvmpd_dropswap: free any swap allocated to this page. * * => called with owner locked. + * => return 1 if a page had an associated slot. */ -void +int uvmpd_dropswap(struct vm_page *pg) { struct vm_anon *anon = pg->uanon; + int slot, result = 0; if ((pg->pg_flags & PQ_ANON) && anon->an_swslot) { uvm_swap_free(anon->an_swslot, 1); anon->an_swslot = 0; + result = 1; } else if (pg->pg_flags & PQ_AOBJ) { - uao_dropswap(pg->uobject, pg->offset >> PAGE_SHIFT); + slot = uao_dropswap(pg->uobject, pg->offset >> PAGE_SHIFT); + if (slot) + result = 1; } + + return result; } /* @@ -941,22 +947,10 @@ uvmpd_scan(struct uvm_pmalloc *pma, struct uvm_constraint_range *constraint) * to this page so that other pages can be paged out. */ if (swap_shortage > 0) { - if ((p->pg_flags & PQ_ANON) && p->uanon->an_swslot) { - uvm_swap_free(p->uanon->an_swslot, 1); - p->uanon->an_swslot = 0; + if (uvmpd_dropswap(p)) { atomic_clearbits_int(&p->pg_flags, PG_CLEAN); swap_shortage--; } - if (p->pg_flags & PQ_AOBJ) { - int slot = uao_set_swslot(p->uobject, - p->offset >> PAGE_SHIFT, 0); - if (slot) { - uvm_swap_free(slot, 1); - atomic_clearbits_int(&p->pg_flags, - PG_CLEAN); - swap_shortage--; - } - } } /* diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c index b57301044..debd3562a 100644 --- a/usr.bin/make/engine.c +++ b/usr.bin/make/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.73 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: engine.c,v 1.74 2024/04/09 15:08:21 cheloha Exp $ */ /* * Copyright (c) 2012 Marc Espie. * @@ -262,7 +262,7 @@ Job_Touch(GNode *gn) } else { const char *file = gn->path != NULL ? gn->path : gn->name; - if (set_times(file) == -1){ + if (utimes(file, NULL) == -1){ if (rewrite_time(file) == -1) { (void)fprintf(stderr, "*** couldn't touch %s: %s", file, diff --git a/usr.bin/make/timestamp.c b/usr.bin/make/timestamp.c index 2029d6b62..38c47533c 100644 --- a/usr.bin/make/timestamp.c +++ b/usr.bin/make/timestamp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timestamp.c,v 1.11 2023/09/04 11:35:11 espie Exp $ */ +/* $OpenBSD: timestamp.c,v 1.12 2024/04/09 15:08:21 cheloha Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -33,12 +33,6 @@ struct timespec starttime; -int -set_times(const char *f) -{ - return utimes(f, NULL); -} - #define PLACEHOLDER "XXXXXXXXX " char * time_to_string(struct timespec *t) diff --git a/usr.bin/make/timestamp.h b/usr.bin/make/timestamp.h index 2aa78e590..a7a26dc93 100644 --- a/usr.bin/make/timestamp.h +++ b/usr.bin/make/timestamp.h @@ -1,7 +1,7 @@ #ifndef TIMESTAMP_H #define TIMESTAMP_H -/* $OpenBSD: timestamp.h,v 1.11 2023/08/19 04:21:06 guenther Exp $ */ +/* $OpenBSD: timestamp.h,v 1.12 2024/04/09 15:08:21 cheloha Exp $ */ /* * Copyright (c) 2001 Marc Espie. @@ -39,10 +39,6 @@ * ts_set_from_time_t(d, t): create timestamp from time_t. */ -/* sysresult = set_times(name): set modification times on a file. - * system call results. - */ - #define Init_Timestamp() clock_gettime(CLOCK_REALTIME, &starttime) #define TMIN (sizeof(time_t) == sizeof(int32_t) ? INT32_MIN : INT64_MIN) @@ -64,8 +60,6 @@ do { \ (t).tv_nsec++; \ } while (0) -extern int set_times(const char *); - extern struct timespec starttime; /* The time at the start * of this whole process */ extern char *time_to_string(struct timespec *); diff --git a/usr.bin/tmux/input.c b/usr.bin/tmux/input.c index 3679cadac..6d67917f4 100644 --- a/usr.bin/tmux/input.c +++ b/usr.bin/tmux/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.223 2023/12/27 20:13:35 nicm Exp $ */ +/* $OpenBSD: input.c,v 1.224 2024/04/10 07:36:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -2341,7 +2341,9 @@ input_exit_osc(struct input_ctx *ictx) switch (option) { case 0: case 2: - if (screen_set_title(sctx->s, p) && wp != NULL) { + if (wp != NULL && + options_get_number(wp->options, "allow-set-title") && + screen_set_title(sctx->s, p)) { notify_pane("pane-title-changed", wp); server_redraw_window_borders(wp->window); server_status_window(wp->window); diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c index 65265ce90..919c7ce1f 100644 --- a/usr.bin/tmux/options-table.c +++ b/usr.bin/tmux/options-table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options-table.c,v 1.170 2024/03/21 11:53:11 nicm Exp $ */ +/* $OpenBSD: options-table.c,v 1.171 2024/04/10 07:36:25 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -876,6 +876,14 @@ const struct options_table_entry options_table[] = { "to rename windows." }, + { .name = "allow-set-title", + .type = OPTIONS_TABLE_FLAG, + .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, + .default_num = 1, + .text = "Whether applications are allowed to use the escape sequence " + "to set the pane title." + }, + { .name = "alternate-screen", .type = OPTIONS_TABLE_FLAG, .scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE, diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 01e3bd1ac..6ed62c49b 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.404 2024/01/16 13:09:11 claudio Exp $ */ +/* $OpenBSD: server-client.c,v 1.405 2024/04/10 07:29:15 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -626,6 +626,8 @@ server_client_check_mouse(struct client *c, struct key_event *event) } else if (MOUSE_RELEASE(m->b)) { type = UP; x = m->x, y = m->y, b = m->lb; + if (m->sgr_type == 'm') + b = m->sgr_b; log_debug("up at %u,%u", x, y); } else { if (c->flags & CLIENT_DOUBLECLICK) { @@ -646,7 +648,10 @@ server_client_check_mouse(struct client *c, struct key_event *event) log_debug("triple-click at %u,%u", x, y); goto have_event; } - } else { + } + + /* DOWN is the only remaining event type. */ + if (type == NOTYPE) { type = DOWN; x = m->x, y = m->y, b = m->b; log_debug("down at %u,%u", x, y); diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index bf0344bca..83e1f1193 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.940 2024/03/21 11:53:11 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.941 2024/04/10 07:36:25 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 21 2024 $ +.Dd $Mdocdate: April 10 2024 $ .Dt TMUX 1 .Os .Sh NAME @@ -4750,6 +4750,12 @@ they will be allowed even if the pane is invisible. Allow programs in the pane to change the window name using a terminal escape sequence (\eek...\ee\e\e). .Pp +.It Xo Ic allow-set-title +.Op Ic on | off +.Xc +Allow programs in the pane to change the title using the terminal escape +sequences (\ee]2;...\ee\e\e or \ee]0;...\ee\e\e). +.Pp .It Xo Ic alternate-screen .Op Ic on | off .Xc diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 3eea22028..4af59adf4 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1213 2024/03/21 11:30:42 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1214 2024/04/10 07:36:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -850,7 +850,7 @@ struct screen_sel; struct screen_titles; struct screen { char *title; - char *path; + char *path; struct screen_titles *titles; struct grid *grid; /* grid data */ diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 3d4361a4a..e9a9a1ef2 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.289 2024/03/21 11:30:42 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.290 2024/04/10 07:15:21 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -474,7 +474,7 @@ window_pane_update_focus(struct window_pane *wp) struct client *c; int focused = 0; - if (wp != NULL) { + if (wp != NULL && (~wp->flags & PANE_EXITED)) { if (wp != wp->window->active) focused = 0; else { diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 85b02707d..b4df9efaa 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.262 2024/01/09 13:41:32 claudio Exp $ */ +/* $OpenBSD: bgpd.c,v 1.263 2024/04/09 12:05:07 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -716,11 +716,19 @@ send_config(struct bgpd_config *conf) } free_roatree(&conf->roa); RB_FOREACH(aspa, aspa_tree, &conf->aspa) { + /* XXX prevent oversized IMSG for now */ + if (aspa->num * sizeof(*aspa->tas) > + MAX_IMSGSIZE - IMSG_HEADER_SIZE) { + log_warnx("oversized ASPA set for customer-as %s, %s", + log_as(aspa->as), "dropped"); + continue; + } + if (imsg_compose(ibuf_rtr, IMSG_RECONF_ASPA, 0, 0, -1, aspa, offsetof(struct aspa_set, tas)) == -1) return (-1); if (imsg_compose(ibuf_rtr, IMSG_RECONF_ASPA_TAS, 0, 0, - -1, aspa->tas, sizeof(*aspa->tas) * aspa->num) == -1) + -1, aspa->tas, aspa->num * sizeof(*aspa->tas)) == -1) return (-1); if (imsg_compose(ibuf_rtr, IMSG_RECONF_ASPA_DONE, 0, 0, -1, NULL, 0) == -1) diff --git a/usr.sbin/bgpd/bgpd.conf.5 b/usr.sbin/bgpd/bgpd.conf.5 index a52227b8e..e637818c0 100644 --- a/usr.sbin/bgpd/bgpd.conf.5 +++ b/usr.sbin/bgpd/bgpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bgpd.conf.5,v 1.238 2024/03/18 10:16:50 claudio Exp $ +.\" $OpenBSD: bgpd.conf.5,v 1.239 2024/04/09 09:03:18 claudio Exp $ .\" .\" Copyright (c) 2004 Claudio Jeker .\" Copyright (c) 2003, 2004 Henning Brauer @@ -16,7 +16,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 18 2024 $ +.Dd $Mdocdate: April 9 2024 $ .Dt BGPD.CONF 5 .Os .Sh NAME @@ -956,6 +956,7 @@ The neighbor properties are as follows: .Ic announce .Pq Ic IPv4 Ns | Ns Ic IPv6 .Pq Ic none Ns | Ns Ic unicast Ns | Ns Ic vpn Ns | Ns Ic flowspec +.Op Ic enforce .Xc For the given address family, control which .Em subsequent address families @@ -979,7 +980,7 @@ for the same address family of the session. .Pp .It Xo .Ic announce add-path recv -.Pq Ic yes Ns | Ns Ic no +.Pq Ic yes Ns | Ns Ic no Ns | Ns Ic enforce .Xc If set to .Ic yes , @@ -991,12 +992,14 @@ The default is .It Xo .Ic announce add-path send .Pq Ic no Ns | Ns Ic all +.Op Ic enforce .Xc .It Xo .Ic announce add-path send -.Pq Ic best Ns | Ns Ic ecmp | Ns Ic as-wide-best +.Pq Ic best Ns | Ns Ic ecmp Ns | Ns Ic as-wide-best .Op Ic plus Ar num .Op Ic max Ar num +.Op Ic enforce .Xc If set to .Ic all , @@ -1047,12 +1050,16 @@ is ignored. .Pp .It Xo .Ic announce as-4byte -.Pq Ic yes Ns | Ns Ic no +.Pq Ic yes Ns | Ns Ic no Ns | Ns Ic enforce .Xc If set to .Ic no , the 4-byte AS capability is not announced and so native 4-byte AS support is disabled. +If +.Ic enforce +is set, the session will only be established if the neighbor also announces +the capability. The default is .Ic yes . .Pp @@ -1069,11 +1076,15 @@ The default is .Pp .It Xo .Ic announce enhanced refresh -.Pq Ic yes Ns | Ns Ic no +.Pq Ic yes Ns | Ns Ic no Ns | Ns Ic enforce .Xc If set to .Ic yes , the enhanced route refresh capability is announced. +If +.Ic enforce +is set, the session will only be established if the neighbor also announces +the capability. The default is .Ic no . .Pp @@ -1088,24 +1099,28 @@ If the role of the neighbor does not correspond to the expected role then the session will be closed. If .Ic enforce -is set the session will only establish if the neighbor also announces -the open policy capability. +is set, the session will only be established if the neighbor also announces +the capability. The default is .Ic no . .Pp .It Xo .Ic announce refresh -.Pq Ic yes Ns | Ns Ic no +.Pq Ic yes Ns | Ns Ic no Ns | Ns Ic enforce .Xc If set to .Ic no , the route refresh capability is not announced. +If +.Ic enforce +is set, the session will only be established if the neighbor also announces +the capability. The default is .Ic yes . .Pp .It Xo .Ic announce restart -.Pq Ic yes Ns | Ns Ic no +.Pq Ic yes Ns | Ns Ic no Ns | Ns Ic enforce .Xc If set to .Ic no , @@ -1113,6 +1128,10 @@ the graceful restart capability is not announced. Currently only the End-of-RIB marker is supported and announced by the .Ic restart capability. +If +.Ic enforce +is set, the session will only be established if the neighbor also announces +the capability. The default is .Ic yes . .Pp diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 869d6539e..6cf22dcb0 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.489 2024/03/22 15:41:34 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.491 2024/04/09 12:09:19 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -53,6 +53,7 @@ #define RT_BUF_SIZE 16384 #define MAX_RTSOCK_BUF (2 * 1024 * 1024) #define MAX_COMM_MATCH 3 +#define MAX_ASPA_SPAS_COUNT 10000 #define BGPD_OPT_VERBOSE 0x0001 #define BGPD_OPT_VERBOSE2 0x0002 @@ -432,6 +433,9 @@ enum capa_codes { #define CAPA_AP_RECV 0x01 #define CAPA_AP_SEND 0x02 #define CAPA_AP_BIDIR 0x03 +#define CAPA_AP_MASK 0x0f +#define CAPA_AP_RECV_ENFORCE 0x10 /* internal only */ +#define CAPA_AP_SEND_ENFORCE 0x20 /* internal only */ /* values for RFC 9234 - BGP Open Policy */ #define CAPA_ROLE_PROVIDER 0x00 diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 9a469f032..9c2a7c9d5 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.458 2024/04/03 08:57:26 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.460 2024/04/09 12:40:01 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -273,6 +273,7 @@ typedef struct { %type asnumber as4number as4number_any optnumber %type espah af safi restart origincode nettype %type yesno inout restricted expires enforce +%type yesnoenforce enforce %type validity aspa_validity %type addpathextra addpathmax %type port proto_item tos length flag icmptype @@ -1889,7 +1890,7 @@ peeropts : REMOTEAS as4number { } curpeer->conf.min_holdtime = $3; } - | ANNOUNCE af safi { + | ANNOUNCE af safi enforce { uint8_t aid, safi; uint16_t afi; @@ -1905,42 +1906,48 @@ peeropts : REMOTEAS as4number { yyerror("unknown AFI/SAFI pair"); YYERROR; } - curpeer->conf.capabilities.mp[aid] = 1; + if ($4) + curpeer->conf.capabilities.mp[aid] = 2; + else + curpeer->conf.capabilities.mp[aid] = 1; } } | ANNOUNCE CAPABILITIES yesno { curpeer->conf.announce_capa = $3; } - | ANNOUNCE REFRESH yesno { + | ANNOUNCE REFRESH yesnoenforce { curpeer->conf.capabilities.refresh = $3; } - | ANNOUNCE ENHANCED REFRESH yesno { + | ANNOUNCE ENHANCED REFRESH yesnoenforce { curpeer->conf.capabilities.enhanced_rr = $4; } - | ANNOUNCE RESTART yesno { + | ANNOUNCE RESTART yesnoenforce { curpeer->conf.capabilities.grestart.restart = $3; } - | ANNOUNCE AS4BYTE yesno { + | ANNOUNCE AS4BYTE yesnoenforce { curpeer->conf.capabilities.as4byte = $3; } - | ANNOUNCE ADDPATH RECV yesno { + | ANNOUNCE ADDPATH RECV yesnoenforce { int8_t *ap = curpeer->conf.capabilities.add_path; uint8_t i; - for (i = AID_MIN; i < AID_MAX; i++) - if ($4) + for (i = AID_MIN; i < AID_MAX; i++) { + if ($4) { + if ($4 == 2) + ap[i] |= CAPA_AP_RECV_ENFORCE; ap[i] |= CAPA_AP_RECV; - else + } else ap[i] &= ~CAPA_AP_RECV; + } } - | ANNOUNCE ADDPATH SEND STRING addpathextra addpathmax { + | ANNOUNCE ADDPATH SEND STRING addpathextra addpathmax enforce { int8_t *ap = curpeer->conf.capabilities.add_path; enum addpath_mode mode; u_int8_t i; if (!strcmp($4, "no")) { free($4); - if ($5 != 0 || $6 != 0) { + if ($5 != 0 || $6 != 0 || $7 != 0) { yyerror("no additional option allowed " "for 'add-path send no'"); YYERROR; @@ -1970,16 +1977,18 @@ peeropts : REMOTEAS as4number { YYERROR; } for (i = AID_MIN; i < AID_MAX; i++) { - if (mode != ADDPATH_EVAL_NONE) + if (mode != ADDPATH_EVAL_NONE) { + if ($7) + ap[i] |= CAPA_AP_SEND_ENFORCE; ap[i] |= CAPA_AP_SEND; - else + } else ap[i] &= ~CAPA_AP_SEND; } curpeer->conf.eval.mode = mode; curpeer->conf.eval.extrapaths = $5; curpeer->conf.eval.maxpaths = $6; } - | ANNOUNCE POLICY enforce { + | ANNOUNCE POLICY yesnoenforce { curpeer->conf.capabilities.policy = $3; } | ROLE STRING { @@ -3083,7 +3092,11 @@ delete : /* empty */ { $$ = 0; } | DELETE { $$ = 1; } ; -enforce : yesno { $$ = $1; } +enforce : /* empty */ { $$ = 0; } + | ENFORCE { $$ = 2; } + ; + +yesnoenforce : yesno { $$ = $1; } | ENFORCE { $$ = 2; } ; @@ -5469,8 +5482,8 @@ merge_aspa_set(uint32_t as, struct aspa_tas_l *tas, time_t expires) RB_INSERT(aspa_tree, &conf->aspa, aspa); } - if (UINT32_MAX - aspa->num <= tas->num) { - yyerror("aspa_set overflow"); + if (MAX_ASPA_SPAS_COUNT - aspa->num <= tas->num) { + yyerror("too many providers for customer-as %u", as); return -1; } num = aspa->num + tas->num; @@ -5487,6 +5500,7 @@ merge_aspa_set(uint32_t as, struct aspa_tas_l *tas, time_t expires) aspa->num = num; aspa->tas = newtas; + /* take the longest expiry time, same logic as for ROA entries */ if (aspa->expires != 0 && expires != 0 && expires > aspa->expires) aspa->expires = expires; diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c index 74095ddb4..f1a4efa3d 100644 --- a/usr.sbin/bgpd/printconf.c +++ b/usr.sbin/bgpd/printconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printconf.c,v 1.170 2024/03/20 09:35:46 claudio Exp $ */ +/* $OpenBSD: printconf.c,v 1.171 2024/04/09 09:03:18 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -916,37 +916,67 @@ void print_announce(struct peer_config *p, const char *c) { uint8_t aid; + int match = 0; if (p->announce_capa == 0) printf("%s\tannounce capabilities no\n", c); for (aid = AID_MIN; aid < AID_MAX; aid++) - if (p->capabilities.mp[aid]) + if (p->capabilities.mp[aid] == 2) { + printf("%s\tannounce %s enforce\n", c, aid2str(aid)); + match = 1; + } else if (p->capabilities.mp[aid]) { printf("%s\tannounce %s\n", c, aid2str(aid)); + match = 1; + } + if (!match) { + printf("%s\tannounce IPv4 none\n", c); + printf("%s\tannounce IPv6 none\n", c); + } - if (p->capabilities.refresh == 0) + if (p->capabilities.refresh == 2) + printf("%s\tannounce refresh enforce\n", c); + else if (p->capabilities.refresh == 0) printf("%s\tannounce refresh no\n", c); - if (p->capabilities.enhanced_rr == 1) + + if (p->capabilities.enhanced_rr == 2) + printf("%s\tannounce enhanced refresh enforce\n", c); + else if (p->capabilities.enhanced_rr == 1) printf("%s\tannounce enhanced refresh yes\n", c); - if (p->capabilities.grestart.restart == 0) + + if (p->capabilities.grestart.restart == 2) + printf("%s\tannounce restart enforce\n", c); + else if (p->capabilities.grestart.restart == 0) printf("%s\tannounce restart no\n", c); - if (p->capabilities.as4byte == 0) + + if (p->capabilities.as4byte == 2) + printf("%s\tannounce as4byte enforce\n", c); + else if (p->capabilities.as4byte == 0) printf("%s\tannounce as4byte no\n", c); - if (p->capabilities.add_path[0] & CAPA_AP_RECV) + + if (p->capabilities.add_path[AID_MIN] & CAPA_AP_RECV_ENFORCE) + printf("%s\tannounce add-path recv enforce\n", c); + else if (p->capabilities.add_path[AID_MIN] & CAPA_AP_RECV) printf("%s\tannounce add-path recv yes\n", c); - if (p->capabilities.add_path[0] & CAPA_AP_SEND) { + + if (p->capabilities.add_path[AID_MIN] & CAPA_AP_SEND) { printf("%s\tannounce add-path send %s", c, print_addpath_mode(p->eval.mode)); if (p->eval.extrapaths != 0) printf(" plus %d", p->eval.extrapaths); if (p->eval.maxpaths != 0) printf(" max %d", p->eval.maxpaths); + if (p->capabilities.add_path[AID_MIN] & CAPA_AP_SEND_ENFORCE) + printf(" enforce"); printf("\n"); } - if (p->capabilities.policy) { - printf("%s\tannounce policy %s\n", c, - p->capabilities.policy == 2 ? "enforce" : "yes"); - } + + if (p->capabilities.policy == 2) + printf("%s\tannounce policy enforce\n", c); + else if (p->capabilities.policy == 1) + printf("%s\tannounce policy yes\n", c); + else + printf("%s\tannounce policy no\n", c); } void diff --git a/usr.sbin/bgpd/rtr.c b/usr.sbin/bgpd/rtr.c index 4411e398e..43b471204 100644 --- a/usr.sbin/bgpd/rtr.c +++ b/usr.sbin/bgpd/rtr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr.c,v 1.20 2024/01/18 09:39:36 claudio Exp $ */ +/* $OpenBSD: rtr.c,v 1.21 2024/04/09 12:05:07 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -532,6 +532,14 @@ rtr_recalc(void) RB_FOREACH_REVERSE(aspa, aspa_tree, &at) { struct aspa_set as = { .as = aspa->as, .num = aspa->num }; + /* XXX prevent oversized IMSG for now */ + if (aspa->num * sizeof(*aspa->tas) > + MAX_IMSGSIZE - IMSG_HEADER_SIZE) { + log_warnx("oversized ASPA set for customer-as %s, %s", + log_as(aspa->as), "dropped"); + continue; + } + imsg_compose(ibuf_rde, IMSG_RECONF_ASPA, 0, 0, -1, &as, offsetof(struct aspa_set, tas)); imsg_compose(ibuf_rde, IMSG_RECONF_ASPA_TAS, 0, 0, -1, diff --git a/usr.sbin/bgpd/rtr_proto.c b/usr.sbin/bgpd/rtr_proto.c index 7ceda7970..ddb3ba4ff 100644 --- a/usr.sbin/bgpd/rtr_proto.c +++ b/usr.sbin/bgpd/rtr_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtr_proto.c,v 1.34 2024/03/22 15:41:34 claudio Exp $ */ +/* $OpenBSD: rtr_proto.c,v 1.35 2024/04/09 12:09:20 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -36,7 +36,8 @@ struct rtr_header { } __packed; #define RTR_MAX_VERSION 2 -#define RTR_MAX_LEN 2048 +#define RTR_MAX_PDU_SIZE 49152 /* XXX < IBUF_READ_SIZE */ +#define RTR_MAX_PDU_ERROR_SIZE 256 #define RTR_DEFAULT_REFRESH 3600 #define RTR_DEFAULT_RETRY 600 #define RTR_DEFAULT_EXPIRE 7200 @@ -272,7 +273,7 @@ rtr_newmsg(struct rtr_session *rs, enum rtr_pdu_type type, uint32_t len, struct ibuf *buf; int saved_errno; - if (len > RTR_MAX_LEN) { + if (len > RTR_MAX_PDU_SIZE) { errno = ERANGE; return NULL; } @@ -328,6 +329,11 @@ rtr_send_error(struct rtr_session *rs, struct ibuf *pdu, enum rtr_error err, if (pdu != NULL) { ibuf_rewind(pdu); len = ibuf_size(pdu); + if (len > RTR_MAX_PDU_ERROR_SIZE) { + len = RTR_MAX_PDU_ERROR_SIZE; + /* truncate down can not fail */ + ibuf_truncate(pdu, RTR_MAX_PDU_ERROR_SIZE); + } } buf = rtr_newmsg(rs, ERROR_REPORT, 2 * sizeof(uint32_t) + len + mlen, @@ -426,7 +432,7 @@ rtr_parse_header(struct rtr_session *rs, struct ibuf *hdr, len = ntohl(rh.length); - if (len > RTR_MAX_LEN) { + if (len > RTR_MAX_PDU_SIZE) { rtr_send_error(rs, hdr, CORRUPT_DATA, "%s: too big: %zu bytes", log_rtr_type(rh.type), len); return -1; @@ -754,6 +760,22 @@ rtr_parse_aspa(struct rtr_session *rs, struct ibuf *pdu) aspatree = &rs->aspa; } + /* treat ASPA records with too many SPAS like a withdraw */ + if (cnt > MAX_ASPA_SPAS_COUNT) { + struct aspa_set needle = { 0 }; + needle.as = ntohl(rtr_aspa.cas); + + log_warnx("rtr %s: oversized ASPA PDU: " + "imlicit withdraw of customerAS %s", + log_rtr(rs), log_as(needle.as)); + a = RB_FIND(aspa_tree, aspatree, &needle); + if (a != NULL) { + RB_REMOVE(aspa_tree, aspatree, a); + free_aspa(a); + } + return 0; + } + /* create aspa_set entry from the rtr aspa pdu */ if ((aspa = calloc(1, sizeof(*aspa))) == NULL) { rtr_send_error(rs, NULL, INTERNAL_ERROR, "out of memory"); diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index a5ce33808..769fa2d9b 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.467 2024/03/26 12:45:29 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.469 2024/04/10 09:05:32 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -89,7 +89,7 @@ int parse_update(struct peer *); int parse_rrefresh(struct peer *); int parse_notification(struct peer *); int parse_capabilities(struct peer *, u_char *, uint16_t, uint32_t *); -int capa_neg_calc(struct peer *, uint8_t *); +int capa_neg_calc(struct peer *); void session_dispatch_imsg(struct imsgbuf *, int, u_int *); void session_up(struct peer *); void session_down(struct peer *); @@ -1562,12 +1562,13 @@ session_open(struct peer *p) for (i = AID_MIN; i < AID_MAX; i++) { if (p->capa.ann.mp[i]) { errs += session_capa_add_afi(opb, - i, p->capa.ann.add_path[i]); + i, p->capa.ann.add_path[i] & + CAPA_AP_MASK); } } } else { /* AID_INET */ errs += session_capa_add_afi(opb, AID_INET, - p->capa.ann.add_path[AID_INET]); + p->capa.ann.add_path[AID_INET] & CAPA_AP_MASK); } } @@ -1719,8 +1720,16 @@ session_notification(struct peer *p, uint8_t errcode, uint8_t subcode, int errs = 0; size_t datalen = 0; - if (p->stats.last_sent_errcode) /* some notification already sent */ + switch (p->state) { + case STATE_OPENSENT: + case STATE_OPENCONFIRM: + case STATE_ESTABLISHED: + break; + default: + /* session not open, no need to send notification */ + log_notification(p, errcode, subcode, ibuf, "dropping"); return; + } log_notification(p, errcode, subcode, ibuf, "sending"); @@ -2167,7 +2176,7 @@ parse_open(struct peer *peer) uint16_t holdtime, oholdtime, myholdtime; uint32_t as, bgpid; uint16_t optparamlen, extlen, plen, op_len; - uint8_t op_type, suberr = 0; + uint8_t op_type; p = peer->rbuf->rptr; p += MSGSIZE_HEADER_MARKER; @@ -2350,8 +2359,7 @@ bad_len: return (-1); } - if (capa_neg_calc(peer, &suberr) == -1) { - session_notification(peer, ERR_OPEN, suberr, NULL); + if (capa_neg_calc(peer) == -1) { change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN); return (-1); } @@ -2735,9 +2743,10 @@ parse_capabilities(struct peer *peer, u_char *d, uint16_t dlen, uint32_t *as) } int -capa_neg_calc(struct peer *p, uint8_t *suberr) +capa_neg_calc(struct peer *p) { - uint8_t i, hasmp = 0; + struct ibuf *ebuf; + uint8_t i, hasmp = 0, capa_code, capa_len, capa_aid = 0; /* a capability is accepted only if both sides announced it */ @@ -2811,6 +2820,8 @@ capa_neg_calc(struct peer *p, uint8_t *suberr) */ memset(p->capa.neg.add_path, 0, sizeof(p->capa.neg.add_path)); for (i = AID_MIN; i < AID_MAX; i++) { + if (p->capa.neg.mp[i] == 0) + continue; if ((p->capa.ann.add_path[i] & CAPA_AP_RECV) && (p->capa.peer.add_path[i] & CAPA_AP_SEND)) { p->capa.neg.add_path[i] |= CAPA_AP_RECV; @@ -2836,43 +2847,112 @@ capa_neg_calc(struct peer *p, uint8_t *suberr) switch (p->conf.role) { case ROLE_PROVIDER: if (p->remote_role != ROLE_CUSTOMER) - goto fail; + goto policyfail; break; case ROLE_RS: if (p->remote_role != ROLE_RS_CLIENT) - goto fail; + goto policyfail; break; case ROLE_RS_CLIENT: if (p->remote_role != ROLE_RS) - goto fail; + goto policyfail; break; case ROLE_CUSTOMER: if (p->remote_role != ROLE_PROVIDER) - goto fail; + goto policyfail; break; case ROLE_PEER: if (p->remote_role != ROLE_PEER) - goto fail; + goto policyfail; break; default: - fail: + policyfail: log_peer_warnx(&p->conf, "open policy role mismatch: " "our role %s, their role %s", log_policy(p->conf.role), log_policy(p->remote_role)); - *suberr = ERR_OPEN_ROLE; + session_notification(p, ERR_OPEN, ERR_OPEN_ROLE, NULL); return (-1); } p->capa.neg.policy = 1; - } else if (p->capa.ann.policy == 2 && p->conf.ebgp) { - /* enforce presence of open policy role capability */ + } + + /* enforce presence of open policy role capability */ + if (p->capa.ann.policy == 2 && p->capa.peer.policy == 0 && + p->conf.ebgp) { log_peer_warnx(&p->conf, "open policy role enforced but " "not present"); - *suberr = ERR_OPEN_ROLE; + session_notification(p, ERR_OPEN, ERR_OPEN_ROLE, NULL); return (-1); } + /* enforce presence of other capabilities */ + if (p->capa.ann.refresh == 2 && p->capa.neg.refresh == 0) { + capa_code = CAPA_REFRESH; + capa_len = 0; + goto fail; + } + if (p->capa.ann.enhanced_rr == 2 && p->capa.neg.enhanced_rr == 0) { + capa_code = CAPA_ENHANCED_RR; + capa_len = 0; + goto fail; + } + if (p->capa.ann.as4byte == 2 && p->capa.neg.as4byte == 0) { + capa_code = CAPA_AS4BYTE; + capa_len = 4; + goto fail; + } + if (p->capa.ann.grestart.restart == 2 && + p->capa.neg.grestart.restart == 0) { + capa_code = CAPA_RESTART; + capa_len = 2; + goto fail; + } + for (i = AID_MIN; i < AID_MAX; i++) { + if (p->capa.ann.mp[i] == 2 && p->capa.neg.mp[i] == 0) { + capa_code = CAPA_MP; + capa_len = 4; + capa_aid = i; + goto fail; + } + } + + for (i = AID_MIN; i < AID_MAX; i++) { + if (p->capa.neg.mp[i] == 0) + continue; + if ((p->capa.ann.add_path[i] & CAPA_AP_RECV_ENFORCE) && + (p->capa.neg.add_path[i] & CAPA_AP_RECV) == 0) { + capa_code = CAPA_ADD_PATH; + capa_len = 4; + capa_aid = i; + goto fail; + } + if ((p->capa.ann.add_path[i] & CAPA_AP_SEND_ENFORCE) && + (p->capa.neg.add_path[i] & CAPA_AP_SEND) == 0) { + capa_code = CAPA_ADD_PATH; + capa_len = 4; + capa_aid = i; + goto fail; + } + } + return (0); + + fail: + if ((ebuf = ibuf_dynamic(2, 256)) == NULL) + return (-1); + /* best effort, no problem if it fails */ + session_capa_add(ebuf, capa_code, capa_len); + if (capa_code == CAPA_MP) + session_capa_add_mp(ebuf, capa_aid); + else if (capa_code == CAPA_ADD_PATH) + session_capa_add_afi(ebuf, capa_aid, 0); + else if (capa_len > 0) + ibuf_add_zero(ebuf, capa_len); + + session_notification(p, ERR_OPEN, ERR_OPEN_CAPA, ebuf); + ibuf_free(ebuf); + return (-1); } void diff --git a/usr.sbin/httpd/proc.c b/usr.sbin/httpd/proc.c index 58ea14cc0..6b0461eaf 100644 --- a/usr.sbin/httpd/proc.c +++ b/usr.sbin/httpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.44 2024/04/08 12:45:18 tobhe Exp $ */ +/* $OpenBSD: proc.c,v 1.45 2024/04/09 15:48:01 tobhe Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter @@ -37,7 +37,7 @@ #include "httpd.h" void proc_exec(struct privsep *, struct privsep_proc *, unsigned int, int, - int, char **); + char **); void proc_setup(struct privsep *, struct privsep_proc *, unsigned int); void proc_open(struct privsep *, int, int); void proc_accept(struct privsep *, int, enum privsep_procid, @@ -68,7 +68,7 @@ proc_getid(struct privsep_proc *procs, unsigned int nproc, void proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, - int debug, int argc, char **argv) + int argc, char **argv) { unsigned int proc, nargc, i, proc_i; char **nargv; @@ -117,10 +117,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, fatal("%s: fork", __func__); break; case 0: - /* First create a new session */ - if (setsid() == -1) - fatal("setsid"); - /* Prepare parent socket. */ if (fd != PROC_PARENT_SOCK_FILENO) { if (dup2(fd, PROC_PARENT_SOCK_FILENO) @@ -129,16 +125,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } else if (fcntl(fd, F_SETFD, 0) == -1) fatal("fcntl"); - /* Daemons detach from terminal. */ - if (!debug && (fd = - open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { - (void)dup2(fd, STDIN_FILENO); - (void)dup2(fd, STDOUT_FILENO); - (void)dup2(fd, STDERR_FILENO); - if (fd > 2) - (void)close(fd); - } - execvp(argv[0], nargv); fatal("%s: execvp", __func__); break; @@ -232,7 +218,7 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } /* Engage! */ - proc_exec(ps, procs, nproc, debug, argc, argv); + proc_exec(ps, procs, nproc, argc, argv); return; } @@ -526,9 +512,6 @@ proc_run(struct privsep *ps, struct privsep_proc *p, log_procinit(p->p_title); - /* Set the process group of the current process */ - setpgid(0, 0); - if (p->p_id == PROC_CONTROL && ps->ps_instance == 0) { if (control_init(ps, &ps->ps_csock) == -1) fatalx("%s: control_init", __func__); diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c index 61355cdb5..8d5cb109c 100644 --- a/usr.sbin/snmpd/proc.c +++ b/usr.sbin/snmpd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.31 2024/04/08 13:18:54 tobhe Exp $ */ +/* $OpenBSD: proc.c,v 1.32 2024/04/09 15:48:01 tobhe Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter @@ -37,7 +37,7 @@ #include "snmpd.h" void proc_exec(struct privsep *, struct privsep_proc *, unsigned int, int, - int, char **); + char **); void proc_setup(struct privsep *, struct privsep_proc *, unsigned int); void proc_open(struct privsep *, int, int); void proc_accept(struct privsep *, int, enum privsep_procid, @@ -68,7 +68,7 @@ proc_getid(struct privsep_proc *procs, unsigned int nproc, void proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, - int debug, int argc, char **argv) + int argc, char **argv) { unsigned int proc, nargc, i, proc_i; char **nargv; @@ -117,10 +117,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, fatal("%s: fork", __func__); break; case 0: - /* First create a new session */ - if (setsid() == -1) - fatal("setsid"); - /* Prepare parent socket. */ if (fd != PROC_PARENT_SOCK_FILENO) { if (dup2(fd, PROC_PARENT_SOCK_FILENO) @@ -129,16 +125,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } else if (fcntl(fd, F_SETFD, 0) == -1) fatal("fcntl"); - /* Daemons detach from terminal. */ - if (!debug && (fd = - open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { - (void)dup2(fd, STDIN_FILENO); - (void)dup2(fd, STDOUT_FILENO); - (void)dup2(fd, STDERR_FILENO); - if (fd > 2) - (void)close(fd); - } - execvp(argv[0], nargv); fatal("%s: execvp", __func__); break; @@ -232,7 +218,7 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } /* Engage! */ - proc_exec(ps, procs, nproc, debug, argc, argv); + proc_exec(ps, procs, nproc, argc, argv); return; } @@ -518,9 +504,6 @@ proc_run(struct privsep *ps, struct privsep_proc *p, log_procinit(p->p_title); - /* Set the process group of the current process */ - setpgid(0, 0); - /* Use non-standard user */ if (p->p_pw != NULL) pw = p->p_pw; diff --git a/usr.sbin/vmctl/main.c b/usr.sbin/vmctl/main.c index b4c10561d..6621169dc 100644 --- a/usr.sbin/vmctl/main.c +++ b/usr.sbin/vmctl/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.75 2023/04/28 19:46:41 dv Exp $ */ +/* $OpenBSD: main.c,v 1.76 2024/04/10 13:03:41 dv Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -648,8 +648,6 @@ ctl_convert(const char *srcfile, const char *dstfile, int dsttype, size_t dstsiz if (dstsize == 0) dstsize = src.size; - else - dstsize *= 1048576; if (dstsize < (size_t)src.size) { errstr = "size cannot be smaller than input disk size"; goto done; diff --git a/usr.sbin/vmd/proc.c b/usr.sbin/vmd/proc.c index 6b5050187..950c17d6e 100644 --- a/usr.sbin/vmd/proc.c +++ b/usr.sbin/vmd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.24 2024/04/08 12:48:26 tobhe Exp $ */ +/* $OpenBSD: proc.c,v 1.25 2024/04/09 15:48:01 tobhe Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter @@ -37,7 +37,7 @@ #include "proc.h" void proc_exec(struct privsep *, struct privsep_proc *, unsigned int, int, - int, char **); + char **); void proc_setup(struct privsep *, struct privsep_proc *, unsigned int); void proc_open(struct privsep *, int, int); void proc_accept(struct privsep *, int, enum privsep_procid, @@ -68,7 +68,7 @@ proc_getid(struct privsep_proc *procs, unsigned int nproc, void proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, - int debug, int argc, char **argv) + int argc, char **argv) { unsigned int proc, nargc, i, proc_i; char **nargv; @@ -117,10 +117,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, fatal("%s: fork", __func__); break; case 0: - /* First create a new session */ - if (setsid() == -1) - fatal("setsid"); - /* Prepare parent socket. */ if (fd != PROC_PARENT_SOCK_FILENO) { if (dup2(fd, PROC_PARENT_SOCK_FILENO) @@ -129,16 +125,6 @@ proc_exec(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } else if (fcntl(fd, F_SETFD, 0) == -1) fatal("fcntl"); - /* Daemons detach from terminal. */ - if (!debug && (fd = - open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { - (void)dup2(fd, STDIN_FILENO); - (void)dup2(fd, STDOUT_FILENO); - (void)dup2(fd, STDERR_FILENO); - if (fd > 2) - (void)close(fd); - } - execvp(argv[0], nargv); fatal("%s: execvp", __func__); break; @@ -232,7 +218,7 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, } /* Engage! */ - proc_exec(ps, procs, nproc, debug, argc, argv); + proc_exec(ps, procs, nproc, argc, argv); return; } @@ -519,9 +505,6 @@ proc_run(struct privsep *ps, struct privsep_proc *p, log_procinit("%s", p->p_title); - /* Set the process group of the current process */ - setpgid(0, 0); - if (p->p_id == PROC_CONTROL && ps->ps_instance == 0) { if (control_init(ps, &ps->ps_csock) == -1) fatalx("%s: control_init", __func__); diff --git a/usr.sbin/vmd/vm.c b/usr.sbin/vmd/vm.c index 86d576934..d5bfe7a76 100644 --- a/usr.sbin/vmd/vm.c +++ b/usr.sbin/vmd/vm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vm.c,v 1.98 2024/02/20 21:40:37 dv Exp $ */ +/* $OpenBSD: vm.c,v 1.99 2024/04/09 21:55:16 dv Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -1536,7 +1536,6 @@ vcpu_run_loop(void *arg) { struct vm_run_params *vrp = (struct vm_run_params *)arg; intptr_t ret = 0; - int irq; uint32_t n; vrp->vrp_continue = 0; @@ -1611,10 +1610,10 @@ vcpu_run_loop(void *arg) } if (vrp->vrp_irqready && i8259_is_pending()) { - irq = i8259_ack(); - vrp->vrp_irq = irq; + vrp->vrp_inject.vie_vector = i8259_ack(); + vrp->vrp_inject.vie_type = VCPU_INJECT_INTR; } else - vrp->vrp_irq = 0xFFFF; + vrp->vrp_inject.vie_type = VCPU_INJECT_NONE; /* Still more interrupts pending? */ vrp->vrp_intr_pending = i8259_is_pending();