Browse Source

deps: upgrade openssl sources to 1.0.2e

This just replaces all sources of openssl-1.0.2e.tar.gz into
deps/openssl/openssl

deps: copy all openssl header files to include dir

All symlink files in `deps/openssl/openssl/include/openssl/`
are removed and replaced with real header files to avoid
issues on Windows. Two files of opensslconf.h in crypto and
include dir are replaced to refer config/opensslconf.h.

deps: fix openssl assembly error on ia32 win32

`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .

deps: fix asm build error of openssl in x86_win32

See
https://mta.openssl.org/pipermail/openssl-dev/2015-February/000651.html

node needs to stop using masm and move to nasm or yasm on Win32.

openssl: fix keypress requirement in apps on win32

Reapply b910613792 .

deps: add -no_rand_screen to openssl s_client

In openssl s_client on Windows, RAND_screen() is invoked to initialize
random state but it takes several seconds in each connection.
This added -no_rand_screen to openssl s_client on Windows to skip
RAND_screen() and gets a better performance in the unit test of
test-tls-server-verify.
Do not enable this except to use in the unit test.

deps: update openssl config files

Regenrate config files for supported platforms with Makefile.

deps: update openssl asm and asm_obsolete files

Regenerate asm files with Makefile and CC=gcc and ASM=gcc where
gcc-4.8.4. Also asm files in asm_obsolete dir to support old compiler
and assmebler are regenerated without CC and ASM envs.

PR-URL: https://github.com/nodejs/node/pull/4134
Reviewed-By: Fedor Indutny <fedor@indutny.com>
v4.x
Shigeki Ohtsu 9 years ago
committed by Rod Vagg
parent
commit
49bbd563be
  1. 6
      deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S
  2. 5
      deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S
  3. 22
      deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S
  4. 22
      deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S
  5. 7
      deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s
  6. 22
      deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s
  7. 7
      deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s
  8. 22
      deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s
  9. 7
      deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm
  10. 22
      deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm
  11. 6
      deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S
  12. 5
      deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S
  13. 22
      deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S
  14. 22
      deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S
  15. 9
      deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s
  16. 9
      deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s
  17. 9
      deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm
  18. 2
      deps/openssl/config/archs/BSD-x86/opensslconf.h
  19. 2
      deps/openssl/config/archs/BSD-x86_64/opensslconf.h
  20. 2
      deps/openssl/config/archs/VC-WIN32/opensslconf.h
  21. 2
      deps/openssl/config/archs/VC-WIN64A/opensslconf.h
  22. 2
      deps/openssl/config/archs/aix-gcc/opensslconf.h
  23. 2
      deps/openssl/config/archs/aix64-gcc/opensslconf.h
  24. 2
      deps/openssl/config/archs/darwin-i386-cc/opensslconf.h
  25. 2
      deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h
  26. 2
      deps/openssl/config/archs/linux-aarch64/opensslconf.h
  27. 2
      deps/openssl/config/archs/linux-armv4/opensslconf.h
  28. 2
      deps/openssl/config/archs/linux-elf/opensslconf.h
  29. 4
      deps/openssl/config/archs/linux-ppc/opensslconf.h
  30. 4
      deps/openssl/config/archs/linux-ppc64/opensslconf.h
  31. 2
      deps/openssl/config/archs/linux-x32/opensslconf.h
  32. 2
      deps/openssl/config/archs/linux-x86_64/opensslconf.h
  33. 2
      deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h
  34. 2
      deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h
  35. 242
      deps/openssl/openssl/CHANGES
  36. 38
      deps/openssl/openssl/CONTRIBUTING
  37. 11
      deps/openssl/openssl/Configure
  38. 1055
      deps/openssl/openssl/FAQ
  39. 37
      deps/openssl/openssl/Makefile
  40. 37
      deps/openssl/openssl/Makefile.bak
  41. 35
      deps/openssl/openssl/Makefile.org
  42. 10
      deps/openssl/openssl/NEWS
  43. 178
      deps/openssl/openssl/README
  44. 2
      deps/openssl/openssl/apps/Makefile
  45. 3
      deps/openssl/openssl/apps/app_rand.c
  46. 9
      deps/openssl/openssl/apps/apps.c
  47. 4
      deps/openssl/openssl/apps/asn1pars.c
  48. 14
      deps/openssl/openssl/apps/ca.c
  49. 7
      deps/openssl/openssl/apps/ecparam.c
  50. 5
      deps/openssl/openssl/apps/engine.c
  51. 2
      deps/openssl/openssl/apps/md4.c
  52. 4
      deps/openssl/openssl/apps/ocsp.c
  53. 14
      deps/openssl/openssl/apps/pkcs12.c
  54. 5
      deps/openssl/openssl/apps/s_cb.c
  55. 11
      deps/openssl/openssl/apps/s_client.c
  56. 51
      deps/openssl/openssl/apps/s_server.c
  57. 60
      deps/openssl/openssl/appveyor.yml
  58. 6
      deps/openssl/openssl/crypto/aes/asm/aes-586.pl
  59. 2
      deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl
  60. 2
      deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl
  61. 9
      deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl
  62. 2
      deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl
  63. 198
      deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl
  64. 10
      deps/openssl/openssl/crypto/asn1/asn1_par.c
  65. 15
      deps/openssl/openssl/crypto/asn1/d2i_pr.c
  66. 11
      deps/openssl/openssl/crypto/asn1/tasn_dec.c
  67. 5
      deps/openssl/openssl/crypto/asn1/x_bignum.c
  68. 5
      deps/openssl/openssl/crypto/asn1/x_pubkey.c
  69. 9
      deps/openssl/openssl/crypto/asn1/x_x509.c
  70. 7
      deps/openssl/openssl/crypto/asn1/x_x509a.c
  71. 1
      deps/openssl/openssl/crypto/bio/b_dump.c
  72. 13
      deps/openssl/openssl/crypto/bio/bss_file.c
  73. 10
      deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl
  74. 4
      deps/openssl/openssl/crypto/bn/asm/ia64.S
  75. 174
      deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl
  76. 2
      deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl
  77. 6
      deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl
  78. 109
      deps/openssl/openssl/crypto/bn/asm/s390x.S
  79. 16
      deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl
  80. 2
      deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c
  81. 16
      deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl
  82. 5
      deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl
  83. 27
      deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl
  84. 7
      deps/openssl/openssl/crypto/bn/bn_exp.c
  85. 2
      deps/openssl/openssl/crypto/bn/bn_gcd.c
  86. 11
      deps/openssl/openssl/crypto/bn/bn_gf2m.c
  87. 9
      deps/openssl/openssl/crypto/bn/bn_mont.c
  88. 4
      deps/openssl/openssl/crypto/bn/bn_recp.c
  89. 7
      deps/openssl/openssl/crypto/bn/bn_x931p.c
  90. 74
      deps/openssl/openssl/crypto/bn/bntest.c
  91. 68
      deps/openssl/openssl/crypto/bn/rsaz_exp.h
  92. 21
      deps/openssl/openssl/crypto/buffer/buf_str.c
  93. 6
      deps/openssl/openssl/crypto/buffer/buffer.h
  94. 2
      deps/openssl/openssl/crypto/cms/cms_enc.c
  95. 3
      deps/openssl/openssl/crypto/cms/cms_pwri.c
  96. 2
      deps/openssl/openssl/crypto/cms/cms_sd.c
  97. 2
      deps/openssl/openssl/crypto/cms/cms_smime.c
  98. 3
      deps/openssl/openssl/crypto/comp/c_zlib.c
  99. 3
      deps/openssl/openssl/crypto/conf/conf_def.c
  100. 1
      deps/openssl/openssl/crypto/conf/conf_sap.c

6
deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S

@ -98,7 +98,7 @@ bn_GF2m_mul_2x2:
mov r12,#7<<2 mov r12,#7<<2
sub sp,sp,#32 @ allocate tab[8] sub sp,sp,#32 @ allocate tab[8]
bl mul_1x1_ialu @ a1ˇb1 bl mul_1x1_ialu @ a1·b1
str r5,[r10,#8] str r5,[r10,#8]
str r4,[r10,#12] str r4,[r10,#12]
@ -108,13 +108,13 @@ bn_GF2m_mul_2x2:
eor r2,r2,r1 eor r2,r2,r1
eor r0,r0,r3 eor r0,r0,r3
eor r1,r1,r2 eor r1,r1,r2
bl mul_1x1_ialu @ a0ˇb0 bl mul_1x1_ialu @ a0·b0
str r5,[r10] str r5,[r10]
str r4,[r10,#4] str r4,[r10,#4]
eor r1,r1,r2 eor r1,r1,r2
eor r0,r0,r3 eor r0,r0,r3
bl mul_1x1_ialu @ (a1+a0)ˇ(b1+b0) bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
ldmia r10,{r6-r9} ldmia r10,{r6-r9}
eor r5,r5,r4 eor r5,r5,r4
eor r4,r4,r7 eor r4,r4,r7

5
deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S

@ -3,6 +3,11 @@
.text .text
.code 32 .code 32
#ifdef __clang__
#define ldrplb ldrbpl
#define ldrneb ldrbne
#endif
.type rem_4bit,%object .type rem_4bit,%object
.align 5 .align 5
rem_4bit: rem_4bit:

22
deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S

@ -66,10 +66,10 @@ gcm_gmult_v8:
#endif #endif
vext.8 q3,q9,q9,#8 vext.8 q3,q9,q9,#8
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2 veor q10,q0,q2
@ -134,7 +134,7 @@ gcm_ghash_v8:
#endif #endif
vext.8 q7,q9,q9,#8 vext.8 q7,q9,q9,#8
veor q3,q3,q0 @ I[i]^=Xi veor q3,q3,q0 @ I[i]^=Xi
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q9,q9,q7 @ Karatsuba pre-processing veor q9,q9,q7 @ Karatsuba pre-processing
.byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7 .byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7
b .Loop_mod2x_v8 b .Loop_mod2x_v8
@ -143,14 +143,14 @@ gcm_ghash_v8:
.Loop_mod2x_v8: .Loop_mod2x_v8:
vext.8 q10,q3,q3,#8 vext.8 q10,q3,q3,#8
subs r3,r3,#32 @ is there more data? subs r3,r3,#32 @ is there more data?
.byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo
movlo r12,#0 @ is it time to zero r12? movlo r12,#0 @ is it time to zero r12?
.byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9 .byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9
veor q10,q10,q3 @ Karatsuba pre-processing veor q10,q10,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi
veor q0,q0,q4 @ accumulate veor q0,q0,q4 @ accumulate
.byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2] vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2]
veor q2,q2,q6 veor q2,q2,q6
@ -175,7 +175,7 @@ gcm_ghash_v8:
vext.8 q7,q9,q9,#8 vext.8 q7,q9,q9,#8
vext.8 q3,q8,q8,#8 vext.8 q3,q8,q8,#8
veor q0,q1,q10 veor q0,q1,q10
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q3,q3,q2 @ accumulate q3 early veor q3,q3,q2 @ accumulate q3 early
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
@ -196,10 +196,10 @@ gcm_ghash_v8:
veor q3,q3,q0 @ inp^=Xi veor q3,q3,q0 @ inp^=Xi
veor q9,q8,q10 @ q9 is rotated inp^Xi veor q9,q8,q10 @ q9 is rotated inp^Xi
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2 veor q10,q0,q2

22
deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S

@ -65,10 +65,10 @@ gcm_gmult_v8:
#endif #endif
ext v3.16b,v17.16b,v17.16b,#8 ext v3.16b,v17.16b,v17.16b,#8
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.hi pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)ˇ(Xi.lo+Xi.hi) pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b eor v18.16b,v0.16b,v2.16b
@ -132,7 +132,7 @@ gcm_ghash_v8:
#endif #endif
ext v7.16b,v17.16b,v17.16b,#8 ext v7.16b,v17.16b,v17.16b,#8
eor v3.16b,v3.16b,v0.16b //I[i]^=Xi eor v3.16b,v3.16b,v0.16b //I[i]^=Xi
pmull v4.1q,v20.1d,v7.1d //HˇIi+1 pmull v4.1q,v20.1d,v7.1d //H·Ii+1
eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing
pmull2 v6.1q,v20.2d,v7.2d pmull2 v6.1q,v20.2d,v7.2d
b .Loop_mod2x_v8 b .Loop_mod2x_v8
@ -141,14 +141,14 @@ gcm_ghash_v8:
.Loop_mod2x_v8: .Loop_mod2x_v8:
ext v18.16b,v3.16b,v3.16b,#8 ext v18.16b,v3.16b,v3.16b,#8
subs x3,x3,#32 //is there more data? subs x3,x3,#32 //is there more data?
pmull v0.1q,v22.1d,v3.1d //H^2.loˇXi.lo pmull v0.1q,v22.1d,v3.1d //H^2.lo·Xi.lo
csel x12,xzr,x12,lo //is it time to zero x12? csel x12,xzr,x12,lo //is it time to zero x12?
pmull v5.1q,v21.1d,v17.1d pmull v5.1q,v21.1d,v17.1d
eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v22.2d,v3.2d //H^2.hiˇXi.hi pmull2 v2.1q,v22.2d,v3.2d //H^2.hi·Xi.hi
eor v0.16b,v0.16b,v4.16b //accumulate eor v0.16b,v0.16b,v4.16b //accumulate
pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)ˇ(Xi.lo+Xi.hi) pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2] ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2]
eor v2.16b,v2.16b,v6.16b eor v2.16b,v2.16b,v6.16b
@ -173,7 +173,7 @@ gcm_ghash_v8:
ext v7.16b,v17.16b,v17.16b,#8 ext v7.16b,v17.16b,v17.16b,#8
ext v3.16b,v16.16b,v16.16b,#8 ext v3.16b,v16.16b,v16.16b,#8
eor v0.16b,v1.16b,v18.16b eor v0.16b,v1.16b,v18.16b
pmull v4.1q,v20.1d,v7.1d //HˇIi+1 pmull v4.1q,v20.1d,v7.1d //H·Ii+1
eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
@ -194,10 +194,10 @@ gcm_ghash_v8:
eor v3.16b,v3.16b,v0.16b //inp^=Xi eor v3.16b,v3.16b,v0.16b //inp^=Xi
eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.hi pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)ˇ(Xi.lo+Xi.hi) pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b eor v18.16b,v0.16b,v2.16b

7
deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s

@ -21,11 +21,8 @@ aesni_cbc_sha256_enc:
andl $296,%r11d andl $296,%r11d
cmpl $296,%r11d cmpl $296,%r11d
je aesni_cbc_sha256_enc_avx2 je aesni_cbc_sha256_enc_avx2
andl $1073741824,%eax andl $268435456,%r10d
andl $268435968,%r10d jnz aesni_cbc_sha256_enc_avx
orl %eax,%r10d
cmpl $1342177792,%r10d
je aesni_cbc_sha256_enc_avx
ud2 ud2
xorl %eax,%eax xorl %eax,%eax
cmpq $0,%rdi cmpq $0,%rdi

22
deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s

@ -1565,6 +1565,15 @@ sqr8x_reduction:
.align 32 .align 32
.L8x_tail_done: .L8x_tail_done:
addq (%rdx),%r8 addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax xorq %rax,%rax
negq %rsi negq %rsi
@ -2806,6 +2815,15 @@ sqrx8x_reduction:
.align 32 .align 32
.Lsqrx8x_tail_done: .Lsqrx8x_tail_done:
addq 24+8(%rsp),%r8 addq 24+8(%rsp),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
movq %rsi,%rax movq %rsi,%rax
subq 16+8(%rsp),%rsi subq 16+8(%rsp),%rsi
@ -2839,13 +2857,11 @@ sqrx8x_reduction:
leaq 64(%rdi,%rcx,1),%rdi leaq 64(%rdi,%rcx,1),%rdi
cmpq 8+8(%rsp),%r8 cmpq 8+8(%rsp),%r8
jb .Lsqrx8x_reduction_loop jb .Lsqrx8x_reduction_loop
xorq %rbx,%rbx xorl %ebx,%ebx
subq %r15,%rsi subq %r15,%rsi
adcq %rbx,%rbx adcq %rbx,%rbx
movq %rcx,%r10 movq %rcx,%r10
.byte 0x67
orq %rbx,%rax orq %rbx,%rax
.byte 0x67
movq %rcx,%r9 movq %rcx,%r9
xorq $1,%rax xorq $1,%rax
sarq $3+2,%rcx sarq $3+2,%rcx

7
deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s

@ -21,11 +21,8 @@ _aesni_cbc_sha256_enc:
andl $296,%r11d andl $296,%r11d
cmpl $296,%r11d cmpl $296,%r11d
je aesni_cbc_sha256_enc_avx2 je aesni_cbc_sha256_enc_avx2
andl $1073741824,%eax andl $268435456,%r10d
andl $268435968,%r10d jnz aesni_cbc_sha256_enc_avx
orl %eax,%r10d
cmpl $1342177792,%r10d
je aesni_cbc_sha256_enc_avx
ud2 ud2
xorl %eax,%eax xorl %eax,%eax
cmpq $0,%rdi cmpq $0,%rdi

22
deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s

@ -1565,6 +1565,15 @@ L$8x_tail:
.p2align 5 .p2align 5
L$8x_tail_done: L$8x_tail_done:
addq (%rdx),%r8 addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax xorq %rax,%rax
negq %rsi negq %rsi
@ -2806,6 +2815,15 @@ L$sqrx8x_tail:
.p2align 5 .p2align 5
L$sqrx8x_tail_done: L$sqrx8x_tail_done:
addq 24+8(%rsp),%r8 addq 24+8(%rsp),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
movq %rsi,%rax movq %rsi,%rax
subq 16+8(%rsp),%rsi subq 16+8(%rsp),%rsi
@ -2839,13 +2857,11 @@ L$sqrx8x_no_tail:
leaq 64(%rdi,%rcx,1),%rdi leaq 64(%rdi,%rcx,1),%rdi
cmpq 8+8(%rsp),%r8 cmpq 8+8(%rsp),%r8
jb L$sqrx8x_reduction_loop jb L$sqrx8x_reduction_loop
xorq %rbx,%rbx xorl %ebx,%ebx
subq %r15,%rsi subq %r15,%rsi
adcq %rbx,%rbx adcq %rbx,%rbx
movq %rcx,%r10 movq %rcx,%r10
.byte 0x67
orq %rbx,%rax orq %rbx,%rax
.byte 0x67
movq %rcx,%r9 movq %rcx,%r9
xorq $1,%rax xorq $1,%rax
sarq $3+2,%rcx sarq $3+2,%rcx

7
deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm

@ -22,11 +22,8 @@ aesni_cbc_sha256_enc PROC PUBLIC
and r11d,296 and r11d,296
cmp r11d,296 cmp r11d,296
je aesni_cbc_sha256_enc_avx2 je aesni_cbc_sha256_enc_avx2
and eax,1073741824 and r10d,268435456
and r10d,268435968 jnz aesni_cbc_sha256_enc_avx
or r10d,eax
cmp r10d,1342177792
je aesni_cbc_sha256_enc_avx
ud2 ud2
xor eax,eax xor eax,eax
cmp rcx,0 cmp rcx,0

22
deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm

@ -1624,6 +1624,15 @@ $L$8x_tail::
ALIGN 32 ALIGN 32
$L$8x_tail_done:: $L$8x_tail_done::
add r8,QWORD PTR[rdx] add r8,QWORD PTR[rdx]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
xor rax,rax xor rax,rax
neg rsi neg rsi
@ -2923,6 +2932,15 @@ DB 0c4h,062h,0fbh,0f6h,0a5h,040h,000h,000h,000h
ALIGN 32 ALIGN 32
$L$sqrx8x_tail_done:: $L$sqrx8x_tail_done::
add r8,QWORD PTR[((24+8))+rsp] add r8,QWORD PTR[((24+8))+rsp]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
mov rax,rsi mov rax,rsi
sub rsi,QWORD PTR[((16+8))+rsp] sub rsi,QWORD PTR[((16+8))+rsp]
@ -2956,13 +2974,11 @@ DB 102,72,15,126,213
lea rdi,QWORD PTR[64+rcx*1+rdi] lea rdi,QWORD PTR[64+rcx*1+rdi]
cmp r8,QWORD PTR[((8+8))+rsp] cmp r8,QWORD PTR[((8+8))+rsp]
jb $L$sqrx8x_reduction_loop jb $L$sqrx8x_reduction_loop
xor rbx,rbx xor ebx,ebx
sub rsi,r15 sub rsi,r15
adc rbx,rbx adc rbx,rbx
mov r10,rcx mov r10,rcx
DB 067h
or rax,rbx or rax,rbx
DB 067h
mov r9,rcx mov r9,rcx
xor rax,1 xor rax,1
sar rcx,3+2 sar rcx,3+2

6
deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S

@ -98,7 +98,7 @@ bn_GF2m_mul_2x2:
mov r12,#7<<2 mov r12,#7<<2
sub sp,sp,#32 @ allocate tab[8] sub sp,sp,#32 @ allocate tab[8]
bl mul_1x1_ialu @ a1ˇb1 bl mul_1x1_ialu @ a1·b1
str r5,[r10,#8] str r5,[r10,#8]
str r4,[r10,#12] str r4,[r10,#12]
@ -108,13 +108,13 @@ bn_GF2m_mul_2x2:
eor r2,r2,r1 eor r2,r2,r1
eor r0,r0,r3 eor r0,r0,r3
eor r1,r1,r2 eor r1,r1,r2
bl mul_1x1_ialu @ a0ˇb0 bl mul_1x1_ialu @ a0·b0
str r5,[r10] str r5,[r10]
str r4,[r10,#4] str r4,[r10,#4]
eor r1,r1,r2 eor r1,r1,r2
eor r0,r0,r3 eor r0,r0,r3
bl mul_1x1_ialu @ (a1+a0)ˇ(b1+b0) bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
ldmia r10,{r6-r9} ldmia r10,{r6-r9}
eor r5,r5,r4 eor r5,r5,r4
eor r4,r4,r7 eor r4,r4,r7

5
deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S

@ -3,6 +3,11 @@
.text .text
.code 32 .code 32
#ifdef __clang__
#define ldrplb ldrbpl
#define ldrneb ldrbne
#endif
.type rem_4bit,%object .type rem_4bit,%object
.align 5 .align 5
rem_4bit: rem_4bit:

22
deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S

@ -66,10 +66,10 @@ gcm_gmult_v8:
#endif #endif
vext.8 q3,q9,q9,#8 vext.8 q3,q9,q9,#8
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2 veor q10,q0,q2
@ -134,7 +134,7 @@ gcm_ghash_v8:
#endif #endif
vext.8 q7,q9,q9,#8 vext.8 q7,q9,q9,#8
veor q3,q3,q0 @ I[i]^=Xi veor q3,q3,q0 @ I[i]^=Xi
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q9,q9,q7 @ Karatsuba pre-processing veor q9,q9,q7 @ Karatsuba pre-processing
.byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7 .byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7
b .Loop_mod2x_v8 b .Loop_mod2x_v8
@ -143,14 +143,14 @@ gcm_ghash_v8:
.Loop_mod2x_v8: .Loop_mod2x_v8:
vext.8 q10,q3,q3,#8 vext.8 q10,q3,q3,#8
subs r3,r3,#32 @ is there more data? subs r3,r3,#32 @ is there more data?
.byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo
movlo r12,#0 @ is it time to zero r12? movlo r12,#0 @ is it time to zero r12?
.byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9 .byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9
veor q10,q10,q3 @ Karatsuba pre-processing veor q10,q10,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi
veor q0,q0,q4 @ accumulate veor q0,q0,q4 @ accumulate
.byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2] vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2]
veor q2,q2,q6 veor q2,q2,q6
@ -175,7 +175,7 @@ gcm_ghash_v8:
vext.8 q7,q9,q9,#8 vext.8 q7,q9,q9,#8
vext.8 q3,q8,q8,#8 vext.8 q3,q8,q8,#8
veor q0,q1,q10 veor q0,q1,q10
.byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1
veor q3,q3,q2 @ accumulate q3 early veor q3,q3,q2 @ accumulate q3 early
vext.8 q10,q0,q0,#8 @ 2nd phase of reduction vext.8 q10,q0,q0,#8 @ 2nd phase of reduction
@ -196,10 +196,10 @@ gcm_ghash_v8:
veor q3,q3,q0 @ inp^=Xi veor q3,q3,q0 @ inp^=Xi
veor q9,q8,q10 @ q9 is rotated inp^Xi veor q9,q8,q10 @ q9 is rotated inp^Xi
.byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo
veor q9,q9,q3 @ Karatsuba pre-processing veor q9,q9,q3 @ Karatsuba pre-processing
.byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi
.byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi)
vext.8 q9,q0,q2,#8 @ Karatsuba post-processing vext.8 q9,q0,q2,#8 @ Karatsuba post-processing
veor q10,q0,q2 veor q10,q0,q2

22
deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S

@ -65,10 +65,10 @@ gcm_gmult_v8:
#endif #endif
ext v3.16b,v17.16b,v17.16b,#8 ext v3.16b,v17.16b,v17.16b,#8
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.hi pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)ˇ(Xi.lo+Xi.hi) pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b eor v18.16b,v0.16b,v2.16b
@ -132,7 +132,7 @@ gcm_ghash_v8:
#endif #endif
ext v7.16b,v17.16b,v17.16b,#8 ext v7.16b,v17.16b,v17.16b,#8
eor v3.16b,v3.16b,v0.16b //I[i]^=Xi eor v3.16b,v3.16b,v0.16b //I[i]^=Xi
pmull v4.1q,v20.1d,v7.1d //HˇIi+1 pmull v4.1q,v20.1d,v7.1d //H·Ii+1
eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing
pmull2 v6.1q,v20.2d,v7.2d pmull2 v6.1q,v20.2d,v7.2d
b .Loop_mod2x_v8 b .Loop_mod2x_v8
@ -141,14 +141,14 @@ gcm_ghash_v8:
.Loop_mod2x_v8: .Loop_mod2x_v8:
ext v18.16b,v3.16b,v3.16b,#8 ext v18.16b,v3.16b,v3.16b,#8
subs x3,x3,#32 //is there more data? subs x3,x3,#32 //is there more data?
pmull v0.1q,v22.1d,v3.1d //H^2.loˇXi.lo pmull v0.1q,v22.1d,v3.1d //H^2.lo·Xi.lo
csel x12,xzr,x12,lo //is it time to zero x12? csel x12,xzr,x12,lo //is it time to zero x12?
pmull v5.1q,v21.1d,v17.1d pmull v5.1q,v21.1d,v17.1d
eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v22.2d,v3.2d //H^2.hiˇXi.hi pmull2 v2.1q,v22.2d,v3.2d //H^2.hi·Xi.hi
eor v0.16b,v0.16b,v4.16b //accumulate eor v0.16b,v0.16b,v4.16b //accumulate
pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)ˇ(Xi.lo+Xi.hi) pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2] ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2]
eor v2.16b,v2.16b,v6.16b eor v2.16b,v2.16b,v6.16b
@ -173,7 +173,7 @@ gcm_ghash_v8:
ext v7.16b,v17.16b,v17.16b,#8 ext v7.16b,v17.16b,v17.16b,#8
ext v3.16b,v16.16b,v16.16b,#8 ext v3.16b,v16.16b,v16.16b,#8
eor v0.16b,v1.16b,v18.16b eor v0.16b,v1.16b,v18.16b
pmull v4.1q,v20.1d,v7.1d //HˇIi+1 pmull v4.1q,v20.1d,v7.1d //H·Ii+1
eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early
ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction
@ -194,10 +194,10 @@ gcm_ghash_v8:
eor v3.16b,v3.16b,v0.16b //inp^=Xi eor v3.16b,v3.16b,v0.16b //inp^=Xi
eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi
pmull v0.1q,v20.1d,v3.1d //H.loˇXi.lo pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo
eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing
pmull2 v2.1q,v20.2d,v3.2d //H.hiˇXi.hi pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi
pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)ˇ(Xi.lo+Xi.hi) pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi)
ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing
eor v18.16b,v0.16b,v2.16b eor v18.16b,v0.16b,v2.16b

9
deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s

@ -1557,6 +1557,15 @@ sqr8x_reduction:
.align 32 .align 32
.L8x_tail_done: .L8x_tail_done:
addq (%rdx),%r8 addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax xorq %rax,%rax
negq %rsi negq %rsi

9
deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s

@ -1557,6 +1557,15 @@ L$8x_tail:
.p2align 5 .p2align 5
L$8x_tail_done: L$8x_tail_done:
addq (%rdx),%r8 addq (%rdx),%r8
adcq $0,%r9
adcq $0,%r10
adcq $0,%r11
adcq $0,%r12
adcq $0,%r13
adcq $0,%r14
adcq $0,%r15
xorq %rax,%rax xorq %rax,%rax
negq %rsi negq %rsi

9
deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm

@ -1616,6 +1616,15 @@ $L$8x_tail::
ALIGN 32 ALIGN 32
$L$8x_tail_done:: $L$8x_tail_done::
add r8,QWORD PTR[rdx] add r8,QWORD PTR[rdx]
adc r9,0
adc r10,0
adc r11,0
adc r12,0
adc r13,0
adc r14,0
adc r15,0
xor rax,rax xor rax,rax
neg rsi neg rsi

2
deps/openssl/config/archs/BSD-x86/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/BSD-x86_64/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/VC-WIN32/opensslconf.h

@ -222,7 +222,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/VC-WIN64A/opensslconf.h

@ -222,7 +222,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/aix-gcc/opensslconf.h

@ -224,7 +224,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/aix64-gcc/opensslconf.h

@ -224,7 +224,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/darwin-i386-cc/opensslconf.h

@ -224,7 +224,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h

@ -224,7 +224,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/linux-aarch64/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/linux-armv4/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/linux-elf/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

4
deps/openssl/config/archs/linux-ppc/opensslconf.h

@ -202,7 +202,7 @@ extern "C" {
#endif #endif
#if defined(DES_RISC1) && defined(DES_RISC2) #if defined(DES_RISC1) && defined(DES_RISC2)
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif #endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders. /* Unroll the inner loop, this sometimes helps, sometimes hinders.
@ -221,7 +221,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

4
deps/openssl/config/archs/linux-ppc64/opensslconf.h

@ -202,7 +202,7 @@ extern "C" {
#endif #endif
#if defined(DES_RISC1) && defined(DES_RISC2) #if defined(DES_RISC1) && defined(DES_RISC2)
YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
#endif #endif
/* Unroll the inner loop, this sometimes helps, sometimes hinders. /* Unroll the inner loop, this sometimes helps, sometimes hinders.
@ -221,7 +221,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/linux-x32/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/linux-x86_64/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

2
deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h

@ -221,7 +221,7 @@ extern "C" {
optimization options. Older Sparc's work better with only UNROLL, but optimization options. Older Sparc's work better with only UNROLL, but
there's no way to tell at compile time what it is you're running on */ there's no way to tell at compile time what it is you're running on */
#if defined( sun ) /* Newer Sparc's */ #if defined( __sun ) || defined ( sun ) /* Newer Sparc's */
# define DES_PTR # define DES_PTR
# define DES_RISC1 # define DES_RISC1
# define DES_UNROLL # define DES_UNROLL

242
deps/openssl/openssl/CHANGES

@ -2,6 +2,64 @@
OpenSSL CHANGES OpenSSL CHANGES
_______________ _______________
Changes between 1.0.2d and 1.0.2e [3 Dec 2015]
*) BN_mod_exp may produce incorrect results on x86_64
There is a carry propagating bug in the x86_64 Montgomery squaring
procedure. No EC algorithms are affected. Analysis suggests that attacks
against RSA and DSA as a result of this defect would be very difficult to
perform and are not believed likely. Attacks against DH are considered just
feasible (although very difficult) because most of the work necessary to
deduce information about a private key may be performed offline. The amount
of resources required for such an attack would be very significant and
likely only accessible to a limited number of attackers. An attacker would
additionally need online access to an unpatched system using the target
private key in a scenario with persistent DH parameters and a private
key that is shared between multiple clients. For example this can occur by
default in OpenSSL DHE based SSL/TLS ciphersuites.
This issue was reported to OpenSSL by Hanno Böck.
(CVE-2015-3193)
[Andy Polyakov]
*) Certificate verify crash with missing PSS parameter
The signature verification routines will crash with a NULL pointer
dereference if presented with an ASN.1 signature using the RSA PSS
algorithm and absent mask generation function parameter. Since these
routines are used to verify certificate signature algorithms this can be
used to crash any certificate verification operation and exploited in a
DoS attack. Any application which performs certificate verification is
vulnerable including OpenSSL clients and servers which enable client
authentication.
This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG).
(CVE-2015-3194)
[Stephen Henson]
*) X509_ATTRIBUTE memory leak
When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak
memory. This structure is used by the PKCS#7 and CMS routines so any
application which reads PKCS#7 or CMS data from untrusted sources is
affected. SSL/TLS is not affected.
This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using
libFuzzer.
(CVE-2015-3195)
[Stephen Henson]
*) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs.
This changes the decoding behaviour for some invalid messages,
though the change is mostly in the more lenient direction, and
legacy behaviour is preserved as much as possible.
[Emilia Käsper]
*) In DSA_generate_parameters_ex, if the provided seed is too short,
return an error
[Rich Salz and Ismo Puustinen <ismo.puustinen@intel.com>]
Changes between 1.0.2c and 1.0.2d [9 Jul 2015] Changes between 1.0.2c and 1.0.2d [9 Jul 2015]
*) Alternate chains certificate forgery *) Alternate chains certificate forgery
@ -15,8 +73,18 @@
This issue was reported to OpenSSL by Adam Langley/David Benjamin This issue was reported to OpenSSL by Adam Langley/David Benjamin
(Google/BoringSSL). (Google/BoringSSL).
(CVE-2015-1793)
[Matt Caswell] [Matt Caswell]
*) Race condition handling PSK identify hint
If PSK identity hints are received by a multi-threaded client then
the values are wrongly updated in the parent SSL_CTX structure. This can
result in a race condition potentially leading to a double free of the
identify hint data.
(CVE-2015-3196)
[Stephen Henson]
Changes between 1.0.2b and 1.0.2c [12 Jun 2015] Changes between 1.0.2b and 1.0.2c [12 Jun 2015]
*) Fix HMAC ABI incompatibility. The previous version introduced an ABI *) Fix HMAC ABI incompatibility. The previous version introduced an ABI
@ -55,9 +123,9 @@
callbacks. callbacks.
This issue was reported to OpenSSL by Robert Swiecki (Google), and This issue was reported to OpenSSL by Robert Swiecki (Google), and
independently by Hanno Böck. independently by Hanno Böck.
(CVE-2015-1789) (CVE-2015-1789)
[Emilia Käsper] [Emilia Käsper]
*) PKCS7 crash with missing EnvelopedContent *) PKCS7 crash with missing EnvelopedContent
@ -71,7 +139,7 @@
This issue was reported to OpenSSL by Michal Zalewski (Google). This issue was reported to OpenSSL by Michal Zalewski (Google).
(CVE-2015-1790) (CVE-2015-1790)
[Emilia Käsper] [Emilia Käsper]
*) CMS verify infinite loop with unknown hash function *) CMS verify infinite loop with unknown hash function
@ -201,7 +269,7 @@
This issue was reported to OpenSSL by Michal Zalewski (Google). This issue was reported to OpenSSL by Michal Zalewski (Google).
(CVE-2015-0289) (CVE-2015-0289)
[Emilia Käsper] [Emilia Käsper]
*) DoS via reachable assert in SSLv2 servers fix *) DoS via reachable assert in SSLv2 servers fix
@ -209,10 +277,10 @@
servers that both support SSLv2 and enable export cipher suites by sending servers that both support SSLv2 and enable export cipher suites by sending
a specially crafted SSLv2 CLIENT-MASTER-KEY message. a specially crafted SSLv2 CLIENT-MASTER-KEY message.
This issue was discovered by Sean Burford (Google) and Emilia Käsper This issue was discovered by Sean Burford (Google) and Emilia Käsper
(OpenSSL development team). (OpenSSL development team).
(CVE-2015-0293) (CVE-2015-0293)
[Emilia Käsper] [Emilia Käsper]
*) Empty CKE with client auth and DHE fix *) Empty CKE with client auth and DHE fix
@ -272,6 +340,10 @@
Changes between 1.0.1l and 1.0.2 [22 Jan 2015] Changes between 1.0.1l and 1.0.2 [22 Jan 2015]
*) Change RSA and DH/DSA key generation apps to generate 2048-bit
keys by default.
[Kurt Roeckx]
*) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g. *) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g.
ARMv5 through ARMv8, as opposite to "locking" it to single one. ARMv5 through ARMv8, as opposite to "locking" it to single one.
So far those who have to target multiple plaforms would compromise So far those who have to target multiple plaforms would compromise
@ -717,12 +789,12 @@
version does not match the session's version. Resuming with a different version does not match the session's version. Resuming with a different
version, while not strictly forbidden by the RFC, is of questionable version, while not strictly forbidden by the RFC, is of questionable
sanity and breaks all known clients. sanity and breaks all known clients.
[David Benjamin, Emilia Käsper] [David Benjamin, Emilia Käsper]
*) Tighten handling of the ChangeCipherSpec (CCS) message: reject *) Tighten handling of the ChangeCipherSpec (CCS) message: reject
early CCS messages during renegotiation. (Note that because early CCS messages during renegotiation. (Note that because
renegotiation is encrypted, this early CCS was not exploitable.) renegotiation is encrypted, this early CCS was not exploitable.)
[Emilia Käsper] [Emilia Käsper]
*) Tighten client-side session ticket handling during renegotiation: *) Tighten client-side session ticket handling during renegotiation:
ensure that the client only accepts a session ticket if the server sends ensure that the client only accepts a session ticket if the server sends
@ -733,7 +805,7 @@
Similarly, ensure that the client requires a session ticket if one Similarly, ensure that the client requires a session ticket if one
was advertised in the ServerHello. Previously, a TLS client would was advertised in the ServerHello. Previously, a TLS client would
ignore a missing NewSessionTicket message. ignore a missing NewSessionTicket message.
[Emilia Käsper] [Emilia Käsper]
Changes between 1.0.1i and 1.0.1j [15 Oct 2014] Changes between 1.0.1i and 1.0.1j [15 Oct 2014]
@ -813,10 +885,10 @@
with a null pointer dereference (read) by specifying an anonymous (EC)DH with a null pointer dereference (read) by specifying an anonymous (EC)DH
ciphersuite and sending carefully crafted handshake messages. ciphersuite and sending carefully crafted handshake messages.
Thanks to Felix Gröbert (Google) for discovering and researching this Thanks to Felix Gröbert (Google) for discovering and researching this
issue. issue.
(CVE-2014-3510) (CVE-2014-3510)
[Emilia Käsper] [Emilia Käsper]
*) By sending carefully crafted DTLS packets an attacker could cause openssl *) By sending carefully crafted DTLS packets an attacker could cause openssl
to leak memory. This can be exploited through a Denial of Service attack. to leak memory. This can be exploited through a Denial of Service attack.
@ -853,7 +925,7 @@
properly negotiated with the client. This can be exploited through a properly negotiated with the client. This can be exploited through a
Denial of Service attack. Denial of Service attack.
Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for
discovering and researching this issue. discovering and researching this issue.
(CVE-2014-5139) (CVE-2014-5139)
[Steve Henson] [Steve Henson]
@ -865,7 +937,7 @@
Thanks to Ivan Fratric (Google) for discovering this issue. Thanks to Ivan Fratric (Google) for discovering this issue.
(CVE-2014-3508) (CVE-2014-3508)
[Emilia Käsper, and Steve Henson] [Emilia Käsper, and Steve Henson]
*) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.) *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.)
for corner cases. (Certain input points at infinity could lead to for corner cases. (Certain input points at infinity could lead to
@ -895,22 +967,22 @@
client or server. This is potentially exploitable to run arbitrary client or server. This is potentially exploitable to run arbitrary
code on a vulnerable client or server. code on a vulnerable client or server.
Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195) Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195)
[Jüri Aedla, Steve Henson] [Jüri Aedla, Steve Henson]
*) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites
are subject to a denial of service attack. are subject to a denial of service attack.
Thanks to Felix Gröbert and Ivan Fratric at Google for discovering Thanks to Felix Gröbert and Ivan Fratric at Google for discovering
this issue. (CVE-2014-3470) this issue. (CVE-2014-3470)
[Felix Gröbert, Ivan Fratric, Steve Henson] [Felix Gröbert, Ivan Fratric, Steve Henson]
*) Harmonize version and its documentation. -f flag is used to display *) Harmonize version and its documentation. -f flag is used to display
compilation flags. compilation flags.
[mancha <mancha1@zoho.com>] [mancha <mancha1@zoho.com>]
*) Fix eckey_priv_encode so it immediately returns an error upon a failure *) Fix eckey_priv_encode so it immediately returns an error upon a failure
in i2d_ECPrivateKey. in i2d_ECPrivateKey. Thanks to Ted Unangst for feedback on this issue.
[mancha <mancha1@zoho.com>] [mancha <mancha1@zoho.com>]
*) Fix some double frees. These are not thought to be exploitable. *) Fix some double frees. These are not thought to be exploitable.
@ -982,9 +1054,9 @@
Thanks go to Nadhem Alfardan and Kenny Paterson of the Information Thanks go to Nadhem Alfardan and Kenny Paterson of the Information
Security Group at Royal Holloway, University of London Security Group at Royal Holloway, University of London
(www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and
Emilia Käsper for the initial patch. Emilia Käsper for the initial patch.
(CVE-2013-0169) (CVE-2013-0169)
[Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson]
*) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode *) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode
ciphersuites which can be exploited in a denial of service attack. ciphersuites which can be exploited in a denial of service attack.
@ -1159,7 +1231,7 @@
EC_GROUP_new_by_curve_name() will automatically use these (while EC_GROUP_new_by_curve_name() will automatically use these (while
EC_GROUP_new_curve_GFp() currently prefers the more flexible EC_GROUP_new_curve_GFp() currently prefers the more flexible
implementations). implementations).
[Emilia Käsper, Adam Langley, Bodo Moeller (Google)] [Emilia Käsper, Adam Langley, Bodo Moeller (Google)]
*) Use type ossl_ssize_t instad of ssize_t which isn't available on *) Use type ossl_ssize_t instad of ssize_t which isn't available on
all platforms. Move ssize_t definition from e_os.h to the public all platforms. Move ssize_t definition from e_os.h to the public
@ -1435,7 +1507,7 @@
[Adam Langley (Google)] [Adam Langley (Google)]
*) Fix spurious failures in ecdsatest.c. *) Fix spurious failures in ecdsatest.c.
[Emilia Käsper (Google)] [Emilia Käsper (Google)]
*) Fix the BIO_f_buffer() implementation (which was mixing different *) Fix the BIO_f_buffer() implementation (which was mixing different
interpretations of the '..._len' fields). interpretations of the '..._len' fields).
@ -1449,7 +1521,7 @@
lock to call BN_BLINDING_invert_ex, and avoids one use of lock to call BN_BLINDING_invert_ex, and avoids one use of
BN_BLINDING_update for each BN_BLINDING structure (previously, BN_BLINDING_update for each BN_BLINDING structure (previously,
the last update always remained unused). the last update always remained unused).
[Emilia Käsper (Google)] [Emilia Käsper (Google)]
*) In ssl3_clear, preserve s3->init_extra along with s3->rbuf. *) In ssl3_clear, preserve s3->init_extra along with s3->rbuf.
[Bob Buckholz (Google)] [Bob Buckholz (Google)]
@ -2258,7 +2330,7 @@
*) Add RFC 3161 compliant time stamp request creation, response generation *) Add RFC 3161 compliant time stamp request creation, response generation
and response verification functionality. and response verification functionality.
[Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project] [Zoltán Glózik <zglozik@opentsa.org>, The OpenTSA Project]
*) Add initial support for TLS extensions, specifically for the server_name *) Add initial support for TLS extensions, specifically for the server_name
extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now
@ -3426,7 +3498,7 @@
*) BN_CTX_get() should return zero-valued bignums, providing the same *) BN_CTX_get() should return zero-valued bignums, providing the same
initialised value as BN_new(). initialised value as BN_new().
[Geoff Thorpe, suggested by Ulf Möller] [Geoff Thorpe, suggested by Ulf Möller]
*) Support for inhibitAnyPolicy certificate extension. *) Support for inhibitAnyPolicy certificate extension.
[Steve Henson] [Steve Henson]
@ -3445,7 +3517,7 @@
some point, these tighter rules will become openssl's default to improve some point, these tighter rules will become openssl's default to improve
maintainability, though the assert()s and other overheads will remain only maintainability, though the assert()s and other overheads will remain only
in debugging configurations. See bn.h for more details. in debugging configurations. See bn.h for more details.
[Geoff Thorpe, Nils Larsch, Ulf Möller] [Geoff Thorpe, Nils Larsch, Ulf Möller]
*) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure *) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure
that can only be obtained through BN_CTX_new() (which implicitly that can only be obtained through BN_CTX_new() (which implicitly
@ -3512,7 +3584,7 @@
[Douglas Stebila (Sun Microsystems Laboratories)] [Douglas Stebila (Sun Microsystems Laboratories)]
*) Add the possibility to load symbols globally with DSO. *) Add the possibility to load symbols globally with DSO.
[Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte] [Götz Babin-Ebell <babin-ebell@trustcenter.de> via Richard Levitte]
*) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better *) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better
control of the error stack. control of the error stack.
@ -4227,7 +4299,7 @@
[Steve Henson] [Steve Henson]
*) Undo Cygwin change. *) Undo Cygwin change.
[Ulf Möller] [Ulf Möller]
*) Added support for proxy certificates according to RFC 3820. *) Added support for proxy certificates according to RFC 3820.
Because they may be a security thread to unaware applications, Because they may be a security thread to unaware applications,
@ -4260,11 +4332,11 @@
[Stephen Henson, reported by UK NISCC] [Stephen Henson, reported by UK NISCC]
*) Use Windows randomness collection on Cygwin. *) Use Windows randomness collection on Cygwin.
[Ulf Möller] [Ulf Möller]
*) Fix hang in EGD/PRNGD query when communication socket is closed *) Fix hang in EGD/PRNGD query when communication socket is closed
prematurely by EGD/PRNGD. prematurely by EGD/PRNGD.
[Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014] [Darren Tucker <dtucker@zip.com.au> via Lutz Jänicke, resolves #1014]
*) Prompt for pass phrases when appropriate for PKCS12 input format. *) Prompt for pass phrases when appropriate for PKCS12 input format.
[Steve Henson] [Steve Henson]
@ -4726,7 +4798,7 @@
pointers passed to them whenever necessary. Otherwise it is possible pointers passed to them whenever necessary. Otherwise it is possible
the caller may have overwritten (or deallocated) the original string the caller may have overwritten (or deallocated) the original string
data when a later ENGINE operation tries to use the stored values. data when a later ENGINE operation tries to use the stored values.
[Götz Babin-Ebell <babinebell@trustcenter.de>] [Götz Babin-Ebell <babinebell@trustcenter.de>]
*) Improve diagnostics in file reading and command-line digests. *) Improve diagnostics in file reading and command-line digests.
[Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>] [Ben Laurie aided and abetted by Solar Designer <solar@openwall.com>]
@ -6831,7 +6903,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) BN_sqr() bug fix. *) BN_sqr() bug fix.
[Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>] [Ulf Möller, reported by Jim Ellis <jim.ellis@cavium.com>]
*) Rabin-Miller test analyses assume uniformly distributed witnesses, *) Rabin-Miller test analyses assume uniformly distributed witnesses,
so use BN_pseudo_rand_range() instead of using BN_pseudo_rand() so use BN_pseudo_rand_range() instead of using BN_pseudo_rand()
@ -6991,7 +7063,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) Fix OAEP check. *) Fix OAEP check.
[Ulf Möller, Bodo Möller] [Ulf Möller, Bodo Möller]
*) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5 *) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5
RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5 RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5
@ -7253,10 +7325,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) Use better test patterns in bntest. *) Use better test patterns in bntest.
[Ulf Möller] [Ulf Möller]
*) rand_win.c fix for Borland C. *) rand_win.c fix for Borland C.
[Ulf Möller] [Ulf Möller]
*) BN_rshift bugfix for n == 0. *) BN_rshift bugfix for n == 0.
[Bodo Moeller] [Bodo Moeller]
@ -7401,14 +7473,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR *) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR
BIO_ctrl (for BIO pairs). BIO_ctrl (for BIO pairs).
[Bodo Möller] [Bodo Möller]
*) Add DSO method for VMS. *) Add DSO method for VMS.
[Richard Levitte] [Richard Levitte]
*) Bug fix: Montgomery multiplication could produce results with the *) Bug fix: Montgomery multiplication could produce results with the
wrong sign. wrong sign.
[Ulf Möller] [Ulf Möller]
*) Add RPM specification openssl.spec and modify it to build three *) Add RPM specification openssl.spec and modify it to build three
packages. The default package contains applications, application packages. The default package contains applications, application
@ -7426,7 +7498,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Don't set the two most significant bits to one when generating a *) Don't set the two most significant bits to one when generating a
random number < q in the DSA library. random number < q in the DSA library.
[Ulf Möller] [Ulf Möller]
*) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default *) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default
behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if
@ -7692,7 +7764,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Randomness polling function for Win9x, as described in: *) Randomness polling function for Win9x, as described in:
Peter Gutmann, Software Generation of Practically Strong Peter Gutmann, Software Generation of Practically Strong
Random Numbers. Random Numbers.
[Ulf Möller] [Ulf Möller]
*) Fix so PRNG is seeded in req if using an already existing *) Fix so PRNG is seeded in req if using an already existing
DSA key. DSA key.
@ -7912,7 +7984,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) Eliminate non-ANSI declarations in crypto.h and stack.h. *) Eliminate non-ANSI declarations in crypto.h and stack.h.
[Ulf Möller] [Ulf Möller]
*) Fix for SSL server purpose checking. Server checking was *) Fix for SSL server purpose checking. Server checking was
rejecting certificates which had extended key usage present rejecting certificates which had extended key usage present
@ -7944,7 +8016,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) Bugfix for linux-elf makefile.one. *) Bugfix for linux-elf makefile.one.
[Ulf Möller] [Ulf Möller]
*) RSA_get_default_method() will now cause a default *) RSA_get_default_method() will now cause a default
RSA_METHOD to be chosen if one doesn't exist already. RSA_METHOD to be chosen if one doesn't exist already.
@ -8033,7 +8105,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) des_quad_cksum() byte order bug fix. *) des_quad_cksum() byte order bug fix.
[Ulf Möller, using the problem description in krb4-0.9.7, where [Ulf Möller, using the problem description in krb4-0.9.7, where
the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>] the solution is attributed to Derrick J Brashear <shadow@DEMENTIA.ORG>]
*) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly *) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly
@ -8134,7 +8206,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Rolf Haberrecker <rolf@suse.de>] [Rolf Haberrecker <rolf@suse.de>]
*) Assembler module support for Mingw32. *) Assembler module support for Mingw32.
[Ulf Möller] [Ulf Möller]
*) Shared library support for HPUX (in shlib/). *) Shared library support for HPUX (in shlib/).
[Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous] [Lutz Jaenicke <Lutz.Jaenicke@aet.TU-Cottbus.DE> and Anonymous]
@ -8153,7 +8225,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n] *) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n]
case was implemented. This caused BN_div_recp() to fail occasionally. case was implemented. This caused BN_div_recp() to fail occasionally.
[Ulf Möller] [Ulf Möller]
*) Add an optional second argument to the set_label() in the perl *) Add an optional second argument to the set_label() in the perl
assembly language builder. If this argument exists and is set assembly language builder. If this argument exists and is set
@ -8183,14 +8255,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) Fix potential buffer overrun problem in BIO_printf(). *) Fix potential buffer overrun problem in BIO_printf().
[Ulf Möller, using public domain code by Patrick Powell; problem [Ulf Möller, using public domain code by Patrick Powell; problem
pointed out by David Sacerdote <das33@cornell.edu>] pointed out by David Sacerdote <das33@cornell.edu>]
*) Support EGD <http://www.lothar.com/tech/crypto/>. New functions *) Support EGD <http://www.lothar.com/tech/crypto/>. New functions
RAND_egd() and RAND_status(). In the command line application, RAND_egd() and RAND_status(). In the command line application,
the EGD socket can be specified like a seed file using RANDFILE the EGD socket can be specified like a seed file using RANDFILE
or -rand. or -rand.
[Ulf Möller] [Ulf Möller]
*) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures. *) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures.
Some CAs (e.g. Verisign) distribute certificates in this form. Some CAs (e.g. Verisign) distribute certificates in this form.
@ -8223,7 +8295,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
#define OPENSSL_ALGORITHM_DEFINES #define OPENSSL_ALGORITHM_DEFINES
#include <openssl/opensslconf.h> #include <openssl/opensslconf.h>
defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc. defines all pertinent NO_<algo> symbols, such as NO_IDEA, NO_RSA, etc.
[Richard Levitte, Ulf and Bodo Möller] [Richard Levitte, Ulf and Bodo Möller]
*) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS *) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS
record layer. record layer.
@ -8274,17 +8346,17 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Bug fix for BN_div_recp() for numerators with an even number of *) Bug fix for BN_div_recp() for numerators with an even number of
bits. bits.
[Ulf Möller] [Ulf Möller]
*) More tests in bntest.c, and changed test_bn output. *) More tests in bntest.c, and changed test_bn output.
[Ulf Möller] [Ulf Möller]
*) ./config recognizes MacOS X now. *) ./config recognizes MacOS X now.
[Andy Polyakov] [Andy Polyakov]
*) Bug fix for BN_div() when the first words of num and divsor are *) Bug fix for BN_div() when the first words of num and divsor are
equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0). equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0).
[Ulf Möller] [Ulf Möller]
*) Add support for various broken PKCS#8 formats, and command line *) Add support for various broken PKCS#8 formats, and command line
options to produce them. options to produce them.
@ -8292,11 +8364,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to *) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to
get temporary BIGNUMs from a BN_CTX. get temporary BIGNUMs from a BN_CTX.
[Ulf Möller] [Ulf Möller]
*) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont() *) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont()
for p == 0. for p == 0.
[Ulf Möller] [Ulf Möller]
*) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and *) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and
include a #define from the old name to the new. The original intent include a #define from the old name to the new. The original intent
@ -8320,7 +8392,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Source code cleanups: use const where appropriate, eliminate casts, *) Source code cleanups: use const where appropriate, eliminate casts,
use void * instead of char * in lhash. use void * instead of char * in lhash.
[Ulf Möller] [Ulf Möller]
*) Bugfix: ssl3_send_server_key_exchange was not restartable *) Bugfix: ssl3_send_server_key_exchange was not restartable
(the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of (the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of
@ -8365,13 +8437,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) New function BN_pseudo_rand(). *) New function BN_pseudo_rand().
[Ulf Möller] [Ulf Möller]
*) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable) *) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable)
bignum version of BN_from_montgomery() with the working code from bignum version of BN_from_montgomery() with the working code from
SSLeay 0.9.0 (the word based version is faster anyway), and clean up SSLeay 0.9.0 (the word based version is faster anyway), and clean up
the comments. the comments.
[Ulf Möller] [Ulf Möller]
*) Avoid a race condition in s2_clnt.c (function get_server_hello) that *) Avoid a race condition in s2_clnt.c (function get_server_hello) that
made it impossible to use the same SSL_SESSION data structure in made it impossible to use the same SSL_SESSION data structure in
@ -8381,25 +8453,25 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) The return value of RAND_load_file() no longer counts bytes obtained *) The return value of RAND_load_file() no longer counts bytes obtained
by stat(). RAND_load_file(..., -1) is new and uses the complete file by stat(). RAND_load_file(..., -1) is new and uses the complete file
to seed the PRNG (previously an explicit byte count was required). to seed the PRNG (previously an explicit byte count was required).
[Ulf Möller, Bodo Möller] [Ulf Möller, Bodo Möller]
*) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes *) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes
used (char *) instead of (void *) and had casts all over the place. used (char *) instead of (void *) and had casts all over the place.
[Steve Henson] [Steve Henson]
*) Make BN_generate_prime() return NULL on error if ret!=NULL. *) Make BN_generate_prime() return NULL on error if ret!=NULL.
[Ulf Möller] [Ulf Möller]
*) Retain source code compatibility for BN_prime_checks macro: *) Retain source code compatibility for BN_prime_checks macro:
BN_is_prime(..., BN_prime_checks, ...) now uses BN_is_prime(..., BN_prime_checks, ...) now uses
BN_prime_checks_for_size to determine the appropriate number of BN_prime_checks_for_size to determine the appropriate number of
Rabin-Miller iterations. Rabin-Miller iterations.
[Ulf Möller] [Ulf Möller]
*) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to *) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to
DH_CHECK_P_NOT_SAFE_PRIME. DH_CHECK_P_NOT_SAFE_PRIME.
(Check if this is true? OpenPGP calls them "strong".) (Check if this is true? OpenPGP calls them "strong".)
[Ulf Möller] [Ulf Möller]
*) Merge the functionality of "dh" and "gendh" programs into a new program *) Merge the functionality of "dh" and "gendh" programs into a new program
"dhparam". The old programs are retained for now but will handle DH keys "dhparam". The old programs are retained for now but will handle DH keys
@ -8455,7 +8527,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Add missing #ifndefs that caused missing symbols when building libssl *) Add missing #ifndefs that caused missing symbols when building libssl
as a shared library without RSA. Use #ifndef NO_SSL2 instead of as a shared library without RSA. Use #ifndef NO_SSL2 instead of
NO_RSA in ssl/s2*.c. NO_RSA in ssl/s2*.c.
[Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller] [Kris Kennaway <kris@hub.freebsd.org>, modified by Ulf Möller]
*) Precautions against using the PRNG uninitialized: RAND_bytes() now *) Precautions against using the PRNG uninitialized: RAND_bytes() now
has a return value which indicates the quality of the random data has a return value which indicates the quality of the random data
@ -8464,7 +8536,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
guaranteed to be unique but not unpredictable. RAND_add is like guaranteed to be unique but not unpredictable. RAND_add is like
RAND_seed, but takes an extra argument for an entropy estimate RAND_seed, but takes an extra argument for an entropy estimate
(RAND_seed always assumes full entropy). (RAND_seed always assumes full entropy).
[Ulf Möller] [Ulf Möller]
*) Do more iterations of Rabin-Miller probable prime test (specifically, *) Do more iterations of Rabin-Miller probable prime test (specifically,
3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes 3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes
@ -8494,7 +8566,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) Honor the no-xxx Configure options when creating .DEF files. *) Honor the no-xxx Configure options when creating .DEF files.
[Ulf Möller] [Ulf Möller]
*) Add PKCS#10 attributes to field table: challengePassword, *) Add PKCS#10 attributes to field table: challengePassword,
unstructuredName and unstructuredAddress. These are taken from unstructuredName and unstructuredAddress. These are taken from
@ -9328,7 +9400,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) More DES library cleanups: remove references to srand/rand and *) More DES library cleanups: remove references to srand/rand and
delete an unused file. delete an unused file.
[Ulf Möller] [Ulf Möller]
*) Add support for the the free Netwide assembler (NASM) under Win32, *) Add support for the the free Netwide assembler (NASM) under Win32,
since not many people have MASM (ml) and it can be hard to obtain. since not many people have MASM (ml) and it can be hard to obtain.
@ -9417,7 +9489,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
worked. worked.
*) Fix problems with no-hmac etc. *) Fix problems with no-hmac etc.
[Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>] [Ulf Möller, pointed out by Brian Wellington <bwelling@tislabs.com>]
*) New functions RSA_get_default_method(), RSA_set_method() and *) New functions RSA_get_default_method(), RSA_set_method() and
RSA_get_method(). These allows replacement of RSA_METHODs without having RSA_get_method(). These allows replacement of RSA_METHODs without having
@ -9534,7 +9606,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Ben Laurie] [Ben Laurie]
*) DES library cleanups. *) DES library cleanups.
[Ulf Möller] [Ulf Möller]
*) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be *) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be
used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit
@ -9577,7 +9649,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Christian Forster <fo@hawo.stw.uni-erlangen.de>] [Christian Forster <fo@hawo.stw.uni-erlangen.de>]
*) config now generates no-xxx options for missing ciphers. *) config now generates no-xxx options for missing ciphers.
[Ulf Möller] [Ulf Möller]
*) Support the EBCDIC character set (work in progress). *) Support the EBCDIC character set (work in progress).
File ebcdic.c not yet included because it has a different license. File ebcdic.c not yet included because it has a different license.
@ -9690,7 +9762,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) Move openssl.cnf out of lib/. *) Move openssl.cnf out of lib/.
[Ulf Möller] [Ulf Möller]
*) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall *) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall
-Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes
@ -9747,10 +9819,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Ben Laurie] [Ben Laurie]
*) Support Borland C++ builder. *) Support Borland C++ builder.
[Janez Jere <jj@void.si>, modified by Ulf Möller] [Janez Jere <jj@void.si>, modified by Ulf Möller]
*) Support Mingw32. *) Support Mingw32.
[Ulf Möller] [Ulf Möller]
*) SHA-1 cleanups and performance enhancements. *) SHA-1 cleanups and performance enhancements.
[Andy Polyakov <appro@fy.chalmers.se>] [Andy Polyakov <appro@fy.chalmers.se>]
@ -9759,7 +9831,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Andy Polyakov <appro@fy.chalmers.se>] [Andy Polyakov <appro@fy.chalmers.se>]
*) Accept any -xxx and +xxx compiler options in Configure. *) Accept any -xxx and +xxx compiler options in Configure.
[Ulf Möller] [Ulf Möller]
*) Update HPUX configuration. *) Update HPUX configuration.
[Anonymous] [Anonymous]
@ -9792,7 +9864,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Bodo Moeller] [Bodo Moeller]
*) OAEP decoding bug fix. *) OAEP decoding bug fix.
[Ulf Möller] [Ulf Möller]
*) Support INSTALL_PREFIX for package builders, as proposed by *) Support INSTALL_PREFIX for package builders, as proposed by
David Harris. David Harris.
@ -9815,21 +9887,21 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Niels Poppe <niels@netbox.org>] [Niels Poppe <niels@netbox.org>]
*) New Configure option no-<cipher> (rsa, idea, rc5, ...). *) New Configure option no-<cipher> (rsa, idea, rc5, ...).
[Ulf Möller] [Ulf Möller]
*) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for *) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for
extension adding in x509 utility. extension adding in x509 utility.
[Steve Henson] [Steve Henson]
*) Remove NOPROTO sections and error code comments. *) Remove NOPROTO sections and error code comments.
[Ulf Möller] [Ulf Möller]
*) Partial rewrite of the DEF file generator to now parse the ANSI *) Partial rewrite of the DEF file generator to now parse the ANSI
prototypes. prototypes.
[Steve Henson] [Steve Henson]
*) New Configure options --prefix=DIR and --openssldir=DIR. *) New Configure options --prefix=DIR and --openssldir=DIR.
[Ulf Möller] [Ulf Möller]
*) Complete rewrite of the error code script(s). It is all now handled *) Complete rewrite of the error code script(s). It is all now handled
by one script at the top level which handles error code gathering, by one script at the top level which handles error code gathering,
@ -9858,7 +9930,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) Move the autogenerated header file parts to crypto/opensslconf.h. *) Move the autogenerated header file parts to crypto/opensslconf.h.
[Ulf Möller] [Ulf Möller]
*) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of *) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of
8 of keying material. Merlin has also confirmed interop with this fix 8 of keying material. Merlin has also confirmed interop with this fix
@ -9876,13 +9948,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Andy Polyakov <appro@fy.chalmers.se>] [Andy Polyakov <appro@fy.chalmers.se>]
*) Change functions to ANSI C. *) Change functions to ANSI C.
[Ulf Möller] [Ulf Möller]
*) Fix typos in error codes. *) Fix typos in error codes.
[Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller] [Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>, Ulf Möller]
*) Remove defunct assembler files from Configure. *) Remove defunct assembler files from Configure.
[Ulf Möller] [Ulf Möller]
*) SPARC v8 assembler BIGNUM implementation. *) SPARC v8 assembler BIGNUM implementation.
[Andy Polyakov <appro@fy.chalmers.se>] [Andy Polyakov <appro@fy.chalmers.se>]
@ -9919,7 +9991,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) New Configure option "rsaref". *) New Configure option "rsaref".
[Ulf Möller] [Ulf Möller]
*) Don't auto-generate pem.h. *) Don't auto-generate pem.h.
[Bodo Moeller] [Bodo Moeller]
@ -9967,7 +10039,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) New functions DSA_do_sign and DSA_do_verify to provide access to *) New functions DSA_do_sign and DSA_do_verify to provide access to
the raw DSA values prior to ASN.1 encoding. the raw DSA values prior to ASN.1 encoding.
[Ulf Möller] [Ulf Möller]
*) Tweaks to Configure *) Tweaks to Configure
[Niels Poppe <niels@netbox.org>] [Niels Poppe <niels@netbox.org>]
@ -9977,11 +10049,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) New variables $(RANLIB) and $(PERL) in the Makefiles. *) New variables $(RANLIB) and $(PERL) in the Makefiles.
[Ulf Möller] [Ulf Möller]
*) New config option to avoid instructions that are illegal on the 80386. *) New config option to avoid instructions that are illegal on the 80386.
The default code is faster, but requires at least a 486. The default code is faster, but requires at least a 486.
[Ulf Möller] [Ulf Möller]
*) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and *) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
SSL2_SERVER_VERSION (not used at all) macros, which are now the SSL2_SERVER_VERSION (not used at all) macros, which are now the
@ -10520,7 +10592,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
Hagino <itojun@kame.net>] Hagino <itojun@kame.net>]
*) File was opened incorrectly in randfile.c. *) File was opened incorrectly in randfile.c.
[Ulf Möller <ulf@fitug.de>] [Ulf Möller <ulf@fitug.de>]
*) Beginning of support for GeneralizedTime. d2i, i2d, check and print *) Beginning of support for GeneralizedTime. d2i, i2d, check and print
functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or
@ -10530,7 +10602,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
[Steve Henson] [Steve Henson]
*) Correct Linux 1 recognition in config. *) Correct Linux 1 recognition in config.
[Ulf Möller <ulf@fitug.de>] [Ulf Möller <ulf@fitug.de>]
*) Remove pointless MD5 hash when using DSA keys in ca. *) Remove pointless MD5 hash when using DSA keys in ca.
[Anonymous <nobody@replay.com>] [Anonymous <nobody@replay.com>]
@ -10677,7 +10749,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k
*) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but *) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but
was already fixed by Eric for 0.9.1 it seems. was already fixed by Eric for 0.9.1 it seems.
[Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>] [Ben Laurie - pointed out by Ulf Möller <ulf@fitug.de>]
*) Autodetect FreeBSD3. *) Autodetect FreeBSD3.
[Ben Laurie] [Ben Laurie]

38
deps/openssl/openssl/CONTRIBUTING

@ -0,0 +1,38 @@
HOW TO CONTRIBUTE TO OpenSSL
----------------------------
Development is coordinated on the openssl-dev mailing list (see
http://www.openssl.org for information on subscribing). If you
would like to submit a patch, send it to rt@openssl.org with
the string "[PATCH]" in the subject. Please be sure to include a
textual explanation of what your patch does.
You can also make GitHub pull requests. If you do this, please also send
mail to rt@openssl.org with a brief description and a link to the PR so
that we can more easily keep track of it.
If you are unsure as to whether a feature will be useful for the general
OpenSSL community please discuss it on the openssl-dev mailing list first.
Someone may be already working on the same thing or there may be a good
reason as to why that feature isn't implemented.
Patches should be as up to date as possible, preferably relative to the
current Git or the last snapshot. They should follow our coding style
(see https://www.openssl.org/policies/codingstyle.html) and compile without
warnings using the --strict-warnings flag. OpenSSL compiles on many varied
platforms: try to ensure you only use portable features.
Our preferred format for patch files is "git format-patch" output. For example
to provide a patch file containing the last commit in your local git repository
use the following command:
# git format-patch --stdout HEAD^ >mydiffs.patch
Another method of creating an acceptable patch file without using git is as
follows:
# cd openssl-work
# [your changes]
# ./Configure dist; make clean
# cd ..
# diff -ur openssl-orig openssl-work > mydiffs.patch

11
deps/openssl/openssl/Configure

@ -416,6 +416,7 @@ my %table=(
"linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -O3 -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -O3 -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"debug-linux-x86_64-clang", "clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
"linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32", "linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
"linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64",
@ -1646,21 +1647,22 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
$shlib_minor=$2; $shlib_minor=$2;
} }
my $ecc = $cc;
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
if ($strict_warnings) if ($strict_warnings)
{ {
my $ecc = $cc;
$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
my $wopt; my $wopt;
die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/); die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
foreach $wopt (split /\s+/, $gcc_devteam_warn) foreach $wopt (split /\s+/, $gcc_devteam_warn)
{ {
$cflags .= " $wopt" unless ($cflags =~ /$wopt/) $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
} }
if ($ecc eq "clang") if ($ecc eq "clang")
{ {
foreach $wopt (split /\s+/, $clang_devteam_warn) foreach $wopt (split /\s+/, $clang_devteam_warn)
{ {
$cflags .= " $wopt" unless ($cflags =~ /$wopt/) $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
} }
} }
} }
@ -1713,6 +1715,7 @@ while (<IN>)
s/^AR=\s*ar/AR= $ar/; s/^AR=\s*ar/AR= $ar/;
s/^RANLIB=.*/RANLIB= $ranlib/; s/^RANLIB=.*/RANLIB= $ranlib/;
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
} }
s/^CFLAG=.*$/CFLAG= $cflags/; s/^CFLAG=.*$/CFLAG= $cflags/;
s/^DEPFLAG=.*$/DEPFLAG=$depflags/; s/^DEPFLAG=.*$/DEPFLAG=$depflags/;

1055
deps/openssl/openssl/FAQ

File diff suppressed because it is too large

37
deps/openssl/openssl/Makefile

@ -4,7 +4,7 @@
## Makefile for OpenSSL ## Makefile for OpenSSL
## ##
VERSION=1.0.2d VERSION=1.0.2e
MAJOR=1 MAJOR=1
MINOR=0.2 MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0 SHLIB_VERSION_NUMBER=1.0.0
@ -205,7 +205,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ # LC_ALL=C ensures that error [and other] messages are delivered in
# same language for uniform treatment.
BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
CC='$(CC)' CFLAG='$(CFLAG)' \ CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
@ -499,25 +501,28 @@ TABLE: Configure
# would occur. Therefore the list of files is temporarily stored into a file # would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option. # tar does not support the --files-from option.
tar: TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
--owner openssl:0 --group openssl:0 \
--transform 's|^|openssl-$(VERSION)/|' \
-cvf -
../$(TARFILE).list:
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
\! -name '*test' \! -name '.#*' \! -name '*~' \
| sort > ../$(TARFILE).list
tar: ../$(TARFILE).list
find . -type d -print | xargs chmod 755 find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x find . -type f -perm -0100 -print | xargs chmod a+x
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - |\
gzip --best >../$(TARFILE).gz; \
rm -f ../$(TARFILE).list; \
ls -l ../$(TARFILE).gz ls -l ../$(TARFILE).gz
tar-snap: tar-snap: ../$(TARFILE).list
@$(TAR) $(TARFLAGS) -cvf - \ $(TAR_COMMAND) > ../$(TARFILE)
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
ls -l ../$(TARFILE) ls -l ../$(TARFILE)
dist: dist:

37
deps/openssl/openssl/Makefile.bak

@ -4,7 +4,7 @@
## Makefile for OpenSSL ## Makefile for OpenSSL
## ##
VERSION=1.0.2d-dev VERSION=1.0.2e-dev
MAJOR=1 MAJOR=1
MINOR=0.2 MINOR=0.2
SHLIB_VERSION_NUMBER=1.0.0 SHLIB_VERSION_NUMBER=1.0.0
@ -205,7 +205,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ # LC_ALL=C ensures that error [and other] messages are delivered in
# same language for uniform treatment.
BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
CC='$(CC)' CFLAG='$(CFLAG)' \ CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
@ -499,25 +501,28 @@ TABLE: Configure
# would occur. Therefore the list of files is temporarily stored into a file # would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option. # tar does not support the --files-from option.
tar: TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
--owner openssl:0 --group openssl:0 \
--transform 's|^|openssl-$(VERSION)/|' \
-cvf -
../$(TARFILE).list:
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
\! -name '*test' \! -name '.#*' \! -name '*~' \
| sort > ../$(TARFILE).list
tar: ../$(TARFILE).list
find . -type d -print | xargs chmod 755 find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x find . -type f -perm -0100 -print | xargs chmod a+x
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - |\
gzip --best >../$(TARFILE).gz; \
rm -f ../$(TARFILE).list; \
ls -l ../$(TARFILE).gz ls -l ../$(TARFILE).gz
tar-snap: tar-snap: ../$(TARFILE).list
@$(TAR) $(TARFLAGS) -cvf - \ $(TAR_COMMAND) > ../$(TARFILE)
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
ls -l ../$(TARFILE) ls -l ../$(TARFILE)
dist: dist:

35
deps/openssl/openssl/Makefile.org

@ -203,7 +203,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
$${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
$${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ # LC_ALL=C ensures that error [and other] messages are delivered in
# same language for uniform treatment.
BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\
CC='$(CC)' CFLAG='$(CFLAG)' \ CC='$(CC)' CFLAG='$(CFLAG)' \
AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \
AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
@ -497,25 +499,28 @@ TABLE: Configure
# would occur. Therefore the list of files is temporarily stored into a file # would occur. Therefore the list of files is temporarily stored into a file
# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
# tar does not support the --files-from option. # tar does not support the --files-from option.
tar: TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list \
--owner openssl:0 --group openssl:0 \
--transform 's|^|openssl-$(VERSION)/|' \
-cvf -
../$(TARFILE).list:
find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \
\! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \
\! -name '*test' \! -name '.#*' \! -name '*~' \
| sort > ../$(TARFILE).list
tar: ../$(TARFILE).list
find . -type d -print | xargs chmod 755 find . -type d -print | xargs chmod 755
find . -type f -print | xargs chmod a+r find . -type f -print | xargs chmod a+r
find . -type f -perm -0100 -print | xargs chmod a+x find . -type f -perm -0100 -print | xargs chmod a+x
find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ $(TAR_COMMAND) | gzip --best >../$(TARFILE).gz
$(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - |\
gzip --best >../$(TARFILE).gz; \
rm -f ../$(TARFILE).list; \
ls -l ../$(TARFILE).gz ls -l ../$(TARFILE).gz
tar-snap: tar-snap: ../$(TARFILE).list
@$(TAR) $(TARFLAGS) -cvf - \ $(TAR_COMMAND) > ../$(TARFILE)
`find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ rm -f ../$(TARFILE).list
tardy --user_number=0 --user_name=openssl \
--group_number=0 --group_name=openssl \
--prefix=openssl-$(VERSION) - > ../$(TARFILE);\
ls -l ../$(TARFILE) ls -l ../$(TARFILE)
dist: dist:

10
deps/openssl/openssl/NEWS

@ -5,9 +5,19 @@
This file gives a brief overview of the major changes between each OpenSSL This file gives a brief overview of the major changes between each OpenSSL
release. For more details please read the CHANGES file. release. For more details please read the CHANGES file.
Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015]
o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193)
o Certificate verify crash with missing PSS parameter (CVE-2015-3194)
o X509_ATTRIBUTE memory leak (CVE-2015-3195)
o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs
o In DSA_generate_parameters_ex, if the provided seed is too short,
return an error
Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015] Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015]
o Alternate chains certificate forgery (CVE-2015-1793) o Alternate chains certificate forgery (CVE-2015-1793)
o Race condition handling PSK identify hint (CVE-2015-3196)
Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015] Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015]

178
deps/openssl/openssl/README

@ -1,7 +1,7 @@
OpenSSL 1.0.2d 9 Jul 2015 OpenSSL 1.0.2e 3 Dec 2015
Copyright (c) 1998-2011 The OpenSSL Project Copyright (c) 1998-2015 The OpenSSL Project
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
All rights reserved. All rights reserved.
@ -10,17 +10,17 @@
The OpenSSL Project is a collaborative effort to develop a robust, The OpenSSL Project is a collaborative effort to develop a robust,
commercial-grade, fully featured, and Open Source toolkit implementing the commercial-grade, fully featured, and Open Source toolkit implementing the
Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as
protocols as well as a full-strength general purpose cryptography library. well as a full-strength general purpose cryptograpic library. The project is
The project is managed by a worldwide community of volunteers that use the managed by a worldwide community of volunteers that use the Internet to
Internet to communicate, plan, and develop the OpenSSL toolkit and its communicate, plan, and develop the OpenSSL toolkit and its related
related documentation. documentation.
OpenSSL is based on the excellent SSLeay library developed from Eric A. Young OpenSSL is descended from the SSLeay library developed by Eric A. Young
and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the
OpenSSL license plus the SSLeay license) situation, which basically means OpenSSL license plus the SSLeay license), which means that you are free to
that you are free to get and use it for commercial and non-commercial get and use it for commercial and non-commercial purposes as long as you
purposes as long as you fulfill the conditions of both licenses. fulfill the conditions of both licenses.
OVERVIEW OVERVIEW
-------- --------
@ -28,90 +28,39 @@
The OpenSSL toolkit includes: The OpenSSL toolkit includes:
libssl.a: libssl.a:
Implementation of SSLv2, SSLv3, TLSv1 and the required code to support Provides the client and server-side implementations for SSLv3 and TLS.
both SSLv2, SSLv3 and TLSv1 in the one server and client.
libcrypto.a: libcrypto.a:
General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not Provides general cryptographic and X.509 support needed by SSL/TLS but
actually logically part of it. It includes routines for the following: not logically part of it.
Ciphers
libdes - EAY's libdes DES encryption package which was floating
around the net for a few years, and was then relicensed by
him as part of SSLeay. It includes 15 'modes/variations'
of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb;
pcbc and a more general form of cfb and ofb) including desx
in cbc mode, a fast crypt(3), and routines to read
passwords from the keyboard.
RC4 encryption,
RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb.
Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb.
IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb.
Digests
MD5 and MD2 message digest algorithms, fast implementations,
SHA (SHA-0) and SHA-1 message digest algorithms,
MDC2 message digest. A DES based hash that is popular on smart cards.
Public Key
RSA encryption/decryption/generation.
There is no limit on the number of bits.
DSA encryption/decryption/generation.
There is no limit on the number of bits.
Diffie-Hellman key-exchange/key generation.
There is no limit on the number of bits.
X.509v3 certificates
X509 encoding/decoding into/from binary ASN1 and a PEM
based ASCII-binary encoding which supports encryption with a
private key. Program to generate RSA and DSA certificate
requests and to generate RSA and DSA certificates.
Systems
The normal digital envelope routines and base64 encoding. Higher
level access to ciphers and digests by name. New ciphers can be
loaded at run time. The BIO io system which is a simple non-blocking
IO abstraction. Current methods supported are file descriptors,
sockets, socket accept, socket connect, memory buffer, buffering, SSL
client/server, file pointer, encryption, digest, non-blocking testing
and null.
Data structures
A dynamically growing hashing system
A simple stack.
A Configuration loader that uses a format similar to MS .ini files.
openssl: openssl:
A command line tool that can be used for: A command line tool that can be used for:
Creation of RSA, DH and DSA key parameters Creation of key parameters
Creation of X.509 certificates, CSRs and CRLs Creation of X.509 certificates, CSRs and CRLs
Calculation of Message Digests Calculation of message digests
Encryption and Decryption with Ciphers Encryption and decryption
SSL/TLS Client and Server Tests SSL/TLS client and server tests
Handling of S/MIME signed or encrypted mail Handling of S/MIME signed or encrypted mail
And more...
INSTALLATION INSTALLATION
------------ ------------
To install this package under a Unix derivative, read the INSTALL file. For See the appropriate file:
a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read INSTALL Linux, Unix, etc.
INSTALL.VMS. INSTALL.DJGPP DOS platform with DJGPP
INSTALL.NW Netware
Read the documentation in the doc/ directory. It is quite rough, but it INSTALL.OS2 OS/2
lists the functions; you will probably have to look at the code to work out INSTALL.VMS VMS
how to use them. Look at the example programs. INSTALL.W32 Windows (32bit)
INSTALL.W64 Windows (64bit)
PROBLEMS INSTALL.WCE Windows CE
--------
For some platforms, there are some known problems that may affect the user
or application author. We try to collect those in doc/PROBLEMS, with current
thoughts on how they should be solved in a future of OpenSSL.
SUPPORT SUPPORT
------- -------
See the OpenSSL website www.openssl.org for details of how to obtain See the OpenSSL website www.openssl.org for details on how to obtain
commercial technical support. commercial technical support.
If you have any problems with OpenSSL then please take the following steps If you have any problems with OpenSSL then please take the following steps
@ -137,56 +86,33 @@
Email the report to: Email the report to:
openssl-bugs@openssl.org rt@openssl.org
In order to avoid spam, this is a moderated mailing list, and it might
take a day for the ticket to show up. (We also scan posts to make sure
that security disclosures aren't publically posted by mistake.) Mail to
this address is recorded in the public RT (request tracker) database (see
https://www.openssl.org/support/rt.html for details) and also forwarded
the public openssl-dev mailing list. Confidential mail may be sent to
openssl-security@openssl.org (PGP key available from the key servers).
Note that the request tracker should NOT be used for general assistance Please do NOT use this for general assistance or support queries.
or support queries. Just because something doesn't work the way you expect Just because something doesn't work the way you expect does not mean it
does not mean it is necessarily a bug in OpenSSL. is necessarily a bug in OpenSSL.
Note that mail to openssl-bugs@openssl.org is recorded in the public You can also make GitHub pull requests. If you do this, please also send
request tracker database (see https://www.openssl.org/support/rt.html mail to rt@openssl.org with a link to the PR so that we can more easily
for details) and also forwarded to a public mailing list. Confidential keep track of it.
mail may be sent to openssl-security@openssl.org (PGP key available from
the key servers).
HOW TO CONTRIBUTE TO OpenSSL HOW TO CONTRIBUTE TO OpenSSL
---------------------------- ----------------------------
Development is coordinated on the openssl-dev mailing list (see See CONTRIBUTING
http://www.openssl.org for information on subscribing). If you
would like to submit a patch, send it to openssl-bugs@openssl.org with LEGALITIES
the string "[PATCH]" in the subject. Please be sure to include a ----------
textual explanation of what your patch does.
If you are unsure as to whether a feature will be useful for the general
OpenSSL community please discuss it on the openssl-dev mailing list first.
Someone may be already working on the same thing or there may be a good
reason as to why that feature isn't implemented.
Patches should be as up to date as possible, preferably relative to the
current Git or the last snapshot. They should follow the coding style of
OpenSSL and compile without warnings. Some of the core team developer targets
can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL
compiles on many varied platforms: try to ensure you only use portable
features.
Note: For legal reasons, contributions from the US can be accepted only
if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov
(formerly BXA) with a copy to the ENC Encryption Request Coordinator;
please take some time to look at
http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic]
and
http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e))
for the details. If "your encryption source code is too large to serve as
an email attachment", they are glad to receive it by fax instead; hope you
have a cheap long-distance plan.
Our preferred format for changes is "diff -u" output. You might
generate it like this:
# cd openssl-work
# [your changes]
# ./Configure dist; make clean
# cd ..
# diff -ur openssl-orig openssl-work > mydiffs.patch
A number of nations, in particular the U.S., restrict the use or export
of cryptography. If you are potentially subject to such restrictions
you should seek competent professional legal advice before attempting to
develop or distribute cryptographic code.

