security/boringssl: update to the recent commit

Remove added to the upstream patches.
This commit is contained in:
Sergey A. Osokin 2022-10-12 11:27:13 -04:00
parent addedd02c4
commit dcd4f65b1a
5 changed files with 5 additions and 137 deletions

View File

@ -1,5 +1,5 @@
PORTNAME= boringssl
PORTVERSION= 0.0.0.0.2022.10.11.01
PORTVERSION= 0.0.0.0.2022.10.12.01
CATEGORIES= security
MAINTAINER= osa@FreeBSD.org
@ -19,7 +19,7 @@ CPE_VENDOR= google
USE_GITHUB= yes
GH_ACCOUNT= google
GH_TAGNAME= 1783227
GH_TAGNAME= d66bba9
GH_TUPLE= golang:crypto:c07d793c2f9a:golang_crypto/vendor/golang.org/x/crypto \
golang:net:04defd469f4e:golang_net/vendor/golang.org/x/net \
golang:sys:04245dca01da:golang_sys/vendor/golang.org/x/sys \

View File

@ -1,6 +1,6 @@
TIMESTAMP = 1665579192
SHA256 (google-boringssl-0.0.0.0.2022.10.11.01-1783227_GH0.tar.gz) = 00e7bdce6ec9bc434e3ebb2e1dc1d0245282414cb0ef1e37d7a56b5273b87e79
SIZE (google-boringssl-0.0.0.0.2022.10.11.01-1783227_GH0.tar.gz) = 30977360
TIMESTAMP = 1665588245
SHA256 (google-boringssl-0.0.0.0.2022.10.12.01-d66bba9_GH0.tar.gz) = c62a19fffaf57b75b0ccb011d3796c418e3fe1f8ff7f1c6aea6c9749e7e7c785
SIZE (google-boringssl-0.0.0.0.2022.10.12.01-d66bba9_GH0.tar.gz) = 30975262
SHA256 (golang-crypto-c07d793c2f9a_GH0.tar.gz) = bd1e0856c43287c6ebd20d59e2b4f2ffa91c5cc275dbb02bb2cfc822e6dc18a4
SIZE (golang-crypto-c07d793c2f9a_GH0.tar.gz) = 1732023
SHA256 (golang-net-04defd469f4e_GH0.tar.gz) = 6009a6f0989341df975799276ff1c49af650d4a4ed3fd6db3501b91eb601810d

View File

@ -1,17 +1,5 @@
--- crypto/CMakeLists.txt.orig 2022-07-25 14:53:51.000000000 -0400
+++ crypto/CMakeLists.txt 2022-07-26 12:18:36.169803000 -0400
@@ -264,9 +264,11 @@
cipher_extra/tls_cbc.c
conf/conf.c
cpu_aarch64_apple.c
+ cpu_aarch64_freebsd.c
cpu_aarch64_fuchsia.c
cpu_aarch64_linux.c
cpu_aarch64_win.c
+ cpu_arm_freebsd.c
cpu_arm_linux.c
cpu_arm.c
cpu_intel.c
@@ -464,6 +466,7 @@
endif()

View File

@ -1,65 +0,0 @@
--- /dev/null 2022-07-26 12:16:14.406018000 -0400
+++ crypto/cpu_aarch64_freebsd.c 2022-07-26 12:15:28.130832000 -0400
@@ -0,0 +1,62 @@
+/* Copyright (c) 2016, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or 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 "internal.h"
+
+#if defined(OPENSSL_AARCH64)
+
+
+#include <openssl/arm_arch.h>
+
+
+extern uint32_t OPENSSL_armcap_P;
+
+#if defined(OPENSSL_FREEBSD)
+#include <sys/types.h>
+#include <machine/_stdint.h>
+#include <machine/armreg.h>
+#endif
+
+#ifndef ID_AA64ISAR0_AES_VAL
+#define ID_AA64ISAR0_AES_VAL ID_AA64ISAR0_AES
+#endif
+#ifndef ID_AA64ISAR0_SHA1_VAL
+#define ID_AA64ISAR0_SHA1_VAL ID_AA64ISAR0_SHA1
+#endif
+#ifndef ID_AA64ISAR0_SHA2_VAL
+#define ID_AA64ISAR0_SHA2_VAL ID_AA64ISAR0_SHA2
+#endif
+
+void OPENSSL_cpuid_setup(void) {
+ uint64_t id_aa64isar0;
+
+ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
+
+ OPENSSL_armcap_P |= ARMV7_NEON;
+
+ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) >= ID_AA64ISAR0_AES_BASE) {
+ OPENSSL_armcap_P |= ARMV8_AES;
+ }
+ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL) {
+ OPENSSL_armcap_P |= ARMV8_PMULL;
+ }
+ if (ID_AA64ISAR0_SHA1_VAL(id_aa64isar0) == ID_AA64ISAR0_SHA1_BASE) {
+ OPENSSL_armcap_P |= ARMV8_SHA1;
+ }
+ if (ID_AA64ISAR0_SHA2_VAL(id_aa64isar0) >= ID_AA64ISAR0_SHA2_BASE) {
+ OPENSSL_armcap_P |= ARMV8_SHA256;
+ }
+}
+
+#endif // OPENSSL_AARCH64

View File

@ -1,55 +0,0 @@
--- crypto/cpu_arm_freebsd.c.orig 2022-07-24 00:49:45 UTC
+++ crypto/cpu_arm_freebsd.c
@@ -0,0 +1,52 @@
+/* Copyright (c) 2016, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or 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 "internal.h"
+
+#if defined(OPENSSL_ARM) && defined(OPENSSL_FREEBSD) && \
+ !defined(OPENSSL_STATIC_ARMCAP)
+#include <sys/types.h>
+#include <sys/auxv.h>
+
+#include <openssl/arm_arch.h>
+#include <openssl/mem.h>
+
+extern uint32_t OPENSSL_armcap_P;
+
+void OPENSSL_cpuid_setup(void) {
+ unsigned long hwcap = 0, hwcap2 = 0;
+
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap);
+ elf_aux_info(AT_HWCAP2, &hwcap2, sizeof hwcap2);
+
+ // Matching OpenSSL, only report other features if NEON is present.
+ if (hwcap & HWCAP_NEON) {
+ OPENSSL_armcap_P |= ARMV7_NEON;
+
+ if (hwcap2 & HWCAP2_AES) {
+ OPENSSL_armcap_P |= ARMV8_AES;
+ }
+ if (hwcap2 & HWCAP2_PMULL) {
+ OPENSSL_armcap_P |= ARMV8_PMULL;
+ }
+ if (hwcap2 & HWCAP2_SHA1) {
+ OPENSSL_armcap_P |= ARMV8_SHA1;
+ }
+ if (hwcap2 & HWCAP2_SHA2) {
+ OPENSSL_armcap_P |= ARMV8_SHA256;
+ }
+ }
+}
+
+#endif // OPENSSL_ARM && OPENSSL_OPENBSD && !OPENSSL_STATIC_ARMCAP