Latest update.
This commit is contained in:
@@ -1853,4 +1853,4 @@ foreach (split("\n",$code)) {
|
||||
|
||||
print $_,"\n";
|
||||
}
|
||||
close STDOUT; # enforce flush
|
||||
close STDOUT or die "error closing STDOUT"; # enforce flush
|
||||
@@ -1874,4 +1874,4 @@ foreach (split("\n",$code)) {
|
||||
|
||||
print $_,"\n";
|
||||
}
|
||||
close STDOUT; # enforce flush
|
||||
close STDOUT or die "error closing STDOUT"; # enforce flush
|
||||
@@ -2079,4 +2079,4 @@ foreach (split("\n",$code)) {
|
||||
print $_,"\n";
|
||||
}
|
||||
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -2382,4 +2382,4 @@ foreach (split("\n",$code)) {
|
||||
|
||||
print $_,"\n";
|
||||
}
|
||||
close STDOUT; # enforce flush
|
||||
close STDOUT or die "error closing STDOUT"; # enforce flush
|
||||
@@ -3056,4 +3056,4 @@ foreach (split("\n",$code)) {
|
||||
print $_,"\n";
|
||||
}
|
||||
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -1858,4 +1858,4 @@ for ($i=0;$i<7;$i++) {
|
||||
|
||||
&asm_finish();
|
||||
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -4738,4 +4738,4 @@ ___
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval $1/gem;
|
||||
print $code;
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -824,4 +824,4 @@ ___
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval $1/gem;
|
||||
print $code;
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -1130,4 +1130,4 @@ ___
|
||||
|
||||
$code =~ s/\`([^\`]*)\`/eval $1/gem;
|
||||
print $code;
|
||||
close STDOUT;
|
||||
close STDOUT or die "error closing STDOUT";
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "ec_local.h"
|
||||
#include <openssl/evp.h>
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "ec_local.h"
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "crypto/bn.h"
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDH and ECDSA low level APIs are deprecated for public use, but still ok
|
||||
* for internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/x509.h>
|
||||
@@ -507,9 +513,9 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
|
||||
if (EVP_PKEY_id(pkey) == EVP_PKEY_SM2) {
|
||||
/* For SM2, the only valid digest-alg is SM3 */
|
||||
*(int *)arg2 = NID_sm3;
|
||||
} else {
|
||||
*(int *)arg2 = NID_sha256;
|
||||
return 2; /* Make it mandatory */
|
||||
}
|
||||
*(int *)arg2 = NID_sha256;
|
||||
return 1;
|
||||
|
||||
case ASN1_PKEY_CTRL_SET1_TLS_ENCPT:
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "ec_local.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "ec_local.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include "ec_local.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include "crypto/bn.h"
|
||||
#include "ec_local.h"
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include "internal/cryptlib.h"
|
||||
#include <string.h>
|
||||
#include "ec_local.h"
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDH and ECDSA low level APIs are deprecated for public use, but still ok
|
||||
* for internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/engine.h>
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDH and ECDSA low level APIs are deprecated for public use, but still ok
|
||||
* for internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/asn1t.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/err.h>
|
||||
#include "ec_local.h"
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDH low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <openssl/core_names.h>
|
||||
#include <openssl/ec.h>
|
||||
@@ -28,8 +34,7 @@ int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
|
||||
|
||||
if ((kctx = EVP_KDF_CTX_new(kdf)) != NULL) {
|
||||
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
|
||||
(char *)mdname,
|
||||
strlen(mdname) + 1);
|
||||
(char *)mdname, 0);
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_KEY,
|
||||
(void *)Z, Zlen);
|
||||
*p++ = OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_INFO,
|
||||
|
||||
+27
-1
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDH low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
||||
@@ -31,9 +37,14 @@ int ossl_ecdh_compute_key(unsigned char **psec, size_t *pseclen,
|
||||
}
|
||||
|
||||
/*-
|
||||
* This implementation is based on the following primitives in the IEEE 1363 standard:
|
||||
* This implementation is based on the following primitives in the
|
||||
* IEEE 1363 standard:
|
||||
* - ECKAS-DH1
|
||||
* - ECSVDP-DH
|
||||
*
|
||||
* It also conforms to SP800-56A r3
|
||||
* See Section 5.7.1.2 "Elliptic Curve Cryptography Cofactor Diffie-Hellman
|
||||
* (ECC CDH) Primitive:". The steps listed below refer to SP800-56A.
|
||||
*/
|
||||
int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
|
||||
const EC_POINT *pub_key, const EC_KEY *ecdh)
|
||||
@@ -64,6 +75,10 @@ int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
|
||||
|
||||
group = EC_KEY_get0_group(ecdh);
|
||||
|
||||
/*
|
||||
* Step(1) - Compute the point tmp = cofactor * owners_private_key
|
||||
* * peer_public_key.
|
||||
*/
|
||||
if (EC_KEY_get_flags(ecdh) & EC_FLAG_COFACTOR_ECDH) {
|
||||
if (!EC_GROUP_get_cofactor(group, x, NULL) ||
|
||||
!BN_mul(x, x, priv_key, ctx)) {
|
||||
@@ -83,11 +98,20 @@ int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Step(2) : If point tmp is at infinity then clear intermediate values and
|
||||
* exit. Note: getting affine coordinates returns 0 if point is at infinity.
|
||||
* Step(3a) : Get x-coordinate of point x = tmp.x
|
||||
*/
|
||||
if (!EC_POINT_get_affine_coordinates(group, tmp, x, NULL, ctx)) {
|
||||
ECerr(EC_F_ECDH_SIMPLE_COMPUTE_KEY, EC_R_POINT_ARITHMETIC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Step(3b) : convert x to a byte string, using the field-element-to-byte
|
||||
* string conversion routine defined in Appendix C.2
|
||||
*/
|
||||
buflen = (EC_GROUP_get_degree(group) + 7) / 8;
|
||||
len = BN_num_bytes(x);
|
||||
if (len > buflen) {
|
||||
@@ -112,6 +136,8 @@ int ecdh_simple_compute_key(unsigned char **pout, size_t *poutlen,
|
||||
ret = 1;
|
||||
|
||||
err:
|
||||
/* Step(4) : Destroy all intermediate calculations */
|
||||
BN_clear(x);
|
||||
EC_POINT_clear_free(tmp);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/obj_mac.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/ec.h>
|
||||
#include "ec_local.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/ec.h>
|
||||
#include "ec_local.h"
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
#include "ec_local.h"
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <openssl/err.h>
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
/*
|
||||
* A 64-bit implementation of the NIST P-224 elliptic curve point multiplication
|
||||
*
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
/*
|
||||
* A 64-bit implementation of the NIST P-256 elliptic curve point multiplication
|
||||
*
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
/*
|
||||
* A 64-bit implementation of the NIST P-521 elliptic curve point multiplication
|
||||
*
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifdef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
NON_EMPTY_TRANSLATION_UNIT
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
* 256 Bit Primes"
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "internal/cryptlib.h"
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* ECDSA low level APIs are deprecated for public use, but still ok for
|
||||
* internal use.
|
||||
*/
|
||||
#include "internal/deprecated.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include "internal/cryptlib.h"
|
||||
#include <openssl/x509.h>
|
||||
|
||||
Reference in New Issue
Block a user