2
deps/openssl/openssl/apps/Makefile

@ -135,7 +135,7 @@ update: openssl-vms.cnf local_depend
depend: local_depend depend: local_depend
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
local_depend: local_depend:
@[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \ @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC)
dclean: dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new

3
deps/openssl/openssl/apps/app_rand.c

@ -129,10 +129,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
* -no_rand_screen option in s_client * -no_rand_screen option in s_client
*/ */
if (dont_warn != 2) { if (dont_warn != 2) {
BIO_printf(bio_e, "Loading 'screen' into random state -");
BIO_flush(bio_e);
RAND_screen(); RAND_screen();
BIO_printf(bio_e, " done\n");
} }
#endif #endif

9
deps/openssl/openssl/apps/apps.c

@ -119,9 +119,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
# include <strings.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
@ -1352,7 +1349,11 @@ int set_name_ex(unsigned long *flags, const char *arg)
{"ca_default", XN_FLAG_MULTILINE, 0xffffffffL}, {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL},
{NULL, 0, 0} {NULL, 0, 0}
}; };
return set_multi_opts(flags, arg, ex_tbl); if (set_multi_opts(flags, arg, ex_tbl) == 0)
return 0;
if ((*flags & XN_FLAG_SEP_MASK) == 0)
*flags |= XN_FLAG_SEP_CPLUS_SPC;
return 1;
} }
int set_ext_copy(int *copy_type, const char *arg) int set_ext_copy(int *copy_type, const char *arg)

