Skip to content

Commit

Permalink
project: Update for 3.7.1 merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Mar 29, 2021
1 parent ff87fab commit 63836e5
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 42 deletions.
30 changes: 23 additions & 7 deletions SMP/SMP.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/lib/accelerated/x86/x86-common.c b/lib/accelerated/x86/x86-common.c
index 3845c6b4c..a1111a6f3 100644
index 80d37f49d..56688ae3e 100644
--- a/lib/accelerated/x86/x86-common.c
+++ b/lib/accelerated/x86/x86-common.c
@@ -40,6 +40,35 @@
Expand Down Expand Up @@ -61,7 +61,7 @@ index 35b9e3b97..e19211146 100644
{
if (dat->data != NULL) {
diff --git a/lib/debug.c b/lib/debug.c
index 166dd61ca..bb81ddce4 100644
index 166dd61ca..2c391feba 100644
--- a/lib/debug.c
+++ b/lib/debug.c
@@ -31,7 +31,11 @@
Expand All @@ -81,7 +81,7 @@ index 166dd61ca..bb81ddce4 100644
_gnutls_dump_vector(const char *prefix, const uint8_t * a, size_t a_size)
{
+#if defined(_MSC_VER)
+ char * buf_hex = (char *)_alloca((2 * a_size + 1)*sizeof(char));
+ char* buf_hex = (char*)_alloca((2 * a_size + 1) * sizeof(char));
+#else
char buf_hex[2 * a_size + 1];
+#endif
Expand Down Expand Up @@ -150,11 +150,11 @@ index 9a65d114c..46d2b1a4f 100644
const char *e;

diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in
index 264da238a..8a177bb88 100644
index b3f7185e9..86c74164a 100644
--- a/lib/includes/gnutls/gnutls.h.in
+++ b/lib/includes/gnutls/gnutls.h.in
@@ -38,7 +38,12 @@
#define GNUTLS_H
@@ -37,7 +37,12 @@
#define GNUTLS_GNUTLS_H

/* Get ssize_t. */
+#ifdef _MSC_VER
Expand All @@ -167,7 +167,7 @@ index 264da238a..8a177bb88 100644
/* Get size_t. */
#include <stddef.h>
diff --git a/lib/system/fastopen.c b/lib/system/fastopen.c
index 8d8409e48..6b0fa7d49 100644
index a904e3794..ef740c184 100644
--- a/lib/system/fastopen.c
+++ b/lib/system/fastopen.c
@@ -26,7 +26,9 @@
Expand All @@ -180,6 +180,22 @@ index 8d8409e48..6b0fa7d49 100644
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/lib/system/sockets.c b/lib/system/sockets.c
index 5990d2dfa..469b3a2be 100644
--- a/lib/system/sockets.c
+++ b/lib/system/sockets.c
@@ -84,7 +84,11 @@ ssize_t
system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
int iovec_cnt)
{
+#if defined(_MSC_VER)
+ WSABUF* bufs = (WSABUF*)_alloca(iovec_cnt * sizeof(WSABUF));
+#else
WSABUF bufs[iovec_cnt];
+#endif
DWORD bytes_sent;
int to_send_cnt = 0;
size_t to_send_bytes = 0;
diff --git a/lib/x509/hostname-verify.c b/lib/x509/hostname-verify.c
index 6ef8ba030..378b29c90 100644
--- a/lib/x509/hostname-verify.c
Expand Down
9 changes: 9 additions & 0 deletions SMP/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2305,6 +2305,15 @@ _GL_UNUSED_LABEL should be used with a trailing ;*/
# define _GL_ATTRIBUTE_FALLTHROUGH /* empty */
#endif

/* The deprecated attribute was added in gcc 3.1.*/
# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1)
# define _GL_ATTRIBUTE_DEPRECATED /* empty */
# else
# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
# endif

#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))

#ifndef WORD_BIT
/* Assume 'int' is 32 bits wide.*/
# define WORD_BIT 32
Expand Down
18 changes: 9 additions & 9 deletions SMP/gnulib/lib/unistr.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/* Get bool. */
#include <stdbool.h>

/* Get size_t. */
/* Get size_t, ptrdiff_t. */
#include <stddef.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -305,13 +305,13 @@ extern int
#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */
extern int
u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n);
# if !HAVE_INLINE
extern int
u8_uctomb (uint8_t *s, ucs4_t uc, int n);
u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n);
# else
static inline int
u8_uctomb (uint8_t *s, ucs4_t uc, int n)
u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n)
{
if (uc < 0x80 && n > 0)
{
Expand All @@ -327,13 +327,13 @@ u8_uctomb (uint8_t *s, ucs4_t uc, int n)
#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */
extern int
u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
u16_uctomb_aux (uint16_t *s, ucs4_t uc, ptrdiff_t n);
# if !HAVE_INLINE
extern int
u16_uctomb (uint16_t *s, ucs4_t uc, int n);
u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n);
# else
static inline int
u16_uctomb (uint16_t *s, ucs4_t uc, int n)
u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n)
{
if (uc < 0xd800 && n > 0)
{
Expand All @@ -349,10 +349,10 @@ u16_uctomb (uint16_t *s, ucs4_t uc, int n)
#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
# if !HAVE_INLINE
extern int
u32_uctomb (uint32_t *s, ucs4_t uc, int n);
u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n);
# else
static inline int
u32_uctomb (uint32_t *s, ucs4_t uc, int n)
u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n)
{
if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000))
{
Expand Down
8 changes: 5 additions & 3 deletions SMP/gnulib/lib/unitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ typedef uint32_t ucs4_t;
/* Attribute of a function whose result depends only on the arguments
(not pointers!) and which has no side effects. */
#ifndef _UC_ATTRIBUTE_CONST
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined __clang__
# define _UC_ATTRIBUTE_CONST __attribute__ ((__const__))
# else
# define _UC_ATTRIBUTE_CONST
Expand All @@ -36,7 +36,7 @@ typedef uint32_t ucs4_t;
/* Attribute of a function whose result depends only on the arguments
(possibly pointers) and global memory, and which has no side effects. */
#ifndef _UC_ATTRIBUTE_PURE
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
# define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
# define _UC_ATTRIBUTE_PURE
Expand All @@ -47,7 +47,9 @@ typedef uint32_t ucs4_t;
pass a pointer to a different object in the specified pointer argument
than in the other pointer arguments. */
#ifndef _UC_RESTRICT
# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__)
# if defined __restrict \
|| 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
|| __clang_major__ >= 3
# define _UC_RESTRICT __restrict
# elif 199901L <= __STDC_VERSION__ || defined restrict
# define _UC_RESTRICT restrict
Expand Down
6 changes: 3 additions & 3 deletions SMP/gnutls/gnutls.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ extern "C" {
#endif
/* *INDENT-ON* */

#define GNUTLS_VERSION "3.7.0"
#define GNUTLS_VERSION "3.7.1"

#define GNUTLS_VERSION_MAJOR 3
#define GNUTLS_VERSION_MINOR 7
#define GNUTLS_VERSION_PATCH 0
#define GNUTLS_VERSION_PATCH 1

#define GNUTLS_VERSION_NUMBER 0x030700
#define GNUTLS_VERSION_NUMBER 0x030701

#define GNUTLS_CIPHER_RIJNDAEL_128_CBC GNUTLS_CIPHER_AES_128_CBC
#define GNUTLS_CIPHER_RIJNDAEL_256_CBC GNUTLS_CIPHER_AES_256_CBC
Expand Down
4 changes: 4 additions & 0 deletions SMP/lib/accelerated/x86/coff/aesni-gcm-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ section .text code align=64

ALIGN 32
_aesni_ctr32_ghash_6x:

vmovdqu xmm2,XMMWORD[32+r11]
sub rdx,6
vpxor xmm4,xmm4,xmm4
Expand Down Expand Up @@ -316,6 +317,7 @@ $L$6x_done:

DB 0F3h,0C3h ;repret


global aesni_gcm_decrypt

ALIGN 32
Expand Down Expand Up @@ -457,6 +459,7 @@ $L$SEH_end_aesni_gcm_decrypt:

ALIGN 32
_aesni_ctr32_6x:

vmovdqu xmm4,XMMWORD[((0-128))+rcx]
vmovdqu xmm2,XMMWORD[32+r11]
lea r13,[((-1))+rbp]
Expand Down Expand Up @@ -545,6 +548,7 @@ $L$handle_ctr32_2:
jmp NEAR $L$oop_ctr32



global aesni_gcm_encrypt

ALIGN 32
Expand Down
18 changes: 17 additions & 1 deletion SMP/lib/accelerated/x86/coff/aesni-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,7 @@ $L$SEH_begin_aesni_ccm64_encrypt_blocks:
mov r9,QWORD[48+rsp]



lea rsp,[((-88))+rsp]
movaps XMMWORD[rsp],xmm6
movaps XMMWORD[16+rsp],xmm7
Expand Down Expand Up @@ -983,6 +984,7 @@ $L$ccm64_enc_ret:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret

$L$SEH_end_aesni_ccm64_encrypt_blocks:
global aesni_ccm64_decrypt_blocks

Expand All @@ -1000,6 +1002,7 @@ $L$SEH_begin_aesni_ccm64_decrypt_blocks:
mov r9,QWORD[48+rsp]



lea rsp,[((-88))+rsp]
movaps XMMWORD[rsp],xmm6
movaps XMMWORD[16+rsp],xmm7
Expand Down Expand Up @@ -1110,6 +1113,7 @@ $L$ccm64_dec_ret:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret

$L$SEH_end_aesni_ccm64_decrypt_blocks:
global aesni_ctr32_encrypt_blocks

Expand Down Expand Up @@ -3019,6 +3023,7 @@ $L$SEH_end_aesni_ocb_encrypt:

ALIGN 32
__ocb_encrypt6:

pxor xmm15,xmm9
movdqu xmm11,XMMWORD[r12*1+rbx]
movdqa xmm12,xmm10
Expand Down Expand Up @@ -3119,8 +3124,10 @@ DB 102,65,15,56,221,255




ALIGN 32
__ocb_encrypt4:

pxor xmm15,xmm9
movdqu xmm11,XMMWORD[r12*1+rbx]
movdqa xmm12,xmm10
Expand Down Expand Up @@ -3188,8 +3195,10 @@ DB 102,65,15,56,221,237




ALIGN 32
__ocb_encrypt1:

pxor xmm7,xmm15
pxor xmm7,xmm9
pxor xmm8,xmm2
Expand Down Expand Up @@ -3222,6 +3231,7 @@ DB 102,15,56,221,215
DB 0F3h,0C3h ;repret



global aesni_ocb_decrypt

ALIGN 32
Expand Down Expand Up @@ -3493,6 +3503,7 @@ $L$SEH_end_aesni_ocb_decrypt:

ALIGN 32
__ocb_decrypt6:

pxor xmm15,xmm9
movdqu xmm11,XMMWORD[r12*1+rbx]
movdqa xmm12,xmm10
Expand Down Expand Up @@ -3587,8 +3598,10 @@ DB 102,65,15,56,223,255




ALIGN 32
__ocb_decrypt4:

pxor xmm15,xmm9
movdqu xmm11,XMMWORD[r12*1+rbx]
movdqa xmm12,xmm10
Expand Down Expand Up @@ -3652,8 +3665,10 @@ DB 102,65,15,56,223,237




ALIGN 32
__ocb_decrypt1:

pxor xmm7,xmm15
pxor xmm7,xmm9
pxor xmm2,xmm7
Expand Down Expand Up @@ -3684,6 +3699,7 @@ DB 102,15,56,222,209
DB 102,15,56,223,215
DB 0F3h,0C3h ;repret


global aesni_cbc_encrypt

ALIGN 16
Expand Down Expand Up @@ -4662,7 +4678,6 @@ $L$enc_key_ret:
add rsp,8

DB 0F3h,0C3h ;repret

$L$SEH_end_set_encrypt_key:

ALIGN 16
Expand Down Expand Up @@ -4735,6 +4750,7 @@ $L$key_expansion_256b:
DB 0F3h,0C3h ;repret



ALIGN 64
$L$bswap_mask:
DB 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
Expand Down
2 changes: 1 addition & 1 deletion SMP/lib/accelerated/x86/coff/sha1-ssse3-x86_64.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1458,10 +1458,10 @@ DB 102,15,56,0,251
movaps xmm9,XMMWORD[((-8-16))+rax]
mov rsp,rax
$L$epilogue_shaext:

mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret

$L$SEH_end_sha1_block_data_order_shaext:

ALIGN 16
Expand Down
Loading

0 comments on commit 63836e5

Please sign in to comment.