git: 494cfc7c54ee - main - security/boringssl: update to the recent commit

From: Sergey A. Osokin <osa_at_FreeBSD.org>
Date: Thu, 06 Jan 2022 15:55:56 UTC
The branch main has been updated by osa:

URL: https://cgit.FreeBSD.org/ports/commit/?id=494cfc7c54ee4bcb4937242c4ffae916151092dd

commit 494cfc7c54ee4bcb4937242c4ffae916151092dd
Author:     Sergey A. Osokin <osa@FreeBSD.org>
AuthorDate: 2022-01-06 15:45:30 +0000
Commit:     Sergey A. Osokin <osa@FreeBSD.org>
CommitDate: 2022-01-06 15:55:50 +0000

    security/boringssl: update to the recent commit
    
    The following commit [1], enables SHA-512 ARM acceleration when
    available, so the patch-crypto_cpu_aarch64_linux.c needs to be
    reviewed and updated.
    
    References:
    [1] https://boringssl.googlesource.com/boringssl/+/1e15682f1a4bb64c48b84884976a2b5c4201e878%5E%21/#F5
---
 security/boringssl/Makefile                        |  5 ++---
 security/boringssl/distinfo                        |  6 +++---
 ...64-linux.c => patch-crypto_cpu_aarch64_linux.c} | 23 +++++++++++++---------
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/security/boringssl/Makefile b/security/boringssl/Makefile
index 815a71d24774..3de7280cd4d7 100644
--- a/security/boringssl/Makefile
+++ b/security/boringssl/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	boringssl
-PORTVERSION=	0.0.0.0.2021.12.21.01
-PORTREVISION=	3
+PORTVERSION=	0.0.0.0.2022.01.05.01
 CATEGORIES=	security
 
 MAINTAINER=	osa@FreeBSD.org
@@ -21,7 +20,7 @@ CPE_VENDOR=	google
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	google
-GH_TAGNAME=	9bcc12d
+GH_TAGNAME=	295b313
 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 \
diff --git a/security/boringssl/distinfo b/security/boringssl/distinfo
index e2ac64e11294..0dd914cbdba4 100644
--- a/security/boringssl/distinfo
+++ b/security/boringssl/distinfo
@@ -1,6 +1,6 @@
-TIMESTAMP = 1641280446
-SHA256 (google-boringssl-0.0.0.0.2021.12.21.01-9bcc12d_GH0.tar.gz) = 529e77f24d8a1e5286ab9cd1fc649e8ffe484d7d149c4889650067bc2537f274
-SIZE (google-boringssl-0.0.0.0.2021.12.21.01-9bcc12d_GH0.tar.gz) = 30725757
+TIMESTAMP = 1641475926
+SHA256 (google-boringssl-0.0.0.0.2022.01.05.01-295b313_GH0.tar.gz) = b85cf7a822752612438333c9910957b9a085a303136b81f88c0dbb7e4676ae42
+SIZE (google-boringssl-0.0.0.0.2022.01.05.01-295b313_GH0.tar.gz) = 30725404
 SHA256 (golang-crypto-c07d793c2f9a_GH0.tar.gz) = bd1e0856c43287c6ebd20d59e2b4f2ffa91c5cc275dbb02bb2cfc822e6dc18a4
 SIZE (golang-crypto-c07d793c2f9a_GH0.tar.gz) = 1732023
 SHA256 (golang-net-04defd469f4e_GH0.tar.gz) = 6009a6f0989341df975799276ff1c49af650d4a4ed3fd6db3501b91eb601810d
diff --git a/security/boringssl/files/patch-crypto_cpu-aarch64-linux.c b/security/boringssl/files/patch-crypto_cpu_aarch64_linux.c
similarity index 79%
rename from security/boringssl/files/patch-crypto_cpu-aarch64-linux.c
rename to security/boringssl/files/patch-crypto_cpu_aarch64_linux.c
index 479b9e76a46d..68403a2b75dd 100644
--- a/security/boringssl/files/patch-crypto_cpu-aarch64-linux.c
+++ b/security/boringssl/files/patch-crypto_cpu_aarch64_linux.c
@@ -1,6 +1,6 @@
---- crypto/cpu-aarch64-linux.c.orig	2019-12-02 17:52:12 UTC
-+++ crypto/cpu-aarch64-linux.c
-@@ -14,49 +14,46 @@
+--- crypto/cpu_aarch64_linux.c.orig	2022-01-05 15:30:33.000000000 -0500
++++ crypto/cpu_aarch64_linux.c	2022-01-06 10:24:03.703277000 -0500
+@@ -14,10 +14,8 @@
  
  #include <openssl/cpu.h>
  
@@ -9,19 +9,20 @@
 +#if defined(OPENSSL_AARCH64)
  
 -#include <sys/auxv.h>
--
+ 
  #include <openssl/arm_arch.h>
  
- #include "internal.h"
+@@ -26,41 +24,41 @@
  
--
  extern uint32_t OPENSSL_armcap_P;
  
 -void OPENSSL_cpuid_setup(void) {
 -  unsigned long hwcap = getauxval(AT_HWCAP);
++#if defined(OPENSSL_FREEBSD)
 +#include <sys/types.h>
 +#include <machine/_stdint.h>
 +#include <machine/armreg.h>
++#endif
  
 -  // See /usr/include/asm/hwcap.h on an aarch64 installation for the source of
 -  // these values.
@@ -30,6 +31,7 @@
 -  static const unsigned long kPMULL = 1 << 4;
 -  static const unsigned long kSHA1 = 1 << 5;
 -  static const unsigned long kSHA256 = 1 << 6;
+-  static const unsigned long kSHA512 = 1 << 21;
 +#ifndef ID_AA64ISAR0_AES_VAL
 +#define ID_AA64ISAR0_AES_VAL ID_AA64ISAR0_AES
 +#endif
@@ -65,10 +67,13 @@
      OPENSSL_armcap_P |= ARMV8_SHA1;
    }
 -  if (hwcap & kSHA256) {
-+  if(ID_AA64ISAR0_SHA2_VAL(id_aa64isar0) >= ID_AA64ISAR0_SHA2_BASE) {
++  if (ID_AA64ISAR0_SHA2_VAL(id_aa64isar0) >= ID_AA64ISAR0_SHA2_BASE) {
      OPENSSL_armcap_P |= ARMV8_SHA256;
    }
+-  if (hwcap & kSHA512) {
+-    OPENSSL_armcap_P |= ARMV8_SHA512;
+-  }
  }
--
--#endif  // OPENSSL_AARCH64 && !OPENSSL_STATIC_ARMCAP
+ 
+-#endif  // OPENSSL_AARCH64 && OPENSSL_LINUX && !OPENSSL_STATIC_ARMCAP
 +#endif  // OPENSSL_AARCH64