4
deps/openssl/openssl/apps/asn1pars.c

@ -313,9 +313,9 @@ int MAIN(int argc, char **argv)
} }
typ = ASN1_TYPE_get(at); typ = ASN1_TYPE_get(at);
if ((typ == V_ASN1_OBJECT) if ((typ == V_ASN1_OBJECT)
|| (typ == V_ASN1_BOOLEAN)
|| (typ == V_ASN1_NULL)) { || (typ == V_ASN1_NULL)) {
BIO_printf(bio_err, "Can't parse %s type\n", BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ));
typ == V_ASN1_NULL ? "NULL" : "OBJECT");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }

14
deps/openssl/openssl/apps/ca.c

@ -99,25 +99,19 @@
#undef PROG #undef PROG
#define PROG ca_main #define PROG ca_main
#define BASE_SECTION "ca" #define BASE_SECTION "ca"
#define CONFIG_FILE "openssl.cnf" #define CONFIG_FILE "openssl.cnf"
#define ENV_DEFAULT_CA "default_ca" #define ENV_DEFAULT_CA "default_ca"
#define STRING_MASK "string_mask" #define STRING_MASK "string_mask"
#define UTF8_IN "utf8" #define UTF8_IN "utf8"
#define ENV_DIR "dir"
#define ENV_CERTS "certs"
#define ENV_CRL_DIR "crl_dir"
#define ENV_CA_DB "CA_DB"
#define ENV_NEW_CERTS_DIR "new_certs_dir" #define ENV_NEW_CERTS_DIR "new_certs_dir"
#define ENV_CERTIFICATE "certificate" #define ENV_CERTIFICATE "certificate"
#define ENV_SERIAL "serial" #define ENV_SERIAL "serial"
#define ENV_CRLNUMBER "crlnumber" #define ENV_CRLNUMBER "crlnumber"
#define ENV_CRL "crl"
#define ENV_PRIVATE_KEY "private_key" #define ENV_PRIVATE_KEY "private_key"
#define ENV_RANDFILE "RANDFILE"
#define ENV_DEFAULT_DAYS "default_days" #define ENV_DEFAULT_DAYS "default_days"
#define ENV_DEFAULT_STARTDATE "default_startdate" #define ENV_DEFAULT_STARTDATE "default_startdate"
#define ENV_DEFAULT_ENDDATE "default_enddate" #define ENV_DEFAULT_ENDDATE "default_enddate"
@ -2538,6 +2532,8 @@ static int do_updatedb(CA_DB *db)
char **rrow, *a_tm_s; char **rrow, *a_tm_s;
a_tm = ASN1_UTCTIME_new(); a_tm = ASN1_UTCTIME_new();
if (a_tm == NULL)
return -1;
/* get actual time and make a string */ /* get actual time and make a string */
a_tm = X509_gmtime_adj(a_tm, 0); a_tm = X509_gmtime_adj(a_tm, 0);

7
deps/openssl/openssl/apps/ecparam.c

@ -416,14 +416,13 @@ int MAIN(int argc, char **argv)
} }
if (check) { if (check) {
if (group == NULL)
BIO_printf(bio_err, "no elliptic curve parameters\n");
BIO_printf(bio_err, "checking elliptic curve parameters: "); BIO_printf(bio_err, "checking elliptic curve parameters: ");
if (!EC_GROUP_check(group, NULL)) { if (!EC_GROUP_check(group, NULL)) {
BIO_printf(bio_err, "failed\n"); BIO_printf(bio_err, "failed\n");
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
} else goto end;
BIO_printf(bio_err, "ok\n"); }
BIO_printf(bio_err, "ok\n");
} }

