Commit 6b1d25a3 authored by Harin Vadodaria's avatar Harin Vadodaria

Bug#19370676 : YASSL PRE-AUTH BUFFER OVERFLOW WHEN CLIENT

               LIES ABOUT SUITE_LEN_
               and
Bug#19355577 : YASSL PRE-AUTH BUFFER OVERFLOW WHEN CLIENT
               LIES ABOUT COMP_LEN_

Description : Updating yaSSL to version 2.3.4.
parent 63a6af32
...@@ -12,7 +12,23 @@ before calling SSL_new(); ...@@ -12,7 +12,23 @@ before calling SSL_new();
*** end Note *** *** end Note ***
yaSSL Release notes, version 2.3.0 (12/5/2013) yaSSL Release notes, version 2.3.4 (8/15/2014)
This release of yaSSL adds checking to the input_buffer class itself.
See normal build instructions below under 1.0.6.
See libcurl build instructions below under 1.3.0 and note in 1.5.8.
yaSSL Release notes, version 2.3.2 (7/25/2014)
This release of yaSSL updates test certs.
See normal build instructions below under 1.0.6.
See libcurl build instructions below under 1.3.0 and note in 1.5.8.
*****************yaSSL Release notes, version 2.3.0 (12/5/2013)
This release of yaSSL updates asm for newer GCC versions. This release of yaSSL updates asm for newer GCC versions.
...@@ -20,7 +36,7 @@ See normal build instructions below under 1.0.6. ...@@ -20,7 +36,7 @@ See normal build instructions below under 1.0.6.
See libcurl build instructions below under 1.3.0 and note in 1.5.8. See libcurl build instructions below under 1.3.0 and note in 1.5.8.
*****************yaSSL Release notes, version 2.2.3b (4/23/2013) *****************yaSSL Release notes, version 2.2.3 (4/23/2013)
This release of yaSSL updates the test certificates as they were expired This release of yaSSL updates the test certificates as they were expired
......
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
MIIEnjCCA4agAwIBAgIJAOnQp195JfQ8MA0GCSqGSIb3DQEBBQUAMIGQMQswCQYD MIIEqjCCA5KgAwIBAgIJAJpBR82hFGKMMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYD
VQQGEwJVUzEQMA4GA1UECBMHTW9udGFuYTEQMA4GA1UEBxMHQm96ZW1hbjERMA8G VQQGEwJVUzEQMA4GA1UECAwHTW9udGF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Y29tggkA6dCnX3kl9DwwDAYDVR0TBAUwAwEB/zAN MR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tggkAmkFHzaEUYowwDAYD
BgkqhkiG9w0BAQUFAAOCAQEAX4YU9FGLvKVOMNperJr4bNkmS5P54xyJb57us513 VR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAeXgMbXmIkfw6FZz5J2IW8CEf
PokgdqPm6IYVIdviM7I01dCf88Gkh5Jc+dH/MC+OA7yzPAwyo5BfGpAer53zntcH +n0/oqgyHvfyEal0FnRe3BjK8AAq1QMGJjDxR4P9Mm787apPfQxjYDEvfAy/mWaH
Aql9J2ZjL68Y16wYmIyDjzjzC6w2EHX7ynYTUFsCj3O/46Dug1IlVM4mzpy9L3mr 7ScIhi3EM+iYIxz+o9uaSU78WkLvccM/rdxKqNKjHQmsMwR7hvNtAFmjyNvRPHP2
G2C4kvEDwPw7CNnArdVyCCWAYS3cn6eDYgdH4AdMSwcwBKmHHFV/BxLQy0Jdy89m DpDWXkngvzZjCHulsI81O1aMETVJBBzQ57pWxQ0KkY3Wt2IZNBJSTNJtfMU9DxiB
ARoX7vkPYLfbb2jlTkFibtNvYE9LJ97PGAfxE13LP6klRNpSXMgE4VYS9SqQTtHi VMv2POWE0tZxFewaNAvwoCF0Q8ijsN/ZZ9rirZNI+KCHvXkU4GIK3/cxLjF70TIq
rwG1I6HsMdp7Y2nEuPPnzqE9wNtt87LZRsifw7hwWh9/yg== Cv5dFO/ZZFDkg5G8cA3XiI3ZvIQOxRqzv2QCTlGRpKKFFYOv8FubKElfsrMD2A==
-----END CERTIFICATE----- -----END CERTIFICATE-----
Certificate: Certificate:
Data: Data:
Version: 3 (0x2) Version: 3 (0x2)
Serial Number: Serial Number:
e9:d0:a7:5f:79:25:f4:3c 9a:41:47:cd:a1:14:62:8c
Signature Algorithm: sha1WithRSAEncryption Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
Validity Validity
Not Before: Oct 24 18:18:15 2011 GMT Not Before: Jul 11 03:20:08 2014 GMT
Not After : Jul 20 18:18:15 2014 GMT Not After : Apr 6 03:20:08 2017 GMT
Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.yassl.com/emailAddress=info@yassl.com Subject: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: rsaEncryption Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit) Public-Key: (2048 bit)
Modulus (2048 bit): Modulus:
00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a: 00:bf:0c:ca:2d:14:b2:1e:84:42:5b:cd:38:1f:4a:
f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac: f2:4d:75:10:f1:b6:35:9f:df:ca:7d:03:98:d3:ac:
de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98: de:03:66:ee:2a:f1:d8:b0:7d:6e:07:54:0b:10:98:
...@@ -64,24 +64,24 @@ Certificate: ...@@ -64,24 +64,24 @@ Certificate:
27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
X509v3 Authority Key Identifier: X509v3 Authority Key Identifier:
keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5 keyid:27:8E:67:11:74:C3:26:1D:3F:ED:33:63:B3:A4:D8:1D:30:E5:E8:D5
DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.yassl.com/emailAddress=info@yassl.com DirName:/C=US/ST=Montana/L=Bozeman/O=Sawtooth/OU=Consulting/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
serial:E9:D0:A7:5F:79:25:F4:3C serial:9A:41:47:CD:A1:14:62:8C
X509v3 Basic Constraints: X509v3 Basic Constraints:
CA:TRUE CA:TRUE
Signature Algorithm: sha1WithRSAEncryption Signature Algorithm: sha1WithRSAEncryption
5f:86:14:f4:51:8b:bc:a5:4e:30:da:5e:ac:9a:f8:6c:d9:26: 79:78:0c:6d:79:88:91:fc:3a:15:9c:f9:27:62:16:f0:21:1f:
4b:93:f9:e3:1c:89:6f:9e:ee:b3:9d:77:3e:89:20:76:a3:e6: fa:7d:3f:a2:a8:32:1e:f7:f2:11:a9:74:16:74:5e:dc:18:ca:
e8:86:15:21:db:e2:33:b2:34:d5:d0:9f:f3:c1:a4:87:92:5c: f0:00:2a:d5:03:06:26:30:f1:47:83:fd:32:6e:fc:ed:aa:4f:
f9:d1:ff:30:2f:8e:03:bc:b3:3c:0c:32:a3:90:5f:1a:90:1e: 7d:0c:63:60:31:2f:7c:0c:bf:99:66:87:ed:27:08:86:2d:c4:
af:9d:f3:9e:d7:07:02:a9:7d:27:66:63:2f:af:18:d7:ac:18: 33:e8:98:23:1c:fe:a3:db:9a:49:4e:fc:5a:42:ef:71:c3:3f:
98:8c:83:8f:38:f3:0b:ac:36:10:75:fb:ca:76:13:50:5b:02: ad:dc:4a:a8:d2:a3:1d:09:ac:33:04:7b:86:f3:6d:00:59:a3:
8f:73:bf:e3:a0:ee:83:52:25:54:ce:26:ce:9c:bd:2f:79:ab: c8:db:d1:3c:73:f6:0e:90:d6:5e:49:e0:bf:36:63:08:7b:a5:
1b:60:b8:92:f1:03:c0:fc:3b:08:d9:c0:ad:d5:72:08:25:80: b0:8f:35:3b:56:8c:11:35:49:04:1c:d0:e7:ba:56:c5:0d:0a:
61:2d:dc:9f:a7:83:62:07:47:e0:07:4c:4b:07:30:04:a9:87: 91:8d:d6:b7:62:19:34:12:52:4c:d2:6d:7c:c5:3d:0f:18:81:
1c:55:7f:07:12:d0:cb:42:5d:cb:cf:66:01:1a:17:ee:f9:0f: 54:cb:f6:3c:e5:84:d2:d6:71:15:ec:1a:34:0b:f0:a0:21:74:
60:b7:db:6f:68:e5:4e:41:62:6e:d3:6f:60:4f:4b:27:de:cf: 43:c8:a3:b0:df:d9:67:da:e2:ad:93:48:f8:a0:87:bd:79:14:
18:07:f1:13:5d:cb:3f:a9:25:44:da:52:5c:c8:04:e1:56:12: e0:62:0a:df:f7:31:2e:31:7b:d1:32:2a:0a:fe:5d:14:ef:d9:
f5:2a:90:4e:d1:e2:af:01:b5:23:a1:ec:31:da:7b:63:69:c4: 64:50:e4:83:91:bc:70:0d:d7:88:8d:d9:bc:84:0e:c5:1a:b3:
b8:f3:e7:ce:a1:3d:c0:db:6d:f3:b2:d9:46:c8:9f:c3:b8:70: bf:64:02:4e:51:91:a4:a2:85:15:83:af:f0:5b:9b:28:49:5f:
5a:1f:7f:ca b2:b3:03:d8
...@@ -2,17 +2,17 @@ Certificate: ...@@ -2,17 +2,17 @@ Certificate:
Data: Data:
Version: 3 (0x2) Version: 3 (0x2)
Serial Number: Serial Number:
87:4a:75:be:91:66:d8:3d b6:63:af:8f:5d:62:57:a0
Signature Algorithm: sha1WithRSAEncryption Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com Issuer: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
Validity Validity
Not Before: Oct 24 18:21:55 2011 GMT Not Before: Jul 11 17:39:44 2014 GMT
Not After : Jul 20 18:21:55 2014 GMT Not After : Apr 6 17:39:44 2017 GMT
Subject: C=US, ST=Oregon, L=Portland, O=yaSSL, OU=Programming, CN=www.yassl.com/emailAddress=info@yassl.com Subject: C=US, ST=Montana, L=Bozeman, O=wolfSSL, OU=Programming, CN=www.wolfssl.com/emailAddress=info@wolfssl.com
Subject Public Key Info: Subject Public Key Info:
Public Key Algorithm: rsaEncryption Public Key Algorithm: rsaEncryption
RSA Public Key: (2048 bit) Public-Key: (2048 bit)
Modulus (2048 bit): Modulus:
00:c3:03:d1:2b:fe:39:a4:32:45:3b:53:c8:84:2b: 00:c3:03:d1:2b:fe:39:a4:32:45:3b:53:c8:84:2b:
2a:7c:74:9a:bd:aa:2a:52:07:47:d6:a6:36:b2:07: 2a:7c:74:9a:bd:aa:2a:52:07:47:d6:a6:36:b2:07:
32:8e:d0:ba:69:7b:c6:c3:44:9e:d4:81:48:fd:2d: 32:8e:d0:ba:69:7b:c6:c3:44:9e:d4:81:48:fd:2d:
...@@ -37,51 +37,51 @@ Certificate: ...@@ -37,51 +37,51 @@ Certificate:
33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0 33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
X509v3 Authority Key Identifier: X509v3 Authority Key Identifier:
keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0 keyid:33:D8:45:66:D7:68:87:18:7E:54:0D:70:27:91:C7:26:D7:85:65:C0
DirName:/C=US/ST=Oregon/L=Portland/O=yaSSL/OU=Programming/CN=www.yassl.com/emailAddress=info@yassl.com DirName:/C=US/ST=Montana/L=Bozeman/O=wolfSSL/OU=Programming/CN=www.wolfssl.com/emailAddress=info@wolfssl.com
serial:87:4A:75:BE:91:66:D8:3D serial:B6:63:AF:8F:5D:62:57:A0
X509v3 Basic Constraints: X509v3 Basic Constraints:
CA:TRUE CA:TRUE
Signature Algorithm: sha1WithRSAEncryption Signature Algorithm: sha1WithRSAEncryption
1c:7c:42:81:29:9e:21:cf:d0:d8:c1:54:6f:cc:ae:14:09:38: 85:10:90:c5:5d:de:25:8c:f2:57:7b:2d:14:1c:05:f9:71:63:
ff:68:98:9a:95:53:76:18:7b:e6:30:76:ec:28:0d:75:a7:de: 40:b0:e3:c1:c1:2e:13:2a:7a:b7:d6:24:58:87:eb:03:fb:0d:
e0:cd:8e:d5:55:23:6a:47:2b:4e:8d:fc:7d:06:a3:d8:0f:ad: af:e0:f4:d0:c8:bc:51:36:10:4f:79:cc:4f:66:7d:af:99:cb:
5e:d6:04:c9:00:33:fb:77:27:d3:b5:03:b3:7b:21:74:31:0b: 7b:ce:68:94:c6:36:aa:42:6e:8c:78:5b:b2:85:ca:d1:e1:a8:
4a:af:2d:1a:b3:93:8e:cc:f3:5f:3d:90:3f:cc:e3:55:19:91: 31:d1:81:d9:f9:c1:a3:9e:34:43:ef:0a:79:7d:3e:83:61:fc:
7b:78:24:2e:4a:09:bb:18:4e:61:2d:9c:c6:0a:a0:34:91:88: 14:5c:d1:dd:bc:0e:d7:51:b7:71:6e:41:7e:8b:2c:5a:9a:cb:
70:6b:3b:48:47:bc:79:94:a2:a0:4d:32:47:54:c2:a3:dc:2e: 77:4b:6a:f5:06:ff:02:af:1e:e6:63:4f:bc:44:d9:3f:56:9e:
d2:51:4c:29:39:11:ff:e2:15:5e:58:97:36:f6:e9:06:06:86: 09:9c:43:f9:55:21:32:46:82:09:86:a9:7b:74:1c:9e:5a:2a:
0e:8d:9d:95:03:72:b2:8b:19:7c:e9:14:6e:a1:88:73:68:58: bf:03:79:91:cb:f2:29:7f:c9:15:82:89:b9:53:cd:7e:07:90:
6d:71:5e:c2:d5:d3:13:d2:5f:de:ea:03:be:e2:00:40:e5:ce: a9:5d:76:e1:19:5e:0d:58:b8:59:d5:0d:df:23:ab:6b:63:76:
fd:e6:92:31:57:c3:eb:bb:66:ac:cb:2f:1a:fa:e0:62:a2:47: 19:9e:9c:df:b0:57:49:6c:d0:86:97:c3:6c:3c:fa:e0:56:c2:
f4:93:43:2a:4b:6c:5e:0a:2f:f9:e7:e6:4a:63:86:b0:ac:2a: 1b:e3:a1:42:1a:58:62:85:9d:74:19:83:08:af:59:90:f8:99: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MkaCCYape3QcnloqvwN5kcvyKX/JFYKJuVPNfgeQ
/eaSMVfD67tmrMsvGvrgYqJH9JNDKktsXgov+efmSmOGsKwqoeu0W2fNMuS2EUua qV124RleDVi4WdUN3yOra2N2GZ6c37BXSWzQhpfDbDz64FbCG+OhQhpYYoWddBmD
cmYNokp2j/4ivIP927fVqe4FybFxfhsr4eOvwA== CK9ZkPiZvWfTSuoOycphig2KQsyQ6S7CVHN/Xq+N4jLLRSDWGU1bdzHMDy3Afg==
-----END CERTIFICATE----- -----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED Proc-Type: 4,ENCRYPTED
DEK-Info: DES-CBC,B9D8FB94E38635AB DEK-Info: DES-EDE3-CBC,BDE979D13CCC0ABD
3OTcffWLy2Ddlu2oUwnMWkvIb3e9wLL1jrKOpC0aeb//uiawgw50+KuU4pewB5fN N7yz2JV13EmQ7MZPL5wamid5+G1V1gp8FKqMemAC5JDxonS/W9oViMLUcxbfPTDx
lfEJwpX4NjfPL+Nk+B1VAVrv5gwk5/SY9SwIJluutzmGS4TfVOhqi2SVd0mc9kOD FznKdYSVTIQ7vv3ofmDG4MEyV/2C568N2kdtAw+jTfrZFN+IU9CI+W+In/nacirF
cSWQ9ltAohFu67jdx36j2u+eghDTOjls1lM8EpzL5cu3Bp4G+ST0nXAdnGtSZdV6 02sAcvDMofustnooKNOO7/iyb5+3vRvEt5vSSRQn5WuSQ9sUKjuzoLs/lbf7fyAt
eToLWjIHiC/JqeRSsKAlG0M5verw14sbb5MO4ZQF4Tdu0fCFgFvDSUM2V4ZLtS1N 4NeqfI3rYBZXxiUOLITOGXzGNRuFoY+o2uDCfelLAJ8uhiVG6ME3LeJEo1dT5lZ8
VysLEkHoF56YKZ5H2FYLxOVDpn5lSiLnOgRbteEzsysyJ1zLxXWFFwJPCpLVNL0e CSJOLPasKg0iG4V7olM4j9FvAfZr48RRsSfUen756Jo2HpI4bad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1m8GrOm+hskJLTHgZLdz6tFTYkXfZBSCwIl7s
plg0wq9CrNC2B8MczWn/j3/h7qSI3wBNqADHMdoiOHECffCeyGEYjW3+0iMoj1m1
wY0DIym4DDRzk6wsEesxVi8iiCVpYwWnjJAvWYECEO+hWuwCez+eGVkhCT/5g3xW
hPSRhivNuJT05tdR5o+yqONHn1eAQH7Ar3cj+neY5WC0iS5FK9axTqbHXotofD1e
pJX17ZVWsmIIpRvAWGD+LOcfTMZsaB9DJbkrPSWlMW3lC2S5JOq8OgfMNWIDDUN1
guwpK5Z/lWV1qMMnaWeDVgPH/G0FssECXlCU5+/Ol654h8tm2bRXYAYHPM+OoW67
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
-----BEGIN DSA PRIVATE KEY-----
MIIBvAIBAAKBgQC9Ue5KMuCKx+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvT
NNNoWiVxTn3kvQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNf
dPUc4E3SA6efopG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ
7WDQ+jBn/nmMyCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZn
YWGYf2PM+Iwo6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47
BeLBWfqWAgXVj0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQW
cCgAwGm6AoGBAJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caa
DDa0XJ7ak6A7TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WX
S0kk3m/DHaC03ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVAhQ01VXa
Rr8IPem35lKghVKnq/kGQw==
-----END DSA PRIVATE KEY-----
-----BEGIN DSA PRIVATE KEY-----
MIH3AgEAAkEAmSlpgMk8mGhFqYL+Z+uViMW0DNYmRZUZLKAgW37faencww/zYQol
m/IhAWrNqow358pm21b0D3160Ri5Qv0bEQIVAK0lKasKnwkcwa0DIHZ/prfdTQMJ
AkASiJna59ALk5vm7jwhf5yztI2ljOI3gD8X0YFPvfBxtjIIVN2/AeKzdwZkdYoE
1nk5sQIDA8YGdOWQBQoQRhkxAkAEhKAmMXIM6E9dUxdisYDKwBZfwx7qxdmYOPm+
VlNHaM4IIlccuw13kc9bNu3zJIKQis2QfNt3+Rctc3Pvu7mCAhQjg+e+aqykxwwc
E2V27tjDFY02uA==
-----END DSA PRIVATE KEY-----
This diff is collapsed.
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED Proc-Type: 4,ENCRYPTED
DEK-Info: DES-CBC,08132C1FFF5BC8CC DEK-Info: DES-CBC,136C7D8A69656668
W+krChiFlNU+koE0Bep+U45OG4V4IFZv67ex6yJHgcsPd+HQ692A/h+5dYc8rdlW jvNTyPaztxPIoAzbdmZnD0Zw2+60tMxNc0GMHNmeOyG25aHP/dT+TWiKFpFVkkkY
2LDgSODHHIMTt6RVJDxXxXs3qFmJQbnVXeXxV209X8EfaRarh+yiMKeUP6K8hIvj uoCIhYUyw7gmpw+CnRJwWd+ans4nrvAjwy5oWJvarvsyUpjqvnPoIlAqd+d4TDKN
+IYRma6iKOs+d4KlcZZudGs2f/x8nhxXbmQtrLhGd4h91mnJk2sKmiz7UkUy6Qng eESzcI76+gHdisAtCrQD+fGqgTZhli5TgDbnpasL/QnY2qDlutvakkVw7gPXe156
gOHnT2dfF4Qk2ZYsjisRHjpWZiqh40GO1LuTgUjZoH+LGhMwMwOAE6+ss5xa+yE+ 2Phy8WN+efr65J6wt3K/dj7Datl9u4JeHQK81gYyWBVX+EagEjPGDzkFQCj9Z0q7
Xd9Yljm0/QW68JILkCJQjLDRvPGxDJyvYq6TT/kSElsRlI/AuRrZH1YVD3hn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j47pzZy0ELXXN2qYJ9Oelgl+h6MzYbmd+Wm+A2Cofv3u oNutSQA+7P42vfHSHK4cnTBXl6V32H/GyVpdHQOZqSrqIjgLmUZodSmRPROxosZF
7ANAyjAYN7/Lo3lTFAt7sXAXGKnqw62JNSSMkIqZVrG5dn7Jxj5AJCVyYxTrm6Y+ a46B1O7m/rJFxkiKW4vod+/WqjoE0Hhfrb8rRrkRjzGeCqqSSnQ3vrunVkvF8hlA
DDcblX47XrWxVoVJN/dLJZ8FzWs4o/8w9Yn8U54Ci7F0g+j2f+OpDy9PGFYT9pKw b6FOv4ZBJL4piC1GKH+rscqke9NEiDqXN8C3iYz86jbck/Ha21yUS8T3X7N52sg+
xWG8chkYE6QPilEYvdi26ZnZ3u236q9PMtyRP87NmBN2sLkj/rbBTzBxWIaGS+Mt B3AmOGnLK6BebYeto9vZxQjacChJZSixSxLV+l9/nVQ0+mW42azHdzk0ru59TGAj
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -48,7 +48,11 @@ const uint AUTO = 0xFEEDBEEF; ...@@ -48,7 +48,11 @@ const uint AUTO = 0xFEEDBEEF;
struct NoCheck { struct NoCheck {
void check(uint, uint); int check(uint, uint);
};
struct Check {
int check(uint, uint);
}; };
/* input_buffer operates like a smart c style array with a checking option, /* input_buffer operates like a smart c style array with a checking option,
...@@ -60,11 +64,13 @@ struct NoCheck { ...@@ -60,11 +64,13 @@ struct NoCheck {
* write to the buffer bulk wise and have the correct size * write to the buffer bulk wise and have the correct size
*/ */
class input_buffer : public NoCheck { class input_buffer : public Check {
uint size_; // number of elements in buffer uint size_; // number of elements in buffer
uint current_; // current offset position in buffer uint current_; // current offset position in buffer
byte* buffer_; // storage for buffer byte* buffer_; // storage for buffer
byte* end_; // end of storage marker byte* end_; // end of storage marker
int error_; // error number
byte zero_; // for returning const reference to zero byte
public: public:
input_buffer(); input_buffer();
...@@ -93,6 +99,10 @@ public: ...@@ -93,6 +99,10 @@ public:
uint get_remaining() const; uint get_remaining() const;
int get_error() const;
void set_error();
void set_current(uint i); void set_current(uint i);
// read only access through [], advance current // read only access through [], advance current
...@@ -103,7 +113,7 @@ public: ...@@ -103,7 +113,7 @@ public:
bool eof(); bool eof();
// peek ahead // peek ahead
byte peek() const; byte peek();
// write function, should use at/near construction // write function, should use at/near construction
void assign(const byte* t, uint s); void assign(const byte* t, uint s);
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "rsa.h" #include "rsa.h"
#define YASSL_VERSION "2.3.0" #define YASSL_VERSION "2.3.4"
#if defined(__cplusplus) #if defined(__cplusplus)
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -32,8 +32,19 @@ namespace yaSSL { ...@@ -32,8 +32,19 @@ namespace yaSSL {
void NoCheck::check(uint, uint) /* return 0 on check success, always true for NoCheck policy */
int NoCheck::check(uint, uint)
{ {
return 0;
}
/* return 0 on check success */
int Check::check(uint i, uint max)
{
if (i < max)
return 0;
return -1;
} }
...@@ -48,18 +59,20 @@ void NoCheck::check(uint, uint) ...@@ -48,18 +59,20 @@ void NoCheck::check(uint, uint)
input_buffer::input_buffer() input_buffer::input_buffer()
: size_(0), current_(0), buffer_(0), end_(0) : size_(0), current_(0), buffer_(0), end_(0), error_(0), zero_(0)
{} {}
input_buffer::input_buffer(uint s) input_buffer::input_buffer(uint s)
: size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s),
error_(0), zero_(0)
{} {}
// with assign // with assign
input_buffer::input_buffer(uint s, const byte* t, uint len) input_buffer::input_buffer(uint s, const byte* t, uint len)
: size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s) : size_(0), current_(0), buffer_(NEW_YS byte[s]), end_(buffer_ + s),
error_(0), zero_(0)
{ {
assign(t, len); assign(t, len);
} }
...@@ -74,8 +87,10 @@ input_buffer::~input_buffer() ...@@ -74,8 +87,10 @@ input_buffer::~input_buffer()
// users can pass defualt zero length buffer and then allocate // users can pass defualt zero length buffer and then allocate
void input_buffer::allocate(uint s) void input_buffer::allocate(uint s)
{ {
if (error_ == 0) {
buffer_ = NEW_YS byte[s]; buffer_ = NEW_YS byte[s];
end_ = buffer_ + s; end_ = buffer_ + s;
}
} }
...@@ -90,40 +105,67 @@ byte* input_buffer::get_buffer() const ...@@ -90,40 +105,67 @@ byte* input_buffer::get_buffer() const
// if you know the size before the write use assign() // if you know the size before the write use assign()
void input_buffer::add_size(uint i) void input_buffer::add_size(uint i)
{ {
check(size_ + i-1, get_capacity()); if (error_ == 0 && check(size_ + i-1, get_capacity()) == 0)
size_ += i; size_ += i;
else
error_ = -1;
} }
uint input_buffer::get_capacity() const uint input_buffer::get_capacity() const
{ {
return (uint) (end_ - buffer_); if (error_ == 0)
return end_ - buffer_;
return 0;
} }
uint input_buffer::get_current() const uint input_buffer::get_current() const
{ {
if (error_ == 0)
return current_; return current_;
return 0;
} }
uint input_buffer::get_size() const uint input_buffer::get_size() const
{ {
if (error_ == 0)
return size_; return size_;
return 0;
} }
uint input_buffer::get_remaining() const uint input_buffer::get_remaining() const
{ {
if (error_ == 0)
return size_ - current_; return size_ - current_;
return 0;
}
int input_buffer::get_error() const
{
return error_;
}
void input_buffer::set_error()
{
error_ = -1;
} }
void input_buffer::set_current(uint i) void input_buffer::set_current(uint i)
{ {
if (i) if (error_ == 0 && i && check(i - 1, size_) == 0)
check(i - 1, size_);
current_ = i; current_ = i;
else
error_ = -1;
} }
...@@ -131,40 +173,59 @@ void input_buffer::set_current(uint i) ...@@ -131,40 +173,59 @@ void input_buffer::set_current(uint i)
// user passes in AUTO index for ease of use // user passes in AUTO index for ease of use
const byte& input_buffer::operator[](uint i) const byte& input_buffer::operator[](uint i)
{ {
check(current_, size_); if (error_ == 0 && check(current_, size_) == 0)
return buffer_[current_++]; return buffer_[current_++];
error_ = -1;
return zero_;
} }
// end of input test // end of input test
bool input_buffer::eof() bool input_buffer::eof()
{ {
if (error_ != 0)
return true;
return current_ >= size_; return current_ >= size_;
} }
// peek ahead // peek ahead
byte input_buffer::peek() const byte input_buffer::peek()
{ {
if (error_ == 0 && check(current_, size_) == 0)
return buffer_[current_]; return buffer_[current_];
error_ = -1;
return 0;
} }
// write function, should use at/near construction // write function, should use at/near construction
void input_buffer::assign(const byte* t, uint s) void input_buffer::assign(const byte* t, uint s)
{ {
check(current_, get_capacity()); if (t && error_ == 0 && check(current_, get_capacity()) == 0) {
add_size(s); add_size(s);
if (error_ == 0) {
memcpy(&buffer_[current_], t, s); memcpy(&buffer_[current_], t, s);
return; // success
}
}
error_ = -1;
} }
// use read to query input, adjusts current // use read to query input, adjusts current
void input_buffer::read(byte* dst, uint length) void input_buffer::read(byte* dst, uint length)
{ {
check(current_ + length - 1, size_); if (dst && error_ == 0 && check(current_ + length - 1, size_) == 0) {
memcpy(dst, &buffer_[current_], length); memcpy(dst, &buffer_[current_], length);
current_ += length; current_ += length;
} else {
error_ = -1;
}
} }
......
...@@ -522,7 +522,7 @@ void buildSHA_CertVerify(SSL& ssl, byte* digest) ...@@ -522,7 +522,7 @@ void buildSHA_CertVerify(SSL& ssl, byte* digest)
// some clients still send sslv2 client hello // some clients still send sslv2 client hello
void ProcessOldClientHello(input_buffer& input, SSL& ssl) void ProcessOldClientHello(input_buffer& input, SSL& ssl)
{ {
if (input.get_remaining() < 2) { if (input.get_error() || input.get_remaining() < 2) {
ssl.SetError(bad_input); ssl.SetError(bad_input);
return; return;
} }
...@@ -549,20 +549,24 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) ...@@ -549,20 +549,24 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl)
byte len[2]; byte len[2];
input.read(len, sizeof(len)); len[0] = input[AUTO];
len[1] = input[AUTO];
ato16(len, ch.suite_len_); ato16(len, ch.suite_len_);
input.read(len, sizeof(len)); len[0] = input[AUTO];
len[1] = input[AUTO];
uint16 sessionLen; uint16 sessionLen;
ato16(len, sessionLen); ato16(len, sessionLen);
ch.id_len_ = sessionLen; ch.id_len_ = sessionLen;
input.read(len, sizeof(len)); len[0] = input[AUTO];
len[1] = input[AUTO];
uint16 randomLen; uint16 randomLen;
ato16(len, randomLen); ato16(len, randomLen);
if (ch.suite_len_ > MAX_SUITE_SZ || sessionLen > ID_LEN || if (input.get_error() || ch.suite_len_ > MAX_SUITE_SZ ||
randomLen > RAN_LEN) { ch.suite_len_ > input.get_remaining() ||
sessionLen > ID_LEN || randomLen > RAN_LEN) {
ssl.SetError(bad_input); ssl.SetError(bad_input);
return; return;
} }
...@@ -580,13 +584,12 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl) ...@@ -580,13 +584,12 @@ void ProcessOldClientHello(input_buffer& input, SSL& ssl)
ch.suite_len_ = j; ch.suite_len_ = j;
if (ch.id_len_) if (ch.id_len_)
input.read(ch.session_id_, ch.id_len_); input.read(ch.session_id_, ch.id_len_); // id_len_ from sessionLen
if (randomLen < RAN_LEN) if (randomLen < RAN_LEN)
memset(ch.random_, 0, RAN_LEN - randomLen); memset(ch.random_, 0, RAN_LEN - randomLen);
input.read(&ch.random_[RAN_LEN - randomLen], randomLen); input.read(&ch.random_[RAN_LEN - randomLen], randomLen);
ch.Process(input, ssl); ch.Process(input, ssl);
} }
...@@ -787,6 +790,9 @@ int DoProcessReply(SSL& ssl) ...@@ -787,6 +790,9 @@ int DoProcessReply(SSL& ssl)
ssl.verifyState(hdr); ssl.verifyState(hdr);
} }
if (ssl.GetError())
return 0;
// make sure we have enough input in buffer to process this record // make sure we have enough input in buffer to process this record
if (needHdr || hdr.length_ > buffer.get_remaining()) { if (needHdr || hdr.length_ > buffer.get_remaining()) {
// put header in front for next time processing // put header in front for next time processing
...@@ -799,6 +805,9 @@ int DoProcessReply(SSL& ssl) ...@@ -799,6 +805,9 @@ int DoProcessReply(SSL& ssl)
while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) {
// each message in record, can be more than 1 if not encrypted // each message in record, can be more than 1 if not encrypted
if (ssl.GetError())
return 0;
if (ssl.getSecurity().get_parms().pending_ == false) { // cipher on if (ssl.getSecurity().get_parms().pending_ == false) { // cipher on
// sanity check for malicious/corrupted/illegal input // sanity check for malicious/corrupted/illegal input
if (buffer.get_remaining() < hdr.length_) { if (buffer.get_remaining() < hdr.length_) {
......
This diff is collapsed.
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -2535,7 +2535,8 @@ ASN1_STRING* StringHolder::GetString() ...@@ -2535,7 +2535,8 @@ ASN1_STRING* StringHolder::GetString()
{ {
byte tmp[LENGTH_SZ]; byte tmp[LENGTH_SZ];
in.read(tmp, sizeof(tmp)); tmp[0] = in[AUTO];
tmp[1] = in[AUTO];
uint16 len; uint16 len;
ato16(tmp, len); ato16(tmp, len);
......
/* /*
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -111,7 +111,7 @@ enum Constants ...@@ -111,7 +111,7 @@ enum Constants
MAX_LENGTH_SZ = 5, MAX_LENGTH_SZ = 5,
MAX_SEQ_SZ = 5, // enum(seq|con) + length(4) MAX_SEQ_SZ = 5, // enum(seq|con) + length(4)
MAX_ALGO_SIZE = 9, MAX_ALGO_SIZE = 9,
MAX_DIGEST_SZ = 25, // SHA + enum(Bit or Octet) + length(4) MAX_DIGEST_SZ = 69, // SHA512 + enum(Bit or Octet) + length(4)
DSA_SIG_SZ = 40, DSA_SIG_SZ = 40,
ASN_NAME_MAX = 512 // max total of all included names ASN_NAME_MAX = 512 // max total of all included names
}; };
...@@ -257,8 +257,11 @@ typedef STL::list<Signer*> SignerList; ...@@ -257,8 +257,11 @@ typedef STL::list<Signer*> SignerList;
enum ContentType { HUH = 651 }; enum ContentType { HUH = 651 };
enum SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA =649}; enum SigType { SHAwDSA = 517, MD2wRSA = 646, MD5wRSA = 648, SHAwRSA = 649,
enum HashType { MD2h = 646, MD5h = 649, SHAh = 88 }; SHA256wRSA = 655, SHA384wRSA = 656, SHA512wRSA = 657,
SHA256wDSA = 416 };
enum HashType { MD2h = 646, MD5h = 649, SHAh = 88, SHA256h = 414, SHA384h = 415,
SHA512h = 416 };
enum KeyType { DSAk = 515, RSAk = 645 }; // sums of algo OID enum KeyType { DSAk = 515, RSAk = 645 }; // sums of algo OID
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -74,7 +74,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize, ...@@ -74,7 +74,7 @@ typename A::pointer StdReallocate(A& a, T* p, typename A::size_type oldSize,
if (preserve) { if (preserve) {
A b = A(); A b = A();
typename A::pointer newPointer = b.allocate(newSize, 0); typename A::pointer newPointer = b.allocate(newSize, 0);
memcpy(newPointer, p, sizeof(T) * min((word32) oldSize, (word32) newSize)); memcpy(newPointer, p, sizeof(T) * min(oldSize, newSize));
a.deallocate(p, oldSize); a.deallocate(p, oldSize);
STL::swap(a, b); STL::swap(a, b);
return newPointer; return newPointer;
...@@ -186,9 +186,9 @@ public: ...@@ -186,9 +186,9 @@ public:
~Block() { allocator_.deallocate(buffer_, sz_); } ~Block() { allocator_.deallocate(buffer_, sz_); }
private: private:
A allocator_;
word32 sz_; // size in Ts word32 sz_; // size in Ts
T* buffer_; T* buffer_;
A allocator_;
}; };
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
MA 02110-1301 USA. MA 02110-1301 USA.
*/ */
/* pwdbased.hpp defines PBKDF2 from PKCS #5 /* pwdbased.hpp defines PBKDF2 from PKCS #5
*/ */
...@@ -51,9 +52,6 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd, ...@@ -51,9 +52,6 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd,
if (dLen > MaxDerivedKeyLength()) if (dLen > MaxDerivedKeyLength())
return 0; return 0;
if (iterations < 0)
return 0;
ByteBlock buffer(T::DIGEST_SIZE); ByteBlock buffer(T::DIGEST_SIZE);
HMAC<T> hmac; HMAC<T> hmac;
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -34,7 +34,10 @@ ...@@ -34,7 +34,10 @@
// Handler for pure virtual functions // Handler for pure virtual functions
namespace __Crun { namespace __Crun {
void pure_error(void); static void pure_error(void)
{
// "Pure virtual method called, Aborted", GCC 4.2 str cmp fix
}
} // namespace __Crun } // namespace __Crun
#endif // __sun #endif // __sun
...@@ -48,7 +51,15 @@ extern "C" { ...@@ -48,7 +51,15 @@ extern "C" {
#if defined(DO_TAOCRYPT_KERNEL_MODE) #if defined(DO_TAOCRYPT_KERNEL_MODE)
#include "kernelc.hpp" #include "kernelc.hpp"
#endif #endif
int __cxa_pure_virtual () __attribute__ ((weak));
/* Disallow inline __cxa_pure_virtual() */
static int __cxa_pure_virtual() __attribute__((noinline, used));
static int __cxa_pure_virtual()
{
// oops, pure virtual called!
return 0;
}
} // extern "C" } // extern "C"
#endif // __GNUC__ > 2 #endif // __GNUC__ > 2
......
/* /*
Copyright (C) 2000-2007 MySQL AB Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -159,6 +158,12 @@ private: ...@@ -159,6 +158,12 @@ private:
void Transform(); void Transform();
}; };
enum { MAX_SHA2_DIGEST_SIZE = 64 }; // SHA512
#else
enum { MAX_SHA2_DIGEST_SIZE = 32 }; // SHA256
#endif // WORD64_AVAILABLE #endif // WORD64_AVAILABLE
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -467,7 +467,6 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock, ...@@ -467,7 +467,6 @@ void AES::decrypt(const byte* inBlock, const byte* xorBlock,
"movd mm4, eax;" \ "movd mm4, eax;" \
"mov ebp, edx;" \ "mov ebp, edx;" \
"sub esp, 4;" "sub esp, 4;"
#define EPILOG() \ #define EPILOG() \
"add esp, 4;" \ "add esp, 4;" \
"pop ebp;" \ "pop ebp;" \
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x, ...@@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
struct WindowSlider struct WindowSlider
{ {
WindowSlider(const Integer &expIn, bool fastNegateIn, WindowSlider(const Integer &exp, bool fastNegate,
unsigned int windowSizeIn=0) unsigned int windowSizeIn=0)
: exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn), : exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn),
windowBegin(0), fastNegate(fastNegateIn), firstTime(true), windowBegin(0), fastNegate(fastNegate), firstTime(true),
finished(false) finished(false)
{ {
if (windowSize == 0) if (windowSize == 0)
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -121,7 +121,6 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length) ...@@ -121,7 +121,6 @@ void ARC4::AsmProcess(byte* out, const byte* in, word32 length)
"push ebx;" \ "push ebx;" \
"push ebp;" \ "push ebp;" \
"mov ebp, eax;" "mov ebp, eax;"
#define EPILOG() \ #define EPILOG() \
"pop ebp;" \ "pop ebp;" \
"pop ebx;" \ "pop ebx;" \
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -832,11 +831,9 @@ void CertDecoder::GetName(NameType nt) ...@@ -832,11 +831,9 @@ void CertDecoder::GetName(NameType nt)
if (source_.IsLeft(length) == false) return; if (source_.IsLeft(length) == false) return;
if (email) { if (email) {
if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length))) { if (!(ptr = AddTag(ptr, buf_end, "/emailAddress=", 14, length)))
source_.SetError(CONTENT_E);
return; return;
} }
}
source_.advance(length); source_.advance(length);
} }
...@@ -972,12 +969,26 @@ bool CertDecoder::ConfirmSignature(Source& pub) ...@@ -972,12 +969,26 @@ bool CertDecoder::ConfirmSignature(Source& pub)
hasher.reset(NEW_TC SHA); hasher.reset(NEW_TC SHA);
ht = SHAh; ht = SHAh;
} }
else if (signatureOID_ == SHA256wRSA || signatureOID_ == SHA256wDSA) {
hasher.reset(NEW_TC SHA256);
ht = SHA256h;
}
#ifdef WORD64_AVAILABLE
else if (signatureOID_ == SHA384wRSA) {
hasher.reset(NEW_TC SHA384);
ht = SHA384h;
}
else if (signatureOID_ == SHA512wRSA) {
hasher.reset(NEW_TC SHA512);
ht = SHA512h;
}
#endif
else { else {
source_.SetError(UNKOWN_SIG_E); source_.SetError(UNKOWN_SIG_E);
return false; return false;
} }
byte digest[SHA::DIGEST_SIZE]; // largest size byte digest[MAX_SHA2_DIGEST_SIZE]; // largest size
hasher->Update(source_.get_buffer() + certBegin_, sigIndex_ - certBegin_); hasher->Update(source_.get_buffer() + certBegin_, sigIndex_ - certBegin_);
hasher->Final(digest); hasher->Final(digest);
...@@ -1050,6 +1061,12 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) ...@@ -1050,6 +1061,12 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output)
0x02, 0x05, 0x05, 0x00 }; 0x02, 0x05, 0x05, 0x00 };
static const byte md2AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, static const byte md2AlgoID[] = { 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
0x02, 0x02, 0x05, 0x00}; 0x02, 0x02, 0x05, 0x00};
static const byte sha256AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
0x04, 0x02, 0x01, 0x05, 0x00 };
static const byte sha384AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
0x04, 0x02, 0x02, 0x05, 0x00 };
static const byte sha512AlgoID[] = { 0x60, 0x86, 0x48, 0x01, 0x65, 0x03,
0x04, 0x02, 0x03, 0x05, 0x00 };
int algoSz = 0; int algoSz = 0;
const byte* algoName = 0; const byte* algoName = 0;
...@@ -1060,6 +1077,21 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output) ...@@ -1060,6 +1077,21 @@ word32 DER_Encoder::SetAlgoID(HashType aOID, byte* output)
algoName = shaAlgoID; algoName = shaAlgoID;
break; break;
case SHA256h:
algoSz = sizeof(sha256AlgoID);
algoName = sha256AlgoID;
break;
case SHA384h:
algoSz = sizeof(sha384AlgoID);
algoName = sha384AlgoID;
break;
case SHA512h:
algoSz = sizeof(sha512AlgoID);
algoName = sha512AlgoID;
break;
case MD2h: case MD2h:
algoSz = sizeof(md2AlgoID); algoSz = sizeof(md2AlgoID);
algoName = md2AlgoID; algoName = md2AlgoID;
......
/* /*
Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* /*
Copyright (C) 2000-2007 MySQL AB Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
/* #pragma message("You do not seem to have the Visual C++ Processor Pack ") /* #pragma message("You do not seem to have the Visual C++ Processor Pack ")
#pragma message("installed, so use of SSE2 intrinsics will be disabled.") #pragma message("installed, so use of SSE2 intrinsics will be disabled.")
*/ */
#pragma message("installed, so use of SSE2 intrinsics will be disabled.")
#elif defined(__GNUC__) && defined(__i386__) #elif defined(__GNUC__) && defined(__i386__)
/* #warning You do not have GCC 3.3 or later, or did not specify the -msse2 \ /* #warning You do not have GCC 3.3 or later, or did not specify the -msse2 \
compiler option. Use of SSE2 intrinsics will be disabled. compiler option. Use of SSE2 intrinsics will be disabled.
...@@ -282,7 +281,12 @@ DWord() {} ...@@ -282,7 +281,12 @@ DWord() {}
word GetHighHalfAsBorrow() const {return 0-halfs_.high;} word GetHighHalfAsBorrow() const {return 0-halfs_.high;}
private: private:
struct dword_struct union
{
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
dword whole_;
#endif
struct
{ {
#ifdef LITTLE_ENDIAN_ORDER #ifdef LITTLE_ENDIAN_ORDER
word low; word low;
...@@ -291,14 +295,7 @@ DWord() {} ...@@ -291,14 +295,7 @@ DWord() {}
word high; word high;
word low; word low;
#endif #endif
}; } halfs_;
union
{
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
dword whole_;
#endif
struct dword_struct halfs_;
}; };
}; };
...@@ -1201,24 +1198,20 @@ class LowLevel : public PentiumOptimized ...@@ -1201,24 +1198,20 @@ class LowLevel : public PentiumOptimized
#define AS1(x) #x ";" #define AS1(x) #x ";"
#define AS2(x, y) #x ", " #y ";" #define AS2(x, y) #x ", " #y ";"
#define AddPrologue \ #define AddPrologue \
word res; \
__asm__ __volatile__ \ __asm__ __volatile__ \
( \ ( \
"push %%ebx;" /* save this manually, in case of -fPIC */ \ "push %%ebx;" /* save this manually, in case of -fPIC */ \
"mov %3, %%ebx;" \ "mov %2, %%ebx;" \
".intel_syntax noprefix;" \ ".intel_syntax noprefix;" \
"push ebp;" "push ebp;"
#define AddEpilogue \ #define AddEpilogue \
"pop ebp;" \ "pop ebp;" \
".att_syntax prefix;" \ ".att_syntax prefix;" \
"pop %%ebx;" \ "pop %%ebx;" \
"mov %%eax, %0;" \ : \
: "=g" (res) \
: "c" (C), "d" (A), "m" (B), "S" (N) \ : "c" (C), "d" (A), "m" (B), "S" (N) \
: "%edi", "memory", "cc" \ : "%edi", "memory", "cc" \
); \ );
return res;
#define MulPrologue \ #define MulPrologue \
__asm__ __volatile__ \ __asm__ __volatile__ \
( \ ( \
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -84,17 +84,7 @@ namespace STL = STL_NAMESPACE; ...@@ -84,17 +84,7 @@ namespace STL = STL_NAMESPACE;
} }
#ifdef __sun #if defined(__ICC) || defined(__INTEL_COMPILER)
// Handler for pure virtual functions
namespace __Crun {
void pure_error() {
}
}
#endif
#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2)
extern "C" { extern "C" {
...@@ -175,6 +165,14 @@ word Crop(word value, unsigned int size) ...@@ -175,6 +165,14 @@ word Crop(word value, unsigned int size)
#ifdef TAOCRYPT_X86ASM_AVAILABLE #ifdef TAOCRYPT_X86ASM_AVAILABLE
#ifndef _MSC_VER
static jmp_buf s_env;
static void SigIllHandler(int)
{
longjmp(s_env, 1);
}
#endif
bool HaveCpuId() bool HaveCpuId()
{ {
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* /*
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <time.h> #include <time.h>
#if defined(_WIN32) #if defined(_WIN32)
#define _WIN32_WINNT 0x0400
#include <windows.h> #include <windows.h>
#include <wincrypt.h> #include <wincrypt.h>
#else #else
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -507,6 +507,8 @@ void RIPEMD160::Transform() ...@@ -507,6 +507,8 @@ void RIPEMD160::Transform()
#ifdef _MSC_VER #ifdef _MSC_VER
__declspec(naked) __declspec(naked)
#else
__attribute__ ((noinline))
#endif #endif
void RIPEMD160::AsmTransform(const byte* data, word32 times) void RIPEMD160::AsmTransform(const byte* data, word32 times)
{ {
...@@ -520,7 +522,6 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times) ...@@ -520,7 +522,6 @@ void RIPEMD160::AsmTransform(const byte* data, word32 times)
".intel_syntax noprefix;" \ ".intel_syntax noprefix;" \
"push ebx;" \ "push ebx;" \
"push ebp;" "push ebp;"
#define EPILOG() \ #define EPILOG() \
"pop ebp;" \ "pop ebp;" \
"pop ebx;" \ "pop ebx;" \
......
/* /*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -776,7 +776,6 @@ void SHA::AsmTransform(const byte* data, word32 times) ...@@ -776,7 +776,6 @@ void SHA::AsmTransform(const byte* data, word32 times)
".intel_syntax noprefix;" \ ".intel_syntax noprefix;" \
"push ebx;" \ "push ebx;" \
"push ebp;" "push ebp;"
#define EPILOG() \ #define EPILOG() \
"pop ebp;" \ "pop ebp;" \
"pop ebx;" \ "pop ebx;" \
......
/* /*
Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -285,7 +285,6 @@ void Twofish::decrypt(const byte* inBlock, const byte* xorBlock, ...@@ -285,7 +285,6 @@ void Twofish::decrypt(const byte* inBlock, const byte* xorBlock,
"push ebp;" \ "push ebp;" \
"movd mm3, eax;" \ "movd mm3, eax;" \
"movd mm6, ebp;" "movd mm6, ebp;"
#define EPILOG() \ #define EPILOG() \
"pop ebp;" \ "pop ebp;" \
"pop ebx;" \ "pop ebx;" \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment