File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -788,6 +788,16 @@ int DoProcessReply(SSL& ssl)
788
788
needHdr = true ;
789
789
else {
790
790
buffer >> hdr;
791
+ /*
792
+ According to RFC 4346 (see "7.4.1.3. Server Hello"), the Server Hello
793
+ packet needs to specify the highest supported TLS version, but not
794
+ higher than what client requests. YaSSL highest supported version is
795
+ TLSv1.1 (=3.2) - if the client requests a higher version, downgrade it
796
+ here to 3.2.
797
+ See also Appendix E of RFC 5246 (TLS 1.2)
798
+ */
799
+ if (hdr.version_ .major_ == 3 && hdr.version_ .minor_ > 2 )
800
+ hdr.version_ .minor_ = 2 ;
791
801
ssl.verifyState (hdr);
792
802
}
793
803
Original file line number Diff line number Diff line change 35
35
# define MEM_CHECK_DEFINED (a ,len ) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
36
36
#elif defined(__SANITIZE_ADDRESS__ )
37
37
# include <sanitizer/asan_interface.h>
38
+ /* How to do manual poisoning:
39
+ https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning */
38
40
# define MEM_UNDEFINED (a ,len ) ASAN_UNPOISON_MEMORY_REGION(a,len)
39
41
# define MEM_NOACCESS (a ,len ) ASAN_POISON_MEMORY_REGION(a,len)
40
42
# define MEM_CHECK_ADDRESSABLE (a ,len ) ((void) 0)
Original file line number Diff line number Diff line change @@ -406,6 +406,11 @@ mem_heap_create_block_func(
406
406
heap->total_size += len;
407
407
}
408
408
409
+ /* Poison all available memory. Individual chunks will be unpoisoned on
410
+ every mem_heap_alloc() call. */
411
+ compile_time_assert (MEM_BLOCK_HEADER_SIZE >= sizeof *block);
412
+ UNIV_MEM_FREE (block + 1 , len - sizeof *block);
413
+
409
414
ut_ad ((ulint)MEM_BLOCK_HEADER_SIZE < len);
410
415
411
416
return (block);
Original file line number Diff line number Diff line change @@ -406,6 +406,11 @@ mem_heap_create_block_func(
406
406
heap->total_size += len;
407
407
}
408
408
409
+ /* Poison all available memory. Individual chunks will be unpoisoned on
410
+ every mem_heap_alloc() call. */
411
+ compile_time_assert (MEM_BLOCK_HEADER_SIZE >= sizeof *block);
412
+ UNIV_MEM_FREE (block + 1 , len - sizeof *block);
413
+
409
414
ut_ad ((ulint)MEM_BLOCK_HEADER_SIZE < len);
410
415
411
416
return (block);
You can’t perform that action at this time.
0 commit comments