5
deps/openssl/openssl/apps/engine.c

@ -99,8 +99,6 @@ static void identity(char *ptr)
static int append_buf(char **buf, const char *s, int *size, int step) static int append_buf(char **buf, const char *s, int *size, int step)
{ {
int l = strlen(s);
if (*buf == NULL) { if (*buf == NULL) {
*size = step; *size = step;
*buf = OPENSSL_malloc(*size); *buf = OPENSSL_malloc(*size);
@ -109,9 +107,6 @@ static int append_buf(char **buf, const char *s, int *size, int step)
**buf = '\0'; **buf = '\0';
} }
if (**buf != '\0')
l += 2; /* ", " */
if (strlen(*buf) + strlen(s) >= (unsigned int)*size) { if (strlen(*buf) + strlen(s) >= (unsigned int)*size) {
*size += step; *size += step;
*buf = OPENSSL_realloc(*buf, *size); *buf = OPENSSL_realloc(*buf, *size);

2
deps/openssl/openssl/apps/md4.c

@ -1 +1 @@
../crypto/md4/md4.c openssl-1.0.2e/../crypto/md4/md4.c

4
deps/openssl/openssl/apps/ocsp.c

@ -1261,8 +1261,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path,
return NULL; return NULL;
} }
if (BIO_get_fd(cbio, &fd) <= 0) { if (BIO_get_fd(cbio, &fd) < 0) {
BIO_puts(err, "Can't get connection fd\n"); BIO_puts(bio_err, "Can't get connection fd\n");
goto err; goto err;
} }

14
deps/openssl/openssl/apps/pkcs12.c

@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)
apps_startup(); apps_startup();
# ifdef OPENSSL_FIPS
if (FIPS_mode())
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
else
# endif
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
enc = EVP_des_ede3_cbc(); enc = EVP_des_ede3_cbc();
if (bio_err == NULL) if (bio_err == NULL)
bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
@ -148,6 +141,13 @@ int MAIN(int argc, char **argv)
if (!load_config(bio_err, NULL)) if (!load_config(bio_err, NULL))
goto end; goto end;
# ifdef OPENSSL_FIPS
if (FIPS_mode())
cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
else
# endif
cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;
args = argv + 1; args = argv + 1;
while (*args) { while (*args) {

5
deps/openssl/openssl/apps/s_cb.c

@ -981,6 +981,11 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
extname = "next protocol"; extname = "next protocol";
break; break;
#endif #endif
#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
case TLSEXT_TYPE_application_layer_protocol_negotiation:
extname = "application layer protocol negotiation";
break;
#endif
case TLSEXT_TYPE_padding: case TLSEXT_TYPE_padding:
extname = "TLS padding"; extname = "TLS padding";

11
deps/openssl/openssl/apps/s_client.c

@ -432,6 +432,14 @@ static void sc_usage(void)
" -no_ticket - disable use of RFC4507bis session tickets\n"); " -no_ticket - disable use of RFC4507bis session tickets\n");
BIO_printf(bio_err, BIO_printf(bio_err,
" -serverinfo types - send empty ClientHello extensions (comma-separated numbers)\n"); " -serverinfo types - send empty ClientHello extensions (comma-separated numbers)\n");
BIO_printf(bio_err,
" -curves arg - Elliptic curves to advertise (colon-separated list)\n");
BIO_printf(bio_err,
" -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
BIO_printf(bio_err,
" -client_sigalgs arg - Signature algorithms to support for client\n");
BIO_printf(bio_err,
" certificate authentication (colon-separated list)\n");
#endif #endif
#ifndef OPENSSL_NO_NEXTPROTONEG #ifndef OPENSSL_NO_NEXTPROTONEG
BIO_printf(bio_err, BIO_printf(bio_err,
@ -2080,6 +2088,9 @@ int MAIN(int argc, char **argv)
sk_X509_pop_free(chain, X509_free); sk_X509_pop_free(chain, X509_free);
if (pass) if (pass)
OPENSSL_free(pass); OPENSSL_free(pass);
#ifndef OPENSSL_NO_SRP
OPENSSL_free(srp_arg.srppassin);
#endif
if (vpm) if (vpm)
X509_VERIFY_PARAM_free(vpm); X509_VERIFY_PARAM_free(vpm);
ssl_excert_free(exc); ssl_excert_free(exc);

51
deps/openssl/openssl/apps/s_server.c

@ -652,6 +652,12 @@ static void sv_usage(void)
" -no_ticket - disable use of RFC4507bis session tickets\n"); " -no_ticket - disable use of RFC4507bis session tickets\n");
BIO_printf(bio_err, BIO_printf(bio_err,
" -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); " -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n");
BIO_printf(bio_err,
" -sigalgs arg - Signature algorithms to support (colon-separated list)\n");
BIO_printf(bio_err,
" -client_sigalgs arg - Signature algorithms to support for client \n");
BIO_printf(bio_err,
" certificate authentication (colon-separated list)\n");
# ifndef OPENSSL_NO_NEXTPROTONEG # ifndef OPENSSL_NO_NEXTPROTONEG
BIO_printf(bio_err, BIO_printf(bio_err,
" -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n"); " -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n");
@ -2881,6 +2887,21 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context)
goto err; goto err;
} else { } else {
BIO_printf(bio_s_out, "read R BLOCK\n"); BIO_printf(bio_s_out, "read R BLOCK\n");
#ifndef OPENSSL_NO_SRP
if (BIO_should_io_special(io)
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
srp_callback_parm.user =
SRP_VBASE_get_by_user(srp_callback_parm.vb,
srp_callback_parm.login);
if (srp_callback_parm.user)
BIO_printf(bio_s_out, "LOOKUP done %s\n",
srp_callback_parm.user->info);
else
BIO_printf(bio_s_out, "LOOKUP not successful\n");
continue;
}
#endif
#if defined(OPENSSL_SYS_NETWARE) #if defined(OPENSSL_SYS_NETWARE)
delay(1000); delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) #elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
@ -3211,6 +3232,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
ERR_print_errors(bio_err); ERR_print_errors(bio_err);
goto end; goto end;
} }
#ifndef OPENSSL_NO_SRP
if (BIO_should_io_special(io)
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
BIO_printf(bio_s_out, "LOOKUP renego during accept\n");
srp_callback_parm.user =
SRP_VBASE_get_by_user(srp_callback_parm.vb,
srp_callback_parm.login);
if (srp_callback_parm.user)
BIO_printf(bio_s_out, "LOOKUP done %s\n",
srp_callback_parm.user->info);
else
BIO_printf(bio_s_out, "LOOKUP not successful\n");
continue;
}
#endif
} }
BIO_printf(bio_err, "CONNECTION ESTABLISHED\n"); BIO_printf(bio_err, "CONNECTION ESTABLISHED\n");
print_ssl_summary(bio_err, con); print_ssl_summary(bio_err, con);
@ -3224,6 +3260,21 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context)
goto err; goto err;
} else { } else {
BIO_printf(bio_s_out, "read R BLOCK\n"); BIO_printf(bio_s_out, "read R BLOCK\n");
#ifndef OPENSSL_NO_SRP
if (BIO_should_io_special(io)
&& BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) {
BIO_printf(bio_s_out, "LOOKUP renego during read\n");
srp_callback_parm.user =
SRP_VBASE_get_by_user(srp_callback_parm.vb,
srp_callback_parm.login);
if (srp_callback_parm.user)
BIO_printf(bio_s_out, "LOOKUP done %s\n",
srp_callback_parm.user->info);
else
BIO_printf(bio_s_out, "LOOKUP not successful\n");
continue;
}
#endif
#if defined(OPENSSL_SYS_NETWARE) #if defined(OPENSSL_SYS_NETWARE)
delay(1000); delay(1000);
#elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) #elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)

60
deps/openssl/openssl/appveyor.yml

@ -0,0 +1,60 @@
platform:
- x86
- x64
environment:
matrix:
- VSVER: 9
- VSVER: 10
- VSVER: 11
- VSVER: 12
- VSVER: 14
configuration:
- plain
- shared
matrix:
allow_failures:
- platform: x64
VSVER: 9
- platform: x64
VSVER: 10
- platform: x64
VSVER: 11
before_build:
- ps: >-
If ($env:Platform -Match "x86") {
$env:VCVARS_PLATFORM="x86"
$env:TARGET="VC-WIN32"
$env:DO="do_ms"
} Else {
$env:VCVARS_PLATFORM="amd64"
$env:TARGET="VC-WIN64A"
$env:DO="do_win64a"
}
- ps: >-
If ($env:Configuration -Like "*shared*") {
$env:MAK="ntdll.mak"
} Else {
$env:MAK="nt.mak"
}
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- perl Configure %TARGET% no-asm
- call ms\%DO%
build_script:
- nmake /f ms\%MAK%
test_script:
- nmake /f ms\%MAK% test
notifications:
- provider: Email
to:
- openssl-commits@openssl.org
on_build_success: false
on_build_failure: true
on_build_status_changed: true

6
deps/openssl/openssl/crypto/aes/asm/aes-586.pl

@ -45,7 +45,7 @@
# the undertaken effort was that it appeared that in tight IA-32 # the undertaken effort was that it appeared that in tight IA-32
# register window little-endian flavor could achieve slightly higher # register window little-endian flavor could achieve slightly higher
# Instruction Level Parallelism, and it indeed resulted in up to 15% # Instruction Level Parallelism, and it indeed resulted in up to 15%
# better performance on most recent µ-archs... # better performance on most recent µ-archs...
# #
# Third version adds AES_cbc_encrypt implementation, which resulted in # Third version adds AES_cbc_encrypt implementation, which resulted in
# up to 40% performance imrovement of CBC benchmark results. 40% was # up to 40% performance imrovement of CBC benchmark results. 40% was
@ -224,7 +224,7 @@ sub _data_word() { my $i; while(defined($i=shift)) { &data_word($i,$i); } }
$speed_limit=512; # chunks smaller than $speed_limit are $speed_limit=512; # chunks smaller than $speed_limit are
# processed with compact routine in CBC mode # processed with compact routine in CBC mode
$small_footprint=1; # $small_footprint=1 code is ~5% slower [on $small_footprint=1; # $small_footprint=1 code is ~5% slower [on
# recent µ-archs], but ~5 times smaller! # recent µ-archs], but ~5 times smaller!
# I favor compact code to minimize cache # I favor compact code to minimize cache
# contention and in hope to "collect" 5% back # contention and in hope to "collect" 5% back
# in real-life applications... # in real-life applications...
@ -565,7 +565,7 @@ sub enctransform()
# Performance is not actually extraordinary in comparison to pure # Performance is not actually extraordinary in comparison to pure
# x86 code. In particular encrypt performance is virtually the same. # x86 code. In particular encrypt performance is virtually the same.
# Decrypt performance on the other hand is 15-20% better on newer # Decrypt performance on the other hand is 15-20% better on newer
# µ-archs [but we're thankful for *any* improvement here], and ~50% # µ-archs [but we're thankful for *any* improvement here], and ~50%
# better on PIII:-) And additionally on the pros side this code # better on PIII:-) And additionally on the pros side this code
# eliminates redundant references to stack and thus relieves/ # eliminates redundant references to stack and thus relieves/
# minimizes the pressure on the memory bus. # minimizes the pressure on the memory bus.

2
deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl

@ -63,7 +63,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=11); $avx = ($1>=10) + ($1>=11);
} }
if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0); $avx = ($2>=3.0) + ($2>3.0);
} }

2
deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl

@ -94,7 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
$avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
`ml64 2>&1` =~ /Version ([0-9]+)\./ && `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
$1>=10); $1>=10);
$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); $avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0);
$shaext=1; ### set to zero if compiling for 1.0.1 $shaext=1; ### set to zero if compiling for 1.0.1

9
deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl

@ -59,7 +59,7 @@ if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$avx = ($1>=10) + ($1>=12); $avx = ($1>=10) + ($1>=12);
} }
if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
$avx = ($2>=3.0) + ($2>3.0); $avx = ($2>=3.0) + ($2>3.0);
} }
@ -139,11 +139,8 @@ $code.=<<___ if ($avx>1);
je ${func}_avx2 je ${func}_avx2
___ ___
$code.=<<___; $code.=<<___;
and \$`1<<30`,%eax # mask "Intel CPU" bit and \$`1<<28`,%r10d # check for AVX
and \$`1<<28|1<<9`,%r10d # mask AVX+SSSE3 bits jnz ${func}_avx
or %eax,%r10d
cmp \$`1<<28|1<<9|1<<30`,%r10d
je ${func}_avx
ud2 ud2
___ ___
} }

2
deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl

@ -88,7 +88,7 @@ $inout3="xmm5"; $in1="xmm5";
$inout4="xmm6"; $in0="xmm6"; $inout4="xmm6"; $in0="xmm6";
$inout5="xmm7"; $ivec="xmm7"; $inout5="xmm7"; $ivec="xmm7";
# AESNI extenstion # AESNI extension
sub aeskeygenassist sub aeskeygenassist
{ my($dst,$src,$imm)=@_; { my($dst,$src,$imm)=@_;
if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/)

198
deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl

@ -337,24 +337,27 @@ Lenc_entry:
addi $inp, $inp, 15 # 15 is not a typo addi $inp, $inp, 15 # 15 is not a typo
?lvsr $outperm, 0, $out ?lvsr $outperm, 0, $out
?lvsl $keyperm, 0, $key # prepare for unaligned access ?lvsl $keyperm, 0, $key # prepare for unaligned access
vnor $outmask, v7, v7 # 0xff..ff
lvx $inptail, 0, $inp # redundant in aligned case lvx $inptail, 0, $inp # redundant in aligned case
?vperm $outmask, v7, $outmask, $outperm
lvx $outhead, 0, $out
?vperm v0, v0, $inptail, $inpperm ?vperm v0, v0, $inptail, $inpperm
bl _vpaes_encrypt_core bl _vpaes_encrypt_core
andi. r8, $out, 15
li r9, 16
beq Lenc_out_aligned
vperm v0, v0, v0, $outperm # rotate right/left vperm v0, v0, v0, $outperm # rotate right/left
vsel v1, $outhead, v0, $outmask mtctr r9
vmr $outhead, v0 Lenc_out_unaligned:
stvx v1, 0, $out stvebx v0, 0, $out
addi $out, $out, 15 # 15 is not a typo addi $out, $out, 1
######## bdnz Lenc_out_unaligned
b Lenc_done
lvx v1, 0, $out # redundant in aligned case .align 4
vsel v1, $outhead, v1, $outmask Lenc_out_aligned:
stvx v1, 0, $out stvx v0, 0, $out
Lenc_done:
li r10,`15+6*$SIZE_T` li r10,`15+6*$SIZE_T`
li r11,`31+6*$SIZE_T` li r11,`31+6*$SIZE_T`
@ -566,24 +569,27 @@ Ldec_entry:
addi $inp, $inp, 15 # 15 is not a typo addi $inp, $inp, 15 # 15 is not a typo
?lvsr $outperm, 0, $out ?lvsr $outperm, 0, $out
?lvsl $keyperm, 0, $key ?lvsl $keyperm, 0, $key
vnor $outmask, v7, v7 # 0xff..ff
lvx $inptail, 0, $inp # redundant in aligned case lvx $inptail, 0, $inp # redundant in aligned case
?vperm $outmask, v7, $outmask, $outperm
lvx $outhead, 0, $out
?vperm v0, v0, $inptail, $inpperm ?vperm v0, v0, $inptail, $inpperm
bl _vpaes_decrypt_core bl _vpaes_decrypt_core
andi. r8, $out, 15
li r9, 16
beq Ldec_out_aligned
vperm v0, v0, v0, $outperm # rotate right/left vperm v0, v0, v0, $outperm # rotate right/left
vsel v1, $outhead, v0, $outmask mtctr r9
vmr $outhead, v0 Ldec_out_unaligned:
stvx v1, 0, $out stvebx v0, 0, $out
addi $out, $out, 15 # 15 is not a typo addi $out, $out, 1
######## bdnz Ldec_out_unaligned
b Ldec_done
lvx v1, 0, $out # redundant in aligned case .align 4
vsel v1, $outhead, v1, $outmask Ldec_out_aligned:
stvx v1, 0, $out stvx v0, 0, $out
Ldec_done:
li r10,`15+6*$SIZE_T` li r10,`15+6*$SIZE_T`
li r11,`31+6*$SIZE_T` li r11,`31+6*$SIZE_T`
@ -658,11 +664,11 @@ Ldec_entry:
$PUSH r0, `$FRAME+$SIZE_T*2+$LRSAVE`($sp) $PUSH r0, `$FRAME+$SIZE_T*2+$LRSAVE`($sp)
and r30, r5, r9 # copy length&-16 and r30, r5, r9 # copy length&-16
andi. r9, $out, 15 # is $out aligned?
mr r5, r6 # copy pointer to key mr r5, r6 # copy pointer to key
mr r31, r7 # copy pointer to iv mr r31, r7 # copy pointer to iv
blt Lcbc_abort
cmpwi r8, 0 # test direction
li r6, -1 li r6, -1
mcrf cr1, cr0 # put aside $out alignment flag
mr r7, r12 # copy vrsave mr r7, r12 # copy vrsave
mtspr 256, r6 # preserve all AltiVec registers mtspr 256, r6 # preserve all AltiVec registers
@ -672,6 +678,7 @@ Ldec_entry:
lvx v25, r9, r31 lvx v25, r9, r31
?vperm v24, v24, v25, $inpperm ?vperm v24, v24, v25, $inpperm
cmpwi r8, 0 # test direction
neg r8, $inp # prepare for unaligned access neg r8, $inp # prepare for unaligned access
vxor v7, v7, v7 vxor v7, v7, v7
?lvsl $keyperm, 0, $key ?lvsl $keyperm, 0, $key
@ -681,13 +688,37 @@ Ldec_entry:
lvx $inptail, 0, $inp lvx $inptail, 0, $inp
?vperm $outmask, v7, $outmask, $outperm ?vperm $outmask, v7, $outmask, $outperm
addi $inp, $inp, 15 # 15 is not a typo addi $inp, $inp, 15 # 15 is not a typo
lvx $outhead, 0, $out
beq Lcbc_decrypt beq Lcbc_decrypt
bl _vpaes_encrypt_preheat bl _vpaes_encrypt_preheat
li r0, 16 li r0, 16
beq cr1, Lcbc_enc_loop # $out is aligned
vmr v0, $inptail
lvx $inptail, 0, $inp
addi $inp, $inp, 16
?vperm v0, v0, $inptail, $inpperm
vxor v0, v0, v24 # ^= iv
bl _vpaes_encrypt_core
andi. r8, $out, 15
vmr v24, v0 # put aside iv
sub r9, $out, r8
vperm $outhead, v0, v0, $outperm # rotate right/left
Lcbc_enc_head:
stvebx $outhead, r8, r9
cmpwi r8, 15
addi r8, r8, 1
bne Lcbc_enc_head
sub. r30, r30, r0 # len -= 16
addi $out, $out, 16
beq Lcbc_unaligned_done
Lcbc_enc_loop: Lcbc_enc_loop:
vmr v0, $inptail vmr v0, $inptail
lvx $inptail, 0, $inp lvx $inptail, 0, $inp
@ -713,6 +744,32 @@ Lcbc_decrypt:
bl _vpaes_decrypt_preheat bl _vpaes_decrypt_preheat
li r0, 16 li r0, 16
beq cr1, Lcbc_dec_loop # $out is aligned
vmr v0, $inptail
lvx $inptail, 0, $inp
addi $inp, $inp, 16
?vperm v0, v0, $inptail, $inpperm
vmr v25, v0 # put aside input
bl _vpaes_decrypt_core
andi. r8, $out, 15
vxor v0, v0, v24 # ^= iv
vmr v24, v25
sub r9, $out, r8
vperm $outhead, v0, v0, $outperm # rotate right/left
Lcbc_dec_head:
stvebx $outhead, r8, r9
cmpwi r8, 15
addi r8, r8, 1
bne Lcbc_dec_head
sub. r30, r30, r0 # len -= 16
addi $out, $out, 16
beq Lcbc_unaligned_done
Lcbc_dec_loop: Lcbc_dec_loop:
vmr v0, $inptail vmr v0, $inptail
lvx $inptail, 0, $inp lvx $inptail, 0, $inp
@ -733,23 +790,29 @@ Lcbc_dec_loop:
bne Lcbc_dec_loop bne Lcbc_dec_loop
Lcbc_done: Lcbc_done:
addi $out, $out, -1 beq cr1, Lcbc_write_iv # $out is aligned
lvx v1, 0, $out # redundant in aligned case
vsel v1, $outhead, v1, $outmask Lcbc_unaligned_done:
stvx v1, 0, $out andi. r8, $out, 15
sub $out, $out, r8
li r9, 0
Lcbc_tail:
stvebx $outhead, r9, $out
addi r9, r9, 1
cmpw r9, r8
bne Lcbc_tail
Lcbc_write_iv:
neg r8, r31 # write [potentially unaligned] iv neg r8, r31 # write [potentially unaligned] iv
li r10, 4
?lvsl $outperm, 0, r8 ?lvsl $outperm, 0, r8
li r6, 15 li r11, 8
vnor $outmask, v7, v7 # 0xff..ff li r12, 12
?vperm $outmask, v7, $outmask, $outperm
lvx $outhead, 0, r31
vperm v24, v24, v24, $outperm # rotate right/left vperm v24, v24, v24, $outperm # rotate right/left
vsel v0, $outhead, v24, $outmask stvewx v24, 0, r31 # ivp is at least 32-bit aligned
lvx v1, r6, r31 stvewx v24, r10, r31
stvx v0, 0, r31 stvewx v24, r11, r31
vsel v1, v24, v1, $outmask stvewx v24, r12, r31
stvx v1, r6, r31
mtspr 256, r7 # restore vrsave mtspr 256, r7 # restore vrsave
li r10,`15+6*$SIZE_T` li r10,`15+6*$SIZE_T`
@ -872,18 +935,21 @@ _vpaes_schedule_core:
# encrypting, output zeroth round key after transform # encrypting, output zeroth round key after transform
li r8, 0x30 # mov \$0x30,%r8d li r8, 0x30 # mov \$0x30,%r8d
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 li r9, 4
li r10, 8
li r11, 12
?lvsr $outperm, 0, $out # prepare for unaligned access ?lvsr $outperm, 0, $out # prepare for unaligned access
vnor $outmask, v9, v9 # 0xff..ff vnor $outmask, v9, v9 # 0xff..ff
lvx $outhead, 0, $out
?vperm $outmask, v9, $outmask, $outperm ?vperm $outmask, v9, $outmask, $outperm
#stvx v0, 0, $out # vmovdqu %xmm0, (%rdx) #stvx v0, 0, $out # vmovdqu %xmm0, (%rdx)
vperm v1, v0, v0, $outperm # rotate right/left vperm $outhead, v0, v0, $outperm # rotate right/left
vsel v2, $outhead, v1, $outmask stvewx $outhead, 0, $out # some are superfluous
vmr $outhead, v1 stvewx $outhead, r9, $out
stvx v2, 0, $out stvewx $outhead, r10, $out
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
stvewx $outhead, r11, $out
b Lschedule_go b Lschedule_go
Lschedule_am_decrypting: Lschedule_am_decrypting:
@ -893,20 +959,24 @@ Lschedule_am_decrypting:
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
# decrypting, output zeroth round key after shiftrows # decrypting, output zeroth round key after shiftrows
lvx v1, r8, r10 # vmovdqa (%r8,%r10), %xmm1 lvx v1, r8, r10 # vmovdqa (%r8,%r10), %xmm1
li r9, 4
li r10, 8
li r11, 12
vperm v4, v3, v3, v1 # vpshufb %xmm1, %xmm3, %xmm3 vperm v4, v3, v3, v1 # vpshufb %xmm1, %xmm3, %xmm3
neg r0, $out # prepare for unaligned access neg r0, $out # prepare for unaligned access
?lvsl $outperm, 0, r0 ?lvsl $outperm, 0, r0
addi $out, $out, 15 # 15 is not typo
vnor $outmask, v9, v9 # 0xff..ff vnor $outmask, v9, v9 # 0xff..ff
lvx $outhead, 0, $out
?vperm $outmask, $outmask, v9, $outperm ?vperm $outmask, $outmask, v9, $outperm
#stvx v4, 0, $out # vmovdqu %xmm3, (%rdx) #stvx v4, 0, $out # vmovdqu %xmm3, (%rdx)
vperm v4, v4, v4, $outperm # rotate right/left vperm $outhead, v4, v4, $outperm # rotate right/left
vsel v2, $outhead, v4, $outmask stvewx $outhead, 0, $out # some are superfluous
vmr $outhead, v4 stvewx $outhead, r9, $out
stvx v2, 0, $out stvewx $outhead, r10, $out
addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10
stvewx $outhead, r11, $out
addi $out, $out, 15 # 15 is not typo
xori r8, r8, 0x30 # xor \$0x30, %r8 xori r8, r8, 0x30 # xor \$0x30, %r8
Lschedule_go: Lschedule_go:
@ -1038,14 +1108,15 @@ Lschedule_mangle_last:
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key #stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
vperm v0, v0, v0, $outperm # rotate right/left vperm v0, v0, v0, $outperm # rotate right/left
li r10, 4
vsel v2, $outhead, v0, $outmask vsel v2, $outhead, v0, $outmask
vmr $outhead, v0 li r11, 8
stvx v2, 0, $out stvx v2, 0, $out
li r12, 12
addi $out, $out, 15 # 15 is not typo stvewx v0, 0, $out # some (or all) are redundant
lvx v1, 0, $out # redundant in aligned case stvewx v0, r10, $out
vsel v1, $outhead, v1, $outmask stvewx v0, r11, $out
stvx v1, 0, $out stvewx v0, r12, $out
b Lschedule_mangle_done b Lschedule_mangle_done
.align 4 .align 4
@ -1057,15 +1128,18 @@ Lschedule_mangle_last_dec:
bl _vpaes_schedule_transform # output transform bl _vpaes_schedule_transform # output transform
#stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key #stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key
addi r9, $out, -15 # -15 is not typo
vperm v0, v0, v0, $outperm # rotate right/left vperm v0, v0, v0, $outperm # rotate right/left
li r10, 4
vsel v2, $outhead, v0, $outmask vsel v2, $outhead, v0, $outmask
vmr $outhead, v0 li r11, 8
stvx v2, 0, $out stvx v2, 0, $out
li r12, 12
stvewx v0, 0, r9 # some (or all) are redundant
stvewx v0, r10, r9
stvewx v0, r11, r9
stvewx v0, r12, r9
addi $out, $out, -15 # -15 is not typo
lvx v1, 0, $out # redundant in aligned case
vsel v1, $outhead, v1, $outmask
stvx v1, 0, $out
Lschedule_mangle_done: Lschedule_mangle_done:
mtlr r7 mtlr r7

10
deps/openssl/openssl/crypto/asn1/asn1_par.c

@ -62,6 +62,10 @@
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/asn1.h> #include <openssl/asn1.h>
#ifndef ASN1_PARSE_MAXDEPTH
#define ASN1_PARSE_MAXDEPTH 128
#endif
static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
int indent); int indent);
static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
@ -128,6 +132,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length,
#else #else
dump_indent = 6; /* Because we know BIO_dump_indent() */ dump_indent = 6; /* Because we know BIO_dump_indent() */
#endif #endif
if (depth > ASN1_PARSE_MAXDEPTH) {
BIO_puts(bp, "BAD RECURSION DEPTH\n");
return 0;
}
p = *pp; p = *pp;
tot = p + length; tot = p + length;
op = p - 1; op = p - 1;

15
deps/openssl/openssl/crypto/asn1/d2i_pr.c

@ -72,6 +72,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
long length) long length)
{ {
EVP_PKEY *ret; EVP_PKEY *ret;
const unsigned char *p = *pp;
if ((a == NULL) || (*a == NULL)) { if ((a == NULL) || (*a == NULL)) {
if ((ret = EVP_PKEY_new()) == NULL) { if ((ret = EVP_PKEY_new()) == NULL) {
@ -94,21 +95,23 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
} }
if (!ret->ameth->old_priv_decode || if (!ret->ameth->old_priv_decode ||
!ret->ameth->old_priv_decode(ret, pp, length)) { !ret->ameth->old_priv_decode(ret, &p, length)) {
if (ret->ameth->priv_decode) { if (ret->ameth->priv_decode) {
PKCS8_PRIV_KEY_INFO *p8 = NULL; PKCS8_PRIV_KEY_INFO *p8 = NULL;
p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length); p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
if (!p8) if (!p8)
goto err; goto err;
EVP_PKEY_free(ret); EVP_PKEY_free(ret);
ret = EVP_PKCS82PKEY(p8); ret = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8); PKCS8_PRIV_KEY_INFO_free(p8);
if (ret == NULL)
goto err;
} else { } else {
ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB); ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB);
goto err; goto err;
} }
} }
*pp = p;
if (a != NULL) if (a != NULL)
(*a) = ret; (*a) = ret;
return (ret); return (ret);
@ -136,6 +139,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
* input is surrounded by an ASN1 SEQUENCE. * input is surrounded by an ASN1 SEQUENCE.
*/ */
inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length); inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length);
p = *pp;
/* /*
* Since we only need to discern "traditional format" RSA and DSA keys we * Since we only need to discern "traditional format" RSA and DSA keys we
* can just count the elements. * can just count the elements.
@ -146,7 +150,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
keytype = EVP_PKEY_EC; keytype = EVP_PKEY_EC;
else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not
* traditional format */ * traditional format */
PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length); PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length);
EVP_PKEY *ret; EVP_PKEY *ret;
sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
@ -157,6 +161,9 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
} }
ret = EVP_PKCS82PKEY(p8); ret = EVP_PKCS82PKEY(p8);
PKCS8_PRIV_KEY_INFO_free(p8); PKCS8_PRIV_KEY_INFO_free(p8);
if (ret == NULL)
return NULL;
*pp = p;
if (a) { if (a) {
*a = ret; *a = ret;
} }

11
deps/openssl/openssl/crypto/asn1/tasn_dec.c

@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
int otag; int otag;
int ret = 0; int ret = 0;
ASN1_VALUE **pchptr, *ptmpval; ASN1_VALUE **pchptr, *ptmpval;
int combine = aclass & ASN1_TFLG_COMBINE;
aclass &= ~ASN1_TFLG_COMBINE;
if (!pval) if (!pval)
return 0; return 0;
if (aux && aux->asn1_cb) if (aux && aux->asn1_cb)
@ -350,9 +352,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
} }
asn1_set_choice_selector(pval, i, it); asn1_set_choice_selector(pval, i, it);
*in = p;
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
goto auxerr; goto auxerr;
*in = p;
return 1; return 1;
case ASN1_ITYPE_NDEF_SEQUENCE: case ASN1_ITYPE_NDEF_SEQUENCE:
@ -489,9 +491,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
/* Save encoding */ /* Save encoding */
if (!asn1_enc_save(pval, *in, p - *in, it)) if (!asn1_enc_save(pval, *in, p - *in, it))
goto auxerr; goto auxerr;
*in = p;
if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL))
goto auxerr; goto auxerr;
*in = p;
return 1; return 1;
default: default:
@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
auxerr: auxerr:
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR); ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
err: err:
ASN1_item_ex_free(pval, it); if (combine == 0)
ASN1_item_ex_free(pval, it);
if (errtt) if (errtt)
ERR_add_error_data(4, "Field=", errtt->field_name, ERR_add_error_data(4, "Field=", errtt->field_name,
", Type=", it->sname); ", Type=", it->sname);
@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
} else { } else {
/* Nothing special */ /* Nothing special */
ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
-1, 0, opt, ctx); -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
if (!ret) { if (!ret) {
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR); ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
goto err; goto err;

5
deps/openssl/openssl/crypto/asn1/x_bignum.c

@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int utype, char *free_cont, const ASN1_ITEM *it) int utype, char *free_cont, const ASN1_ITEM *it)
{ {
BIGNUM *bn; BIGNUM *bn;
if (!*pval)
bn_new(pval, it); if (*pval == NULL && !bn_new(pval, it))
return 0;
bn = (BIGNUM *)*pval; bn = (BIGNUM *)*pval;
if (!BN_bin2bn(cont, len, bn)) { if (!BN_bin2bn(cont, len, bn)) {
bn_free(pval, it); bn_free(pval, it);

5
deps/openssl/openssl/crypto/asn1/x_pubkey.c

@ -188,13 +188,16 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length)
{ {
X509_PUBKEY *xpk; X509_PUBKEY *xpk;
EVP_PKEY *pktmp; EVP_PKEY *pktmp;
xpk = d2i_X509_PUBKEY(NULL, pp, length); const unsigned char *q;
q = *pp;
xpk = d2i_X509_PUBKEY(NULL, &q, length);
if (!xpk) if (!xpk)
return NULL; return NULL;
pktmp = X509_PUBKEY_get(xpk); pktmp = X509_PUBKEY_get(xpk);
X509_PUBKEY_free(xpk); X509_PUBKEY_free(xpk);
if (!pktmp) if (!pktmp)
return NULL; return NULL;
*pp = q;
if (a) { if (a) {
EVP_PKEY_free(*a); EVP_PKEY_free(*a);
*a = pktmp; *a = pktmp;

9
deps/openssl/openssl/crypto/asn1/x_x509.c

@ -180,16 +180,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
if (!a || *a == NULL) { if (!a || *a == NULL) {
freeret = 1; freeret = 1;
} }
ret = d2i_X509(a, pp, length); ret = d2i_X509(a, &q, length);
/* If certificate unreadable then forget it */ /* If certificate unreadable then forget it */
if (!ret) if (!ret)
return NULL; return NULL;
/* update length */ /* update length */
length -= *pp - q; length -= q - *pp;
if (!length) if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length))
return ret;
if (!d2i_X509_CERT_AUX(&ret->aux, pp, length))
goto err; goto err;
*pp = q;
return ret; return ret;
err: err:
if (freeret) { if (freeret) {

7
deps/openssl/openssl/crypto/asn1/x_x509a.c

@ -163,10 +163,13 @@ int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj)
if (!(objtmp = OBJ_dup(obj))) if (!(objtmp = OBJ_dup(obj)))
return 0; return 0;
if (!(aux = aux_get(x))) if (!(aux = aux_get(x)))
return 0; goto err;
if (!aux->reject && !(aux->reject = sk_ASN1_OBJECT_new_null())) if (!aux->reject && !(aux->reject = sk_ASN1_OBJECT_new_null()))
return 0; goto err;
return sk_ASN1_OBJECT_push(aux->reject, objtmp); return sk_ASN1_OBJECT_push(aux->reject, objtmp);
err:
ASN1_OBJECT_free(objtmp);
return 0;
} }
void X509_trust_clear(X509 *x) void X509_trust_clear(X509 *x)

1
deps/openssl/openssl/crypto/bio/b_dump.c

@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
if ((rows * dump_width) < len) if ((rows * dump_width) < len)
rows++; rows++;
for (i = 0; i < rows; i++) { for (i = 0; i < rows; i++) {
buf[0] = '\0'; /* start with empty string */
BUF_strlcpy(buf, str, sizeof buf); BUF_strlcpy(buf, str, sizeof buf);
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width); BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
BUF_strlcat(buf, tmp, sizeof buf); BUF_strlcat(buf, tmp, sizeof buf);

13
deps/openssl/openssl/crypto/bio/bss_file.c

@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
NULL, NULL,
}; };
BIO *BIO_new_file(const char *filename, const char *mode) static FILE *file_fopen(const char *filename, const char *mode)
{ {
BIO *ret;
FILE *file = NULL; FILE *file = NULL;
# if defined(_WIN32) && defined(CP_UTF8) # if defined(_WIN32) && defined(CP_UTF8)
@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
# else # else
file = fopen(filename, mode); file = fopen(filename, mode);
# endif # endif
return (file);
}
BIO *BIO_new_file(const char *filename, const char *mode)
{
BIO *ret;
FILE *file = file_fopen(filename, mode);
if (file == NULL) { if (file == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error()); SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
else else
strcat(p, "t"); strcat(p, "t");
# endif # endif
fp = fopen(ptr, p); fp = file_fopen(ptr, p);
if (fp == NULL) { if (fp == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error()); SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");

10
deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl

@ -27,7 +27,7 @@
# referred below, which improves ECDH and ECDSA verify benchmarks # referred below, which improves ECDH and ECDSA verify benchmarks
# by 18-40%. # by 18-40%.
# #
# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software # Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software
# Polynomial Multiplication on ARM Processors using the NEON Engine. # Polynomial Multiplication on ARM Processors using the NEON Engine.
# #
# http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf # http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf
@ -136,7 +136,7 @@ ___
################ ################
# void bn_GF2m_mul_2x2(BN_ULONG *r, # void bn_GF2m_mul_2x2(BN_ULONG *r,
# BN_ULONG a1,BN_ULONG a0, # BN_ULONG a1,BN_ULONG a0,
# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0 # BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0
{ {
$code.=<<___; $code.=<<___;
.global bn_GF2m_mul_2x2 .global bn_GF2m_mul_2x2
@ -159,7 +159,7 @@ $code.=<<___;
mov $mask,#7<<2 mov $mask,#7<<2
sub sp,sp,#32 @ allocate tab[8] sub sp,sp,#32 @ allocate tab[8]
bl mul_1x1_ialu @ a1·b1 bl mul_1x1_ialu @ a1·b1
str $lo,[$ret,#8] str $lo,[$ret,#8]
str $hi,[$ret,#12] str $hi,[$ret,#12]
@ -169,13 +169,13 @@ $code.=<<___;
eor r2,r2,$a eor r2,r2,$a
eor $b,$b,r3 eor $b,$b,r3
eor $a,$a,r2 eor $a,$a,r2
bl mul_1x1_ialu @ a0·b0 bl mul_1x1_ialu @ a0·b0
str $lo,[$ret] str $lo,[$ret]
str $hi,[$ret,#4] str $hi,[$ret,#4]
eor $a,$a,r2 eor $a,$a,r2
eor $b,$b,r3 eor $b,$b,r3
bl mul_1x1_ialu @ (a1+a0)·(b1+b0) bl mul_1x1_ialu @ (a1+a0)·(b1+b0)
___ ___
@r=map("r$_",(6..9)); @r=map("r$_",(6..9));
$code.=<<___; $code.=<<___;

4
deps/openssl/openssl/crypto/bn/asm/ia64.S

@ -422,7 +422,7 @@ bn_mul_add_words:
// This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on // This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on
// Itanium 2. Yes, unlike previous versions it scales:-) Previous // Itanium 2. Yes, unlike previous versions it scales:-) Previous
// version was peforming *all* additions in IALU and was starving // version was performing *all* additions in IALU and was starving
// for those even on Itanium 2. In this version one addition is // for those even on Itanium 2. In this version one addition is
// moved to FPU and is folded with multiplication. This is at cost // moved to FPU and is folded with multiplication. This is at cost
// of propogating the result from previous call to this subroutine // of propogating the result from previous call to this subroutine
@ -568,7 +568,7 @@ bn_sqr_comba8:
// I've estimated this routine to run in ~120 ticks, but in reality // I've estimated this routine to run in ~120 ticks, but in reality
// (i.e. according to ar.itc) it takes ~160 ticks. Are those extra // (i.e. according to ar.itc) it takes ~160 ticks. Are those extra
// cycles consumed for instructions fetch? Or did I misinterpret some // cycles consumed for instructions fetch? Or did I misinterpret some
// clause in Itanium µ-architecture manual? Comments are welcomed and // clause in Itanium µ-architecture manual? Comments are welcomed and
// highly appreciated. // highly appreciated.
// //
// On Itanium 2 it takes ~190 ticks. This is because of stalls on // On Itanium 2 it takes ~190 ticks. This is because of stalls on

174
deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl

@ -94,6 +94,8 @@ if ($flavour =~ /32/) {
$POP= "ld"; $POP= "ld";
} else { die "nonsense $flavour"; } } else { die "nonsense $flavour"; }
$LITTLE_ENDIAN = ($flavour=~/le$/) ? 4 : 0;
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or
( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or
@ -294,12 +296,12 @@ $code.=<<___ if ($SIZE_T==8);
extrdi $t0,$a0,32,32 ; lwz $t0,4($ap) extrdi $t0,$a0,32,32 ; lwz $t0,4($ap)
extrdi $t1,$a0,32,0 ; lwz $t1,0($ap) extrdi $t1,$a0,32,0 ; lwz $t1,0($ap)
lwz $t2,12($ap) ; load a[1] as 32-bit word pair lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[1] as 32-bit word pair
lwz $t3,8($ap) lwz $t3,`8^$LITTLE_ENDIAN`($ap)
lwz $t4,4($np) ; load n[0] as 32-bit word pair lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[0] as 32-bit word pair
lwz $t5,0($np) lwz $t5,`0^$LITTLE_ENDIAN`($np)
lwz $t6,12($np) ; load n[1] as 32-bit word pair lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[1] as 32-bit word pair
lwz $t7,8($np) lwz $t7,`8^$LITTLE_ENDIAN`($np)
___ ___
$code.=<<___ if ($SIZE_T==4); $code.=<<___ if ($SIZE_T==4);
lwz $a0,0($ap) ; pull ap[0,1] value lwz $a0,0($ap) ; pull ap[0,1] value
@ -463,14 +465,14 @@ $code.=<<___;
L1st: L1st:
___ ___
$code.=<<___ if ($SIZE_T==8); $code.=<<___ if ($SIZE_T==8);
lwz $t0,4($ap) ; load a[j] as 32-bit word pair lwz $t0,`4^$LITTLE_ENDIAN`($ap) ; load a[j] as 32-bit word pair
lwz $t1,0($ap) lwz $t1,`0^$LITTLE_ENDIAN`($ap)
lwz $t2,12($ap) ; load a[j+1] as 32-bit word pair lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[j+1] as 32-bit word pair
lwz $t3,8($ap) lwz $t3,`8^$LITTLE_ENDIAN`($ap)
lwz $t4,4($np) ; load n[j] as 32-bit word pair lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[j] as 32-bit word pair
lwz $t5,0($np) lwz $t5,`0^$LITTLE_ENDIAN`($np)
lwz $t6,12($np) ; load n[j+1] as 32-bit word pair lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[j+1] as 32-bit word pair
lwz $t7,8($np) lwz $t7,`8^$LITTLE_ENDIAN`($np)
___ ___
$code.=<<___ if ($SIZE_T==4); $code.=<<___ if ($SIZE_T==4);
lwz $t0,0($ap) ; load a[j..j+3] as 32-bit word pairs lwz $t0,0($ap) ; load a[j..j+3] as 32-bit word pairs
@ -505,14 +507,14 @@ $code.=<<___;
___ ___
} else { } else {
$code.=<<___; $code.=<<___;
lwz $t1,`$FRAME+0`($sp) lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
lwz $t0,`$FRAME+4`($sp) lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
lwz $t3,`$FRAME+8`($sp) lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
lwz $t2,`$FRAME+12`($sp) lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
lwz $t5,`$FRAME+16`($sp) lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+20`($sp) lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
lwz $t7,`$FRAME+24`($sp) lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+28`($sp) lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
___ ___
} }
$code.=<<___; $code.=<<___;
@ -651,8 +653,8 @@ $code.=<<___;
fmadd $T1a,$N1,$na,$T1a fmadd $T1a,$N1,$na,$T1a
fmadd $T1b,$N1,$nb,$T1b fmadd $T1b,$N1,$nb,$T1b
lwz $t3,`$FRAME+32`($sp) ; permuted $t1 lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
lwz $t2,`$FRAME+36`($sp) ; permuted $t0 lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
addc $t4,$t4,$carry addc $t4,$t4,$carry
adde $t5,$t5,$c1 adde $t5,$t5,$c1
srwi $carry,$t4,16 srwi $carry,$t4,16
@ -673,8 +675,8 @@ $code.=<<___;
fmadd $T1a,$N0,$nc,$T1a fmadd $T1a,$N0,$nc,$T1a
fmadd $T1b,$N0,$nd,$T1b fmadd $T1b,$N0,$nd,$T1b
lwz $t7,`$FRAME+40`($sp) ; permuted $t3 lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
lwz $t6,`$FRAME+44`($sp) ; permuted $t2 lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
addc $t2,$t2,$carry addc $t2,$t2,$carry
adde $t3,$t3,$c1 adde $t3,$t3,$c1
srwi $carry,$t2,16 srwi $carry,$t2,16
@ -686,8 +688,8 @@ $code.=<<___;
insrwi $carry,$t3,16,0 insrwi $carry,$t3,16,0
fmadd $T3a,$N2,$nc,$T3a fmadd $T3a,$N2,$nc,$T3a
fmadd $T3b,$N2,$nd,$T3b fmadd $T3b,$N2,$nd,$T3b
lwz $t1,`$FRAME+48`($sp) ; permuted $t5 lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
lwz $t0,`$FRAME+52`($sp) ; permuted $t4 lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
addc $t6,$t6,$carry addc $t6,$t6,$carry
adde $t7,$t7,$c1 adde $t7,$t7,$c1
srwi $carry,$t6,16 srwi $carry,$t6,16
@ -699,8 +701,8 @@ $code.=<<___;
fctid $T0a,$T0a fctid $T0a,$T0a
fctid $T0b,$T0b fctid $T0b,$T0b
lwz $t5,`$FRAME+56`($sp) ; permuted $t7 lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
lwz $t4,`$FRAME+60`($sp) ; permuted $t6 lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t0,$t0,$carry addc $t0,$t0,$carry
adde $t1,$t1,$c1 adde $t1,$t1,$c1
srwi $carry,$t0,16 srwi $carry,$t0,16
@ -787,14 +789,14 @@ $code.=<<___;
___ ___
} else { } else {
$code.=<<___; $code.=<<___;
lwz $t1,`$FRAME+0`($sp) lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
lwz $t0,`$FRAME+4`($sp) lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
lwz $t3,`$FRAME+8`($sp) lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
lwz $t2,`$FRAME+12`($sp) lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
lwz $t5,`$FRAME+16`($sp) lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+20`($sp) lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
lwz $t7,`$FRAME+24`($sp) lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+28`($sp) lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
stfd $dota,`$FRAME+64`($sp) stfd $dota,`$FRAME+64`($sp)
stfd $dotb,`$FRAME+72`($sp) stfd $dotb,`$FRAME+72`($sp)
@ -823,14 +825,14 @@ $code.=<<___;
stw $t0,12($tp) ; tp[j-1] stw $t0,12($tp) ; tp[j-1]
stw $t4,8($tp) stw $t4,8($tp)
lwz $t3,`$FRAME+32`($sp) ; permuted $t1 lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
lwz $t2,`$FRAME+36`($sp) ; permuted $t0 lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
lwz $t7,`$FRAME+40`($sp) ; permuted $t3 lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
lwz $t6,`$FRAME+44`($sp) ; permuted $t2 lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
lwz $t1,`$FRAME+48`($sp) ; permuted $t5 lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
lwz $t0,`$FRAME+52`($sp) ; permuted $t4 lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
lwz $t5,`$FRAME+56`($sp) ; permuted $t7 lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
lwz $t4,`$FRAME+60`($sp) ; permuted $t6 lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t2,$t2,$carry addc $t2,$t2,$carry
adde $t3,$t3,$c1 adde $t3,$t3,$c1
@ -857,10 +859,10 @@ $code.=<<___;
stw $t2,20($tp) ; tp[j] stw $t2,20($tp) ; tp[j]
stwu $t0,16($tp) stwu $t0,16($tp)
lwz $t7,`$FRAME+64`($sp) lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+68`($sp) lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
lwz $t5,`$FRAME+72`($sp) lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+76`($sp) lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
addc $t6,$t6,$carry addc $t6,$t6,$carry
adde $t7,$t7,$c1 adde $t7,$t7,$c1
@ -1165,23 +1167,23 @@ ___
$code.=<<___; $code.=<<___;
fmadd $T1a,$N1,$na,$T1a fmadd $T1a,$N1,$na,$T1a
fmadd $T1b,$N1,$nb,$T1b fmadd $T1b,$N1,$nb,$T1b
lwz $t1,`$FRAME+0`($sp) lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
lwz $t0,`$FRAME+4`($sp) lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
fmadd $T2a,$N2,$na,$T2a fmadd $T2a,$N2,$na,$T2a
fmadd $T2b,$N2,$nb,$T2b fmadd $T2b,$N2,$nb,$T2b
lwz $t3,`$FRAME+8`($sp) lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
lwz $t2,`$FRAME+12`($sp) lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
fmadd $T3a,$N3,$na,$T3a fmadd $T3a,$N3,$na,$T3a
fmadd $T3b,$N3,$nb,$T3b fmadd $T3b,$N3,$nb,$T3b
lwz $t5,`$FRAME+16`($sp) lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+20`($sp) lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
addc $t0,$t0,$carry addc $t0,$t0,$carry
adde $t1,$t1,$c1 adde $t1,$t1,$c1
srwi $carry,$t0,16 srwi $carry,$t0,16
fmadd $T0a,$N0,$na,$T0a fmadd $T0a,$N0,$na,$T0a
fmadd $T0b,$N0,$nb,$T0b fmadd $T0b,$N0,$nb,$T0b
lwz $t7,`$FRAME+24`($sp) lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+28`($sp) lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
srwi $c1,$t1,16 srwi $c1,$t1,16
insrwi $carry,$t1,16,0 insrwi $carry,$t1,16,0
@ -1218,8 +1220,8 @@ $code.=<<___;
fctid $T1a,$T1a fctid $T1a,$T1a
addc $t0,$t0,$t2 addc $t0,$t0,$t2
adde $t4,$t4,$t3 adde $t4,$t4,$t3
lwz $t3,`$FRAME+32`($sp) ; permuted $t1 lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
lwz $t2,`$FRAME+36`($sp) ; permuted $t0 lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
fctid $T1b,$T1b fctid $T1b,$T1b
addze $carry,$carry addze $carry,$carry
addze $c1,$c1 addze $c1,$c1
@ -1229,19 +1231,19 @@ $code.=<<___;
addc $t2,$t2,$carry addc $t2,$t2,$carry
adde $t3,$t3,$c1 adde $t3,$t3,$c1
srwi $carry,$t2,16 srwi $carry,$t2,16
lwz $t7,`$FRAME+40`($sp) ; permuted $t3 lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
lwz $t6,`$FRAME+44`($sp) ; permuted $t2 lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
fctid $T2b,$T2b fctid $T2b,$T2b
srwi $c1,$t3,16 srwi $c1,$t3,16
insrwi $carry,$t3,16,0 insrwi $carry,$t3,16,0
lwz $t1,`$FRAME+48`($sp) ; permuted $t5 lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
lwz $t0,`$FRAME+52`($sp) ; permuted $t4 lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
fctid $T3a,$T3a fctid $T3a,$T3a
addc $t6,$t6,$carry addc $t6,$t6,$carry
adde $t7,$t7,$c1 adde $t7,$t7,$c1
srwi $carry,$t6,16 srwi $carry,$t6,16
lwz $t5,`$FRAME+56`($sp) ; permuted $t7 lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
lwz $t4,`$FRAME+60`($sp) ; permuted $t6 lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
fctid $T3b,$T3b fctid $T3b,$T3b
insrwi $t2,$t6,16,0 ; 64..95 bits insrwi $t2,$t6,16,0 ; 64..95 bits
@ -1354,14 +1356,14 @@ $code.=<<___;
___ ___
} else { } else {
$code.=<<___; $code.=<<___;
lwz $t1,`$FRAME+0`($sp) lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp)
lwz $t0,`$FRAME+4`($sp) lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp)
lwz $t3,`$FRAME+8`($sp) lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp)
lwz $t2,`$FRAME+12`($sp) lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp)
lwz $t5,`$FRAME+16`($sp) lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+20`($sp) lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp)
lwz $t7,`$FRAME+24`($sp) lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+28`($sp) lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp)
stfd $dota,`$FRAME+64`($sp) stfd $dota,`$FRAME+64`($sp)
stfd $dotb,`$FRAME+72`($sp) stfd $dotb,`$FRAME+72`($sp)
@ -1397,14 +1399,14 @@ $code.=<<___;
stw $t0,4($tp) ; tp[j-1] stw $t0,4($tp) ; tp[j-1]
stw $t4,0($tp) stw $t4,0($tp)
lwz $t3,`$FRAME+32`($sp) ; permuted $t1 lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1
lwz $t2,`$FRAME+36`($sp) ; permuted $t0 lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0
lwz $t7,`$FRAME+40`($sp) ; permuted $t3 lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3
lwz $t6,`$FRAME+44`($sp) ; permuted $t2 lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2
lwz $t1,`$FRAME+48`($sp) ; permuted $t5 lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5
lwz $t0,`$FRAME+52`($sp) ; permuted $t4 lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4
lwz $t5,`$FRAME+56`($sp) ; permuted $t7 lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7
lwz $t4,`$FRAME+60`($sp) ; permuted $t6 lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6
addc $t2,$t2,$carry addc $t2,$t2,$carry
adde $t3,$t3,$c1 adde $t3,$t3,$c1
@ -1433,12 +1435,12 @@ $code.=<<___;
addc $t2,$t2,$t6 addc $t2,$t2,$t6
adde $t0,$t0,$t7 adde $t0,$t0,$t7
lwz $t7,`$FRAME+64`($sp) lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp)
lwz $t6,`$FRAME+68`($sp) lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp)
addze $carry,$carry addze $carry,$carry
addze $c1,$c1 addze $c1,$c1
lwz $t5,`$FRAME+72`($sp) lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp)
lwz $t4,`$FRAME+76`($sp) lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp)
addc $t6,$t6,$carry addc $t6,$t6,$carry
adde $t7,$t7,$c1 adde $t7,$t7,$c1

2
deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl

@ -113,7 +113,7 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12); $addx = ($1>=12);
} }
if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) { if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
$addx = ($ver>=3.03); $addx = ($ver>=3.03);
} }

6
deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl

@ -172,19 +172,19 @@ ___
if ($SIZE_T==8) { if ($SIZE_T==8) {
my @r=map("%r$_",(6..9)); my @r=map("%r$_",(6..9));
$code.=<<___; $code.=<<___;
bras $ra,_mul_1x1 # a1·b1 bras $ra,_mul_1x1 # a1·b1
stmg $lo,$hi,16($rp) stmg $lo,$hi,16($rp)
lg $a,`$stdframe+128+4*$SIZE_T`($sp) lg $a,`$stdframe+128+4*$SIZE_T`($sp)
lg $b,`$stdframe+128+6*$SIZE_T`($sp) lg $b,`$stdframe+128+6*$SIZE_T`($sp)
bras $ra,_mul_1x1 # a0·b0 bras $ra,_mul_1x1 # a0·b0
stmg $lo,$hi,0($rp) stmg $lo,$hi,0($rp)
lg $a,`$stdframe+128+3*$SIZE_T`($sp) lg $a,`$stdframe+128+3*$SIZE_T`($sp)
lg $b,`$stdframe+128+5*$SIZE_T`($sp) lg $b,`$stdframe+128+5*$SIZE_T`($sp)
xg $a,`$stdframe+128+4*$SIZE_T`($sp) xg $a,`$stdframe+128+4*$SIZE_T`($sp)
xg $b,`$stdframe+128+6*$SIZE_T`($sp) xg $b,`$stdframe+128+6*$SIZE_T`($sp)
bras $ra,_mul_1x1 # (a0+a1)·(b0+b1) bras $ra,_mul_1x1 # (a0+a1)·(b0+b1)
lmg @r[0],@r[3],0($rp) lmg @r[0],@r[3],0($rp)
xgr $lo,$hi xgr $lo,$hi

109
deps/openssl/openssl/crypto/bn/asm/s390x.S

@ -18,71 +18,106 @@
.align 4 .align 4
bn_mul_add_words: bn_mul_add_words:
lghi zero,0 // zero = 0 lghi zero,0 // zero = 0
la %r1,0(%r2) // put rp aside la %r1,0(%r2) // put rp aside [to give way to]
lghi %r2,0 // i=0; lghi %r2,0 // return value
ltgfr %r4,%r4 ltgfr %r4,%r4
bler %r14 // if (len<=0) return 0; bler %r14 // if (len<=0) return 0;
stmg %r6,%r10,48(%r15) stmg %r6,%r13,48(%r15)
lghi %r10,3 lghi %r2,3
lghi %r8,0 // carry = 0 lghi %r12,0 // carry = 0
nr %r10,%r4 // len%4 slgr %r1,%r3 // rp-=ap
nr %r2,%r4 // len%4
sra %r4,2 // cnt=len/4 sra %r4,2 // cnt=len/4
jz .Loop1_madd // carry is incidentally cleared if branch taken jz .Loop1_madd // carry is incidentally cleared if branch taken
algr zero,zero // clear carry algr zero,zero // clear carry
.Loop4_madd: lg %r7,0(%r3) // ap[0]
lg %r7,0(%r2,%r3) // ap[i] lg %r9,8(%r3) // ap[1]
mlgr %r6,%r5 // *=w mlgr %r6,%r5 // *=w
alcgr %r7,%r8 // +=carry brct %r4,.Loop4_madd
alcgr %r6,zero j .Loop4_madd_tail
alg %r7,0(%r2,%r1) // +=rp[i]
stg %r7,0(%r2,%r1) // rp[i]=
lg %r9,8(%r2,%r3) .Loop4_madd:
mlgr %r8,%r5 mlgr %r8,%r5
lg %r11,16(%r3) // ap[i+2]
alcgr %r7,%r12 // +=carry
alcgr %r6,zero
alg %r7,0(%r3,%r1) // +=rp[i]
stg %r7,0(%r3,%r1) // rp[i]=
mlgr %r10,%r5
lg %r13,24(%r3)
alcgr %r9,%r6 alcgr %r9,%r6
alcgr %r8,zero alcgr %r8,zero
alg %r9,8(%r2,%r1) alg %r9,8(%r3,%r1)
stg %r9,8(%r2,%r1) stg %r9,8(%r3,%r1)
mlgr %r12,%r5
lg %r7,32(%r3)
alcgr %r11,%r8
alcgr %r10,zero
alg %r11,16(%r3,%r1)
stg %r11,16(%r3,%r1)
lg %r7,16(%r2,%r3)
mlgr %r6,%r5 mlgr %r6,%r5
alcgr %r7,%r8 lg %r9,40(%r3)
alcgr %r6,zero alcgr %r13,%r10
alg %r7,16(%r2,%r1) alcgr %r12,zero
stg %r7,16(%r2,%r1) alg %r13,24(%r3,%r1)
stg %r13,24(%r3,%r1)
lg %r9,24(%r2,%r3) la %r3,32(%r3) // i+=4
brct %r4,.Loop4_madd
.Loop4_madd_tail:
mlgr %r8,%r5 mlgr %r8,%r5
lg %r11,16(%r3)
alcgr %r7,%r12 // +=carry
alcgr %r6,zero
alg %r7,0(%r3,%r1) // +=rp[i]
stg %r7,0(%r3,%r1) // rp[i]=
mlgr %r10,%r5
lg %r13,24(%r3)
alcgr %r9,%r6 alcgr %r9,%r6
alcgr %r8,zero alcgr %r8,zero
alg %r9,24(%r2,%r1) alg %r9,8(%r3,%r1)
stg %r9,24(%r2,%r1) stg %r9,8(%r3,%r1)
la %r2,32(%r2) // i+=4 mlgr %r12,%r5
brct %r4,.Loop4_madd alcgr %r11,%r8
alcgr %r10,zero
alg %r11,16(%r3,%r1)
stg %r11,16(%r3,%r1)
la %r10,1(%r10) // see if len%4 is zero ... alcgr %r13,%r10
brct %r10,.Loop1_madd // without touching condition code:-) alcgr %r12,zero
alg %r13,24(%r3,%r1)
stg %r13,24(%r3,%r1)
la %r3,32(%r3) // i+=4
la %r2,1(%r2) // see if len%4 is zero ...
brct %r2,.Loop1_madd // without touching condition code:-)
.Lend_madd: .Lend_madd:
alcgr %r8,zero // collect carry bit lgr %r2,zero // return value
lgr %r2,%r8 alcgr %r2,%r12 // collect even carry bit
lmg %r6,%r10,48(%r15) lmg %r6,%r13,48(%r15)
br %r14 br %r14
.Loop1_madd: .Loop1_madd:
lg %r7,0(%r2,%r3) // ap[i] lg %r7,0(%r3) // ap[i]
mlgr %r6,%r5 // *=w mlgr %r6,%r5 // *=w
alcgr %r7,%r8 // +=carry alcgr %r7,%r12 // +=carry
alcgr %r6,zero alcgr %r6,zero
alg %r7,0(%r2,%r1) // +=rp[i] alg %r7,0(%r3,%r1) // +=rp[i]
stg %r7,0(%r2,%r1) // rp[i]= stg %r7,0(%r3,%r1) // rp[i]=
lgr %r8,%r6 lgr %r12,%r6
la %r2,8(%r2) // i++ la %r3,8(%r3) // i++
brct %r10,.Loop1_madd brct %r2,.Loop1_madd
j .Lend_madd j .Lend_madd
.size bn_mul_add_words,.-bn_mul_add_words .size bn_mul_add_words,.-bn_mul_add_words

16
deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl

@ -14,7 +14,7 @@
# the time being... Except that it has three code paths: pure integer # the time being... Except that it has three code paths: pure integer
# code suitable for any x86 CPU, MMX code suitable for PIII and later # code suitable for any x86 CPU, MMX code suitable for PIII and later
# and PCLMULQDQ suitable for Westmere and later. Improvement varies # and PCLMULQDQ suitable for Westmere and later. Improvement varies
# from one benchmark and µ-arch to another. Below are interval values # from one benchmark and µ-arch to another. Below are interval values
# for 163- and 571-bit ECDH benchmarks relative to compiler-generated # for 163- and 571-bit ECDH benchmarks relative to compiler-generated
# code: # code:
# #
@ -226,22 +226,22 @@ if ($sse2) {
&push ("edi"); &push ("edi");
&mov ($a,&wparam(1)); &mov ($a,&wparam(1));
&mov ($b,&wparam(3)); &mov ($b,&wparam(3));
&call ("_mul_1x1_mmx"); # a1·b1 &call ("_mul_1x1_mmx"); # a1·b1
&movq ("mm7",$R); &movq ("mm7",$R);
&mov ($a,&wparam(2)); &mov ($a,&wparam(2));
&mov ($b,&wparam(4)); &mov ($b,&wparam(4));
&call ("_mul_1x1_mmx"); # a0·b0 &call ("_mul_1x1_mmx"); # a0·b0
&movq ("mm6",$R); &movq ("mm6",$R);
&mov ($a,&wparam(1)); &mov ($a,&wparam(1));
&mov ($b,&wparam(3)); &mov ($b,&wparam(3));
&xor ($a,&wparam(2)); &xor ($a,&wparam(2));
&xor ($b,&wparam(4)); &xor ($b,&wparam(4));
&call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1) &call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1)
&pxor ($R,"mm7"); &pxor ($R,"mm7");
&mov ($a,&wparam(0)); &mov ($a,&wparam(0));
&pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0 &pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0
&movq ($A,$R); &movq ($A,$R);
&psllq ($R,32); &psllq ($R,32);
@ -266,13 +266,13 @@ if ($sse2) {
&mov ($a,&wparam(1)); &mov ($a,&wparam(1));
&mov ($b,&wparam(3)); &mov ($b,&wparam(3));
&call ("_mul_1x1_ialu"); # a1·b1 &call ("_mul_1x1_ialu"); # a1·b1
&mov (&DWP(8,"esp"),$lo); &mov (&DWP(8,"esp"),$lo);
&mov (&DWP(12,"esp"),$hi); &mov (&DWP(12,"esp"),$hi);
&mov ($a,&wparam(2)); &mov ($a,&wparam(2));
&mov ($b,&wparam(4)); &mov ($b,&wparam(4));
&call ("_mul_1x1_ialu"); # a0·b0 &call ("_mul_1x1_ialu"); # a0·b0
&mov (&DWP(0,"esp"),$lo); &mov (&DWP(0,"esp"),$lo);
&mov (&DWP(4,"esp"),$hi); &mov (&DWP(4,"esp"),$hi);
@ -280,7 +280,7 @@ if ($sse2) {
&mov ($b,&wparam(3)); &mov ($b,&wparam(3));
&xor ($a,&wparam(2)); &xor ($a,&wparam(2));
&xor ($b,&wparam(4)); &xor ($b,&wparam(4));
&call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1) &call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1)
&mov ("ebp",&wparam(0)); &mov ("ebp",&wparam(0));
@r=("ebx","ecx","edi","esi"); @r=("ebx","ecx","edi","esi");

2
deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c

@ -65,7 +65,7 @@
# undef mul_add # undef mul_add
/*- /*-
* "m"(a), "+m"(r) is the way to favor DirectPath µ-code; * "m"(a), "+m"(r) is the way to favor DirectPath µ-code;
* "g"(0) let the compiler to decide where does it * "g"(0) let the compiler to decide where does it
* want to keep the value of zero; * want to keep the value of zero;
*/ */

16
deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl

@ -13,7 +13,7 @@
# in bn_gf2m.c. It's kind of low-hanging mechanical port from C for # in bn_gf2m.c. It's kind of low-hanging mechanical port from C for
# the time being... Except that it has two code paths: code suitable # the time being... Except that it has two code paths: code suitable
# for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and # for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and
# later. Improvement varies from one benchmark and µ-arch to another. # later. Improvement varies from one benchmark and µ-arch to another.
# Vanilla code path is at most 20% faster than compiler-generated code # Vanilla code path is at most 20% faster than compiler-generated code
# [not very impressive], while PCLMULQDQ - whole 85%-160% better on # [not very impressive], while PCLMULQDQ - whole 85%-160% better on
# 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that # 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that
@ -184,13 +184,13 @@ ___
$code.=<<___; $code.=<<___;
movdqa %xmm0,%xmm4 movdqa %xmm0,%xmm4
movdqa %xmm1,%xmm5 movdqa %xmm1,%xmm5
pclmulqdq \$0,%xmm1,%xmm0 # a1·b1 pclmulqdq \$0,%xmm1,%xmm0 # a1·b1
pxor %xmm2,%xmm4 pxor %xmm2,%xmm4
pxor %xmm3,%xmm5 pxor %xmm3,%xmm5
pclmulqdq \$0,%xmm3,%xmm2 # a0·b0 pclmulqdq \$0,%xmm3,%xmm2 # a0·b0
pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1) pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1)
xorps %xmm0,%xmm4 xorps %xmm0,%xmm4
xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1 xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1
movdqa %xmm4,%xmm5 movdqa %xmm4,%xmm5
pslldq \$8,%xmm4 pslldq \$8,%xmm4
psrldq \$8,%xmm5 psrldq \$8,%xmm5
@ -225,13 +225,13 @@ $code.=<<___;
mov \$0xf,$mask mov \$0xf,$mask
mov $a1,$a mov $a1,$a
mov $b1,$b mov $b1,$b
call _mul_1x1 # a1·b1 call _mul_1x1 # a1·b1
mov $lo,16(%rsp) mov $lo,16(%rsp)
mov $hi,24(%rsp) mov $hi,24(%rsp)
mov 48(%rsp),$a mov 48(%rsp),$a
mov 64(%rsp),$b mov 64(%rsp),$b
call _mul_1x1 # a0·b0 call _mul_1x1 # a0·b0
mov $lo,0(%rsp) mov $lo,0(%rsp)
mov $hi,8(%rsp) mov $hi,8(%rsp)
@ -239,7 +239,7 @@ $code.=<<___;
mov 56(%rsp),$b mov 56(%rsp),$b
xor 48(%rsp),$a xor 48(%rsp),$a
xor 64(%rsp),$b xor 64(%rsp),$b
call _mul_1x1 # (a0+a1)·(b0+b1) call _mul_1x1 # (a0+a1)·(b0+b1)
___ ___
@r=("%rbx","%rcx","%rdi","%rsi"); @r=("%rbx","%rcx","%rdi","%rsi");
$code.=<<___; $code.=<<___;

5
deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl

@ -68,6 +68,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12); $addx = ($1>=12);
} }
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
$addx = ($ver>=3.03);
}
# int bn_mul_mont( # int bn_mul_mont(
$rp="%rdi"; # BN_ULONG *rp, $rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap, $ap="%rsi"; # const BN_ULONG *ap,

27
deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl

@ -53,6 +53,11 @@ if (!$addx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
$addx = ($1>=12); $addx = ($1>=12);
} }
if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9])\.([0-9]+)/) {
my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10
$addx = ($ver>=3.03);
}
# int bn_mul_mont_gather5( # int bn_mul_mont_gather5(
$rp="%rdi"; # BN_ULONG *rp, $rp="%rdi"; # BN_ULONG *rp,
$ap="%rsi"; # const BN_ULONG *ap, $ap="%rsi"; # const BN_ULONG *ap,
@ -1779,6 +1784,15 @@ sqr8x_reduction:
.align 32 .align 32
.L8x_tail_done: .L8x_tail_done:
add (%rdx),%r8 # can this overflow? add (%rdx),%r8 # can this overflow?
adc \$0,%r9
adc \$0,%r10
adc \$0,%r11
adc \$0,%r12
adc \$0,%r13
adc \$0,%r14
adc \$0,%r15 # can't overflow, because we
# started with "overhung" part
# of multiplication
xor %rax,%rax xor %rax,%rax
neg $carry neg $carry
@ -3125,6 +3139,15 @@ sqrx8x_reduction:
.align 32 .align 32
.Lsqrx8x_tail_done: .Lsqrx8x_tail_done:
add 24+8(%rsp),%r8 # can this overflow? add 24+8(%rsp),%r8 # can this overflow?
adc \$0,%r9
adc \$0,%r10
adc \$0,%r11
adc \$0,%r12
adc \$0,%r13
adc \$0,%r14
adc \$0,%r15 # can't overflow, because we
# started with "overhung" part
# of multiplication
mov $carry,%rax # xor %rax,%rax mov $carry,%rax # xor %rax,%rax
sub 16+8(%rsp),$carry # mov 16(%rsp),%cf sub 16+8(%rsp),$carry # mov 16(%rsp),%cf
@ -3168,13 +3191,11 @@ my ($rptr,$nptr)=("%rdx","%rbp");
my @ri=map("%r$_",(10..13)); my @ri=map("%r$_",(10..13));
my @ni=map("%r$_",(14..15)); my @ni=map("%r$_",(14..15));
$code.=<<___; $code.=<<___;
xor %rbx,%rbx xor %ebx,%ebx
sub %r15,%rsi # compare top-most words sub %r15,%rsi # compare top-most words
adc %rbx,%rbx adc %rbx,%rbx
mov %rcx,%r10 # -$num mov %rcx,%r10 # -$num
.byte 0x67
or %rbx,%rax or %rbx,%rax
.byte 0x67
mov %rcx,%r9 # -$num mov %rcx,%r9 # -$num
xor \$1,%rax xor \$1,%rax
sar \$3+2,%rcx # cf=0 sar \$3+2,%rcx # cf=0

7
deps/openssl/openssl/crypto/bn/bn_exp.c

@ -662,12 +662,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
bn_check_top(p); bn_check_top(p);
bn_check_top(m); bn_check_top(m);
top = m->top; if (!BN_is_odd(m)) {
if (!(m->d[0] & 1)) {
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS); BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
return (0); return (0);
} }
top = m->top;
bits = BN_num_bits(p); bits = BN_num_bits(p);
if (bits == 0) { if (bits == 0) {
ret = BN_one(rr); ret = BN_one(rr);

2
deps/openssl/openssl/crypto/bn/bn_gcd.c

@ -583,6 +583,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
* BN_div_no_branch will be called eventually. * BN_div_no_branch will be called eventually.
*/ */
pB = &local_B; pB = &local_B;
local_B.flags = 0;
BN_with_flags(pB, B, BN_FLG_CONSTTIME); BN_with_flags(pB, B, BN_FLG_CONSTTIME);
if (!BN_nnmod(B, pB, A, ctx)) if (!BN_nnmod(B, pB, A, ctx))
goto err; goto err;
@ -610,6 +611,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
* BN_div_no_branch will be called eventually. * BN_div_no_branch will be called eventually.
*/ */
pA = &local_A; pA = &local_A;
local_A.flags = 0;
BN_with_flags(pA, A, BN_FLG_CONSTTIME); BN_with_flags(pA, A, BN_FLG_CONSTTIME);
/* (D, M) := (A/B, A%B) ... */ /* (D, M) := (A/B, A%B) ... */

11
deps/openssl/openssl/crypto/bn/bn_gf2m.c

@ -575,7 +575,7 @@ int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
bn_check_top(a); bn_check_top(a);
BN_CTX_start(ctx); BN_CTX_start(ctx);
if ((s = BN_CTX_get(ctx)) == NULL) if ((s = BN_CTX_get(ctx)) == NULL)
return 0; goto err;
if (!bn_wexpand(s, 2 * a->top)) if (!bn_wexpand(s, 2 * a->top))
goto err; goto err;
@ -699,18 +699,21 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
int top = p->top; int top = p->top;
BN_ULONG *udp, *bdp, *vdp, *cdp; BN_ULONG *udp, *bdp, *vdp, *cdp;
bn_wexpand(u, top); if (!bn_wexpand(u, top))
goto err;
udp = u->d; udp = u->d;
for (i = u->top; i < top; i++) for (i = u->top; i < top; i++)
udp[i] = 0; udp[i] = 0;
u->top = top; u->top = top;
bn_wexpand(b, top); if (!bn_wexpand(b, top))
goto err;
bdp = b->d; bdp = b->d;
bdp[0] = 1; bdp[0] = 1;
for (i = 1; i < top; i++) for (i = 1; i < top; i++)
bdp[i] = 0; bdp[i] = 0;
b->top = top; b->top = top;
bn_wexpand(c, top); if (!bn_wexpand(c, top))
goto err;
cdp = c->d; cdp = c->d;
for (i = 0; i < top; i++) for (i = 0; i < top; i++)
cdp[i] = 0; cdp[i] = 0;

9
deps/openssl/openssl/crypto/bn/bn_mont.c

@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont)
if (mont == NULL) if (mont == NULL)
return; return;
BN_free(&(mont->RR)); BN_clear_free(&(mont->RR));
BN_free(&(mont->N)); BN_clear_free(&(mont->N));
BN_free(&(mont->Ni)); BN_clear_free(&(mont->Ni));
if (mont->flags & BN_FLG_MALLOCED) if (mont->flags & BN_FLG_MALLOCED)
OPENSSL_free(mont); OPENSSL_free(mont);
} }
@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
int ret = 0; int ret = 0;
BIGNUM *Ri, *R; BIGNUM *Ri, *R;
if (BN_is_zero(mod))
return 0;
BN_CTX_start(ctx); BN_CTX_start(ctx);
if ((Ri = BN_CTX_get(ctx)) == NULL) if ((Ri = BN_CTX_get(ctx)) == NULL)
goto err; goto err;

4
deps/openssl/openssl/crypto/bn/bn_recp.c

@ -152,8 +152,10 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
if (BN_ucmp(m, &(recp->N)) < 0) { if (BN_ucmp(m, &(recp->N)) < 0) {
BN_zero(d); BN_zero(d);
if (!BN_copy(r, m)) if (!BN_copy(r, m)) {
BN_CTX_end(ctx);
return 0; return 0;
}
BN_CTX_end(ctx); BN_CTX_end(ctx);
return (1); return (1);
} }

7
deps/openssl/openssl/crypto/bn/bn_x931p.c

@ -213,14 +213,14 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
* exceeded. * exceeded.
*/ */
if (!BN_rand(Xp, nbits, 1, 0)) if (!BN_rand(Xp, nbits, 1, 0))
return 0; goto err;
BN_CTX_start(ctx); BN_CTX_start(ctx);
t = BN_CTX_get(ctx); t = BN_CTX_get(ctx);
for (i = 0; i < 1000; i++) { for (i = 0; i < 1000; i++) {
if (!BN_rand(Xq, nbits, 1, 0)) if (!BN_rand(Xq, nbits, 1, 0))
return 0; goto err;
/* Check that |Xp - Xq| > 2^(nbits - 100) */ /* Check that |Xp - Xq| > 2^(nbits - 100) */
BN_sub(t, Xp, Xq); BN_sub(t, Xp, Xq);
if (BN_num_bits(t) > (nbits - 100)) if (BN_num_bits(t) > (nbits - 100))
@ -234,6 +234,9 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
return 0; return 0;
err:
BN_CTX_end(ctx);
return 0;
} }
/* /*

74
deps/openssl/openssl/crypto/bn/bntest.c

@ -441,6 +441,14 @@ int test_div(BIO *bp, BN_CTX *ctx)
BN_init(&d); BN_init(&d);
BN_init(&e); BN_init(&e);
BN_one(&a);
BN_zero(&b);
if (BN_div(&d, &c, &a, &b, ctx)) {
fprintf(stderr, "Division by zero succeeded!\n");
return 0;
}
for (i = 0; i < num0 + num1; i++) { for (i = 0; i < num0 + num1; i++) {
if (i < num1) { if (i < num1) {
BN_bntest_rand(&a, 400, 0, 0); BN_bntest_rand(&a, 400, 0, 0);
@ -516,9 +524,9 @@ int test_div_word(BIO *bp)
do { do {
BN_bntest_rand(&a, 512, -1, 0); BN_bntest_rand(&a, 512, -1, 0);
BN_bntest_rand(&b, BN_BITS2, -1, 0); BN_bntest_rand(&b, BN_BITS2, -1, 0);
s = b.d[0]; } while (BN_is_zero(&b));
} while (!s);
s = b.d[0];
BN_copy(&b, &a); BN_copy(&b, &a);
r = BN_div_word(&b, s); r = BN_div_word(&b, s);
@ -781,6 +789,18 @@ int test_mont(BIO *bp, BN_CTX *ctx)
if (mont == NULL) if (mont == NULL)
return 0; return 0;
BN_zero(&n);
if (BN_MONT_CTX_set(mont, &n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
return 0;
}
BN_set_word(&n, 16);
if (BN_MONT_CTX_set(mont, &n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
return 0;
}
BN_bntest_rand(&a, 100, 0, 0); BN_bntest_rand(&a, 100, 0, 0);
BN_bntest_rand(&b, 100, 0, 0); BN_bntest_rand(&b, 100, 0, 0);
for (i = 0; i < num2; i++) { for (i = 0; i < num2; i++) {
@ -887,6 +907,14 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx)
d = BN_new(); d = BN_new();
e = BN_new(); e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_mul(e, a, b, c, ctx)) {
fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n");
return 0;
}
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
BN_bntest_rand(c, 1024, 0, 0); BN_bntest_rand(c, 1024, 0, 0);
for (i = 0; i < num0; i++) { for (i = 0; i < num0; i++) {
@ -952,6 +980,14 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
d = BN_new(); d = BN_new();
e = BN_new(); e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_exp(d, a, b, c, ctx)) {
fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n");
return 0;
}
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */ BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
for (i = 0; i < num2; i++) { for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0); BN_bntest_rand(a, 20 + i * 5, 0, 0);
@ -980,6 +1016,24 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx)
return 0; return 0;
} }
} }
/* Regression test for carry propagation bug in sqr8x_reduction */
BN_hex2bn(&a, "050505050505");
BN_hex2bn(&b, "02");
BN_hex2bn(&c,
"4141414141414141414141274141414141414141414141414141414141414141"
"4141414141414141414141414141414141414141414141414141414141414141"
"4141414141414141414141800000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000001");
BN_mod_exp(d, a, b, c, ctx);
BN_mul(e, a, a, ctx);
if (BN_cmp(d, e)) {
fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n");
return 0;
}
BN_free(a); BN_free(a);
BN_free(b); BN_free(b);
BN_free(c); BN_free(c);
@ -999,6 +1053,22 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx)
d = BN_new(); d = BN_new();
e = BN_new(); e = BN_new();
BN_one(a);
BN_one(b);
BN_zero(c);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus "
"succeeded\n");
return 0;
}
BN_set_word(c, 16);
if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) {
fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus "
"succeeded\n");
return 0;
}
BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */ BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */
for (i = 0; i < num2; i++) { for (i = 0; i < num2; i++) {
BN_bntest_rand(a, 20 + i * 5, 0, 0); BN_bntest_rand(a, 20 + i * 5, 0, 0);

68
deps/openssl/openssl/crypto/bn/rsaz_exp.h

@ -1,32 +1,44 @@
/****************************************************************************** /*****************************************************************************
* Copyright(c) 2012, Intel Corp. * *
* Developers and authors: * Copyright (c) 2012, Intel Corporation *
* Shay Gueron (1, 2), and Vlad Krasnov (1) * *
* (1) Intel Corporation, Israel Development Center, Haifa, Israel * All rights reserved. *
* (2) University of Haifa, Israel * *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are *
* met: *
* *
* * Redistributions of source code must retain the above copyright *
* notice, this list of conditions and the following disclaimer. *
* *
* * 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. *
* *
* * Neither the name of the Intel Corporation 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 INTEL CORPORATION ""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 INTEL CORPORATION 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. *
* *
****************************************************************************** ******************************************************************************
* LICENSE: * Developers and authors: *
* This submission to OpenSSL is to be made available under the OpenSSL * Shay Gueron (1, 2), and Vlad Krasnov (1) *
* license, and only to the OpenSSL project, in order to allow integration * (1) Intel Corporation, Israel Development Center, Haifa, Israel *
* into the publicly distributed code. * (2) University of Haifa, Israel *
* The use of this code, or portions of this code, or concepts embedded in *****************************************************************************/
* this code, or modification of this code and/or algorithm(s) in it, or the
* use of this code for any other purpose than stated above, requires special
* licensing.
******************************************************************************
* DISCLAIMER:
* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS AND THE COPYRIGHT OWNERS
* ``AS IS''. ANY EXPRESSED 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 CONTRIBUTORS OR THE COPYRIGHT
* OWNERS 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.
******************************************************************************/
#ifndef RSAZ_EXP_H #ifndef RSAZ_EXP_H
# define RSAZ_EXP_H # define RSAZ_EXP_H

21
deps/openssl/openssl/crypto/buffer/buf_str.c

@ -58,6 +58,7 @@
#include <stdio.h> #include <stdio.h>
#include "cryptlib.h" #include "cryptlib.h"
#include <limits.h>
#include <openssl/buffer.h> #include <openssl/buffer.h>
size_t BUF_strnlen(const char *str, size_t maxlen) size_t BUF_strnlen(const char *str, size_t maxlen)
@ -72,7 +73,7 @@ size_t BUF_strnlen(const char *str, size_t maxlen)
char *BUF_strdup(const char *str) char *BUF_strdup(const char *str)
{ {
if (str == NULL) if (str == NULL)
return (NULL); return NULL;
return BUF_strndup(str, strlen(str)); return BUF_strndup(str, strlen(str));
} }
@ -81,16 +82,22 @@ char *BUF_strndup(const char *str, size_t siz)
char *ret; char *ret;
if (str == NULL) if (str == NULL)
return (NULL); return NULL;
siz = BUF_strnlen(str, siz); siz = BUF_strnlen(str, siz);
if (siz >= INT_MAX)
return NULL;
ret = OPENSSL_malloc(siz + 1); ret = OPENSSL_malloc(siz + 1);
if (ret == NULL) { if (ret == NULL) {
BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE); BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
return (NULL); return NULL;
} }
BUF_strlcpy(ret, str, siz + 1);
memcpy(ret, str, siz);
ret[siz] = '\0';
return (ret); return (ret);
} }
@ -98,13 +105,13 @@ void *BUF_memdup(const void *data, size_t siz)
{ {
void *ret; void *ret;
if (data == NULL) if (data == NULL || siz >= INT_MAX)
return (NULL); return NULL;
ret = OPENSSL_malloc(siz); ret = OPENSSL_malloc(siz);
if (ret == NULL) { if (ret == NULL) {
BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE); BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE);
return (NULL); return NULL;
} }
return memcpy(ret, data, siz); return memcpy(ret, data, siz);
} }

6
deps/openssl/openssl/crypto/buffer/buffer.h

@ -86,7 +86,13 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len);
int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
size_t BUF_strnlen(const char *str, size_t maxlen); size_t BUF_strnlen(const char *str, size_t maxlen);
char *BUF_strdup(const char *str); char *BUF_strdup(const char *str);
/*
* Like strndup, but in addition, explicitly guarantees to never read past the
* first |siz| bytes of |str|.
*/
char *BUF_strndup(const char *str, size_t siz); char *BUF_strndup(const char *str, size_t siz);
void *BUF_memdup(const void *data, size_t siz); void *BUF_memdup(const void *data, size_t siz);
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);

2
deps/openssl/openssl/crypto/cms/cms_enc.c

@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
ok = 1; ok = 1;
err: err:
if (ec->key && !keep_key) { if (ec->key && (!keep_key || !ok)) {
OPENSSL_cleanse(ec->key, ec->keylen); OPENSSL_cleanse(ec->key, ec->keylen);
OPENSSL_free(ec->key); OPENSSL_free(ec->key);
ec->key = NULL; ec->key = NULL;

3
deps/openssl/openssl/crypto/cms/cms_pwri.c

@ -121,6 +121,9 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
/* Setup algorithm identifier for cipher */ /* Setup algorithm identifier for cipher */
encalg = X509_ALGOR_new(); encalg = X509_ALGOR_new();
if (encalg == NULL) {
goto merr;
}
EVP_CIPHER_CTX_init(&ctx); EVP_CIPHER_CTX_init(&ctx);
if (EVP_EncryptInit_ex(&ctx, kekciph, NULL, NULL, NULL) <= 0) { if (EVP_EncryptInit_ex(&ctx, kekciph, NULL, NULL, NULL) <= 0) {

2
deps/openssl/openssl/crypto/cms/cms_sd.c

@ -857,6 +857,8 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain)
} else { } else {
const EVP_MD *md = EVP_MD_CTX_md(&mctx); const EVP_MD *md = EVP_MD_CTX_md(&mctx);
pkctx = EVP_PKEY_CTX_new(si->pkey, NULL); pkctx = EVP_PKEY_CTX_new(si->pkey, NULL);
if (pkctx == NULL)
goto err;
if (EVP_PKEY_verify_init(pkctx) <= 0) if (EVP_PKEY_verify_init(pkctx) <= 0)
goto err; goto err;
if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0) if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0)

2
deps/openssl/openssl/crypto/cms/cms_smime.c

@ -754,7 +754,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
BIO *cmsbio; BIO *cmsbio;
int ret = 0; int ret = 0;
if (!(cmsbio = CMS_dataInit(cms, dcont))) { if (!(cmsbio = CMS_dataInit(cms, dcont))) {
CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE); CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB);
return 0; return 0;
} }

3
deps/openssl/openssl/crypto/comp/c_zlib.c

@ -404,8 +404,9 @@ COMP_METHOD *COMP_zlib(void)
void COMP_zlib_cleanup(void) void COMP_zlib_cleanup(void)
{ {
#ifdef ZLIB_SHARED #ifdef ZLIB_SHARED
if (zlib_dso) if (zlib_dso != NULL)
DSO_free(zlib_dso); DSO_free(zlib_dso);
zlib_dso = NULL;
#endif #endif
} }

3
deps/openssl/openssl/crypto/conf/conf_def.c

@ -225,12 +225,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
goto err; goto err;
} }
section = (char *)OPENSSL_malloc(10); section = BUF_strdup("default");
if (section == NULL) { if (section == NULL) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err; goto err;
} }
BUF_strlcpy(section, "default", 10);
if (_CONF_new_data(conf) == 0) { if (_CONF_new_data(conf) == 0) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);

1
deps/openssl/openssl/crypto/conf/conf_sap.c

@ -90,6 +90,7 @@ void OPENSSL_config(const char *config_name)
CONF_modules_load_file(NULL, config_name, CONF_modules_load_file(NULL, config_name,
CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_DEFAULT_SECTION |
CONF_MFLAGS_IGNORE_MISSING_FILE); CONF_MFLAGS_IGNORE_MISSING_FILE);
openssl_configured = 1;
} }
void OPENSSL_no_config() void OPENSSL_no_config()

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save