Add sm2 and otp command

try `gmssl sm2 -help` and `gmssl otp -help`
This commit is contained in:
Zhi Guan
2018-12-19 10:01:38 +08:00
parent 5bc22a1f3e
commit 74a729aa77
17 changed files with 376 additions and 5597 deletions

View File

@@ -11,7 +11,7 @@ IF[{- !$disabled{apps} -}]
s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c \ s_client.c s_server.c s_time.c sess_id.c smime.c speed.c spkac.c \
srp.c ts.c verify.c version.c x509.c rehash.c \ srp.c ts.c verify.c version.c x509.c rehash.c \
apps.c opt.c s_cb.c s_socket.c \ apps.c opt.c s_cb.c s_socket.c \
app_rand.c cpk.c sm9.c otp.c \ app_rand.c cpk.c sm2.c sm9.c otp.c \
{- $target{apps_aux_src} -} {- $target{apps_aux_src} -}
INCLUDE[gmssl]=.. ../include INCLUDE[gmssl]=.. ../include
DEPEND[gmssl]=../libssl DEPEND[gmssl]=../libssl

View File

@@ -1,5 +1,5 @@
/* ==================================================================== /* ====================================================================
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved. * Copyright (c) 2014 - 2018 The GmSSL Project. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -46,32 +46,129 @@
* OF THE POSSIBILITY OF SUCH DAMAGE. * OF THE POSSIBILITY OF SUCH DAMAGE.
* ==================================================================== * ====================================================================
*/ */
/*
* gmssl otp -genkey -seed data
*/
#include "apps.h" #include <openssl/opensslconf.h>
#ifdef OPENSSL_NO_OTP
NON_EMPTY_TRANSLATION_UNIT
#else
#include <ctype.h> # include <ctype.h>
#include <stdio.h> # include <stdio.h>
#include <string.h> # include <string.h>
#include <openssl/bio.h> # include <openssl/bio.h>
#include <openssl/err.h> # include <openssl/err.h>
#include <openssl/evp.h> # include <openssl/evp.h>
#include <openssl/otp.h> # include <openssl/otp.h>
# include "apps.h"
typedef enum OPTION_choice { typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP, OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
OPT_SETUP, OPT_GENKEY OPT_IN, OPT_OUT, OPT_SETUP, OPT_GENKEY
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS otp_options[] = { OPTIONS otp_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Input seed file - default stdin"},
{"out", OPT_OUT, '>', "Output seed file - default stdout"},
{"setup", OPT_SETUP, '-', "Generate seed"},
{"genkey", OPT_GENKEY, '-', "Generate one-time password"},
{NULL} {NULL}
}; };
int otp_main(int argc, char **argv) int otp_main(int argc, char **argv)
{ {
printf("otp not implemented\n"); int ret = 1;
return 0; BIO *bio = NULL;
char *infile = NULL, *outfile = NULL, *prog;
OPTION_CHOICE o;
int setup = 0, genkey = 0;
unsigned char key[32];
prog = opt_init(argc, argv, otp_options);
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
case OPT_EOF:
case OPT_ERR:
opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
opt_help(otp_options);
ret = 0;
goto end;
case OPT_IN:
infile = opt_arg();
break;
case OPT_OUT:
outfile = opt_arg();
break;
case OPT_SETUP:
setup = 1;
break;
case OPT_GENKEY:
genkey = 1;
break;
}
}
argc = opt_num_rest();
if (argc != 0)
goto opthelp;
if (!(setup ^ genkey))
goto opthelp;
if (setup) {
unsigned char key[32];
if (!RAND_bytes(key, sizeof(key))) {
ERR_print_errors_fp(stderr);
goto end;
}
bio = bio_open_default(outfile, 'w', FORMAT_BINARY);
if (!bio)
goto end;
if (BIO_write(bio, key, sizeof(key)) != sizeof(key)) {
goto end;
}
printf("generate OTP seed in '%s'\n", outfile);
} else if (genkey) {
OTP_PARAMS params;
unsigned char event[] = "gmssl otp event default";
unsigned int otp;
params.type = NID_sm3;
params.te = 1;
params.option = NULL;
params.option_size = 0;
params.otp_digits = 6;
bio = bio_open_default(infile, 'r', FORMAT_BINARY);
if (!bio)
goto end;
if (BIO_read(bio, key, sizeof(key)) != sizeof(key)) {
ERR_print_errors_fp(stderr);
goto end;
}
if (!OTP_generate(&params, event, sizeof(event), &otp, key, sizeof(key))) {
ERR_print_errors_fp(stderr);
goto end;
}
printf("%06u\n", otp);
ret = 0;
}
end:
BIO_free(bio);
OPENSSL_cleanse(key, sizeof(key));
return ret;
} }
#endif

View File

@@ -66,6 +66,7 @@ extern int s_client_main(int argc, char *argv[]);
extern int s_server_main(int argc, char *argv[]); extern int s_server_main(int argc, char *argv[]);
extern int s_time_main(int argc, char *argv[]); extern int s_time_main(int argc, char *argv[]);
extern int sess_id_main(int argc, char *argv[]); extern int sess_id_main(int argc, char *argv[]);
extern int sm2_main(int argc, char *argv[]);
extern int sm9_main(int argc, char *argv[]); extern int sm9_main(int argc, char *argv[]);
extern int smime_main(int argc, char *argv[]); extern int smime_main(int argc, char *argv[]);
extern int speed_main(int argc, char *argv[]); extern int speed_main(int argc, char *argv[]);
@@ -118,6 +119,7 @@ extern OPTIONS s_client_options[];
extern OPTIONS s_server_options[]; extern OPTIONS s_server_options[];
extern OPTIONS s_time_options[]; extern OPTIONS s_time_options[];
extern OPTIONS sess_id_options[]; extern OPTIONS sess_id_options[];
extern OPTIONS sm2_options[];
extern OPTIONS sm9_options[]; extern OPTIONS sm9_options[];
extern OPTIONS smime_options[]; extern OPTIONS smime_options[];
extern OPTIONS speed_options[]; extern OPTIONS speed_options[];
@@ -214,6 +216,9 @@ static FUNCTION functions[] = {
{ FT_general, "s_time", s_time_main, s_time_options }, { FT_general, "s_time", s_time_main, s_time_options },
#endif #endif
{ FT_general, "sess_id", sess_id_main, sess_id_options }, { FT_general, "sess_id", sess_id_main, sess_id_options },
#ifndef OPENSSL_NO_SM2
{ FT_general, "sm2", sm2_main, sm2_options },
#endif
#ifndef OPENSSL_NO_SM9 #ifndef OPENSSL_NO_SM9
{ FT_general, "sm9", sm9_main, sm9_options }, { FT_general, "sm9", sm9_main, sm9_options },
#endif #endif

View File

@@ -1232,3 +1232,15 @@ int ECDSA_size(const EC_KEY *r)
ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE); ret = ASN1_object_size(1, i, V_ASN1_SEQUENCE);
return (ret); return (ret);
} }
#ifndef OPENSSL_NO_STDIO
ECDSA_SIG *d2i_ECDSA_SIG_fp(FILE *fp, ECDSA_SIG **a)
{
return ASN1_item_d2i_fp(ASN1_ITEM_rptr(ECDSA_SIG), fp, a);
}
int i2d_ECDSA_SIG_fp(FILE *fp, ECDSA_SIG *sig)
{
return ASN1_item_i2d_fp(ASN1_ITEM_rptr(ECDSA_SIG), fp, sig);
}
#endif

View File

@@ -3339,3 +3339,13 @@ int EC_curve_nist2nid(const char *name)
} }
return NID_undef; return NID_undef;
} }
#ifndef OPENSSL_NO_SM2
int EC_KEY_is_sm2p256v1(const EC_KEY *ec_key)
{
const EC_GROUP *group = EC_KEY_get0_group(ec_key);
if (group)
return EC_GROUP_get_curve_name(group) == NID_sm2p256v1;
return 0;
}
#endif

View File

@@ -205,6 +205,7 @@ static ERR_STRING_DATA EC_str_functs[] = {
"EC_POINT_set_Jprojective_coordinates_GFp"}, "EC_POINT_set_Jprojective_coordinates_GFp"},
{ERR_FUNC(EC_F_EC_POINT_SET_TO_INFINITY), "EC_POINT_set_to_infinity"}, {ERR_FUNC(EC_F_EC_POINT_SET_TO_INFINITY), "EC_POINT_set_to_infinity"},
{ERR_FUNC(EC_F_EC_PRE_COMP_NEW), "ec_pre_comp_new"}, {ERR_FUNC(EC_F_EC_PRE_COMP_NEW), "ec_pre_comp_new"},
{ERR_FUNC(EC_F_EC_SCHNORR_SIGN), "ec_schnorr_sign"},
{ERR_FUNC(EC_F_EC_TYPE1CURVE_TATE), "EC_type1curve_tate"}, {ERR_FUNC(EC_F_EC_TYPE1CURVE_TATE), "EC_type1curve_tate"},
{ERR_FUNC(EC_F_EC_WNAF_MUL), "ec_wNAF_mul"}, {ERR_FUNC(EC_F_EC_WNAF_MUL), "ec_wNAF_mul"},
{ERR_FUNC(EC_F_EC_WNAF_PRECOMPUTE_MULT), "ec_wNAF_precompute_mult"}, {ERR_FUNC(EC_F_EC_WNAF_PRECOMPUTE_MULT), "ec_wNAF_precompute_mult"},

View File

@@ -654,3 +654,7 @@ int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32],
const uint8_t peer_public_value[32]); const uint8_t peer_public_value[32]);
void X25519_public_from_private(uint8_t out_public_value[32], void X25519_public_from_private(uint8_t out_public_value[32],
const uint8_t private_key[32]); const uint8_t private_key[32]);
#ifndef OPENSSL_NO_SM2
int EC_KEY_is_sm2p256v1(const EC_KEY *ec_key);
#endif

View File

@@ -1,157 +0,0 @@
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. 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.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND 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 OpenSSL PROJECT OR
* ITS 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.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com). */
#include <openssl/ecdsa.h>
#include <limits.h>
#include <string.h>
#include <openssl/bn.h>
#include <openssl/bytestring.h>
#include <openssl/err.h>
#include <openssl/ec.h>
#include <openssl/mem.h>
#include "../bytestring/internal.h"
#include "../ec/ec_lcl.h"
#include "../internal.h"
ECDSA_SIG *ECDSA_SIG_parse(CBS *cbs) {
ECDSA_SIG *ret = ECDSA_SIG_new();
if (ret == NULL) {
return NULL;
}
CBS child;
if (!CBS_get_asn1(cbs, &child, CBS_ASN1_SEQUENCE) ||
!BN_parse_asn1_unsigned(&child, ret->r) ||
!BN_parse_asn1_unsigned(&child, ret->s) ||
CBS_len(&child) != 0) {
//OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE);
ECDSA_SIG_free(ret);
return NULL;
}
return ret;
}
ECDSA_SIG *ECDSA_SIG_from_bytes(const uint8_t *in, size_t in_len) {
CBS cbs;
CBS_init(&cbs, in, in_len);
ECDSA_SIG *ret = ECDSA_SIG_parse(&cbs);
if (ret == NULL || CBS_len(&cbs) != 0) {
//OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE);
ECDSA_SIG_free(ret);
return NULL;
}
return ret;
}
int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig) {
CBB child;
if (!CBB_add_asn1(cbb, &child, CBS_ASN1_SEQUENCE) ||
!BN_marshal_asn1(&child, sig->r) ||
!BN_marshal_asn1(&child, sig->s) ||
!CBB_flush(cbb)) {
//OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR);
return 0;
}
return 1;
}
int ECDSA_SIG_to_bytes(uint8_t **out_bytes, size_t *out_len,
const ECDSA_SIG *sig) {
CBB cbb;
CBB_zero(&cbb);
if (!CBB_init(&cbb, 0) ||
!ECDSA_SIG_marshal(&cbb, sig) ||
!CBB_finish(&cbb, out_bytes, out_len)) {
//OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_ENCODE_ERROR);
CBB_cleanup(&cbb);
return 0;
}
return 1;
}
/* der_len_len returns the number of bytes needed to represent a length of |len|
* in DER. */
static size_t der_len_len(size_t len) {
if (len < 0x80) {
return 1;
}
size_t ret = 1;
while (len > 0) {
ret++;
len >>= 8;
}
return ret;
}
size_t ECDSA_SIG_max_len(size_t order_len) {
/* Compute the maximum length of an |order_len| byte integer. Defensively
* assume that the leading 0x00 is included. */
size_t integer_len = 1 /* tag */ + der_len_len(order_len + 1) + 1 + order_len;
if (integer_len < order_len) {
return 0;
}
/* An ECDSA signature is two INTEGERs. */
size_t value_len = 2 * integer_len;
if (value_len < integer_len) {
return 0;
}
/* Add the header. */
size_t ret = 1 /* tag */ + der_len_len(value_len) + value_len;
if (ret < value_len) {
return 0;
}
return ret;
}

View File

@@ -55,6 +55,7 @@
#include <openssl/asn1t.h> #include <openssl/asn1t.h>
#include <openssl/objects.h> #include <openssl/objects.h>
#include <openssl/obj_mac.h> #include <openssl/obj_mac.h>
#include "../ec/ec_lcl.h"
#include "sm2_lcl.h" #include "sm2_lcl.h"
@@ -119,3 +120,15 @@ int SM2_ciphertext_size(const EC_KEY *ec_key, size_t inlen)
ret = ASN1_object_size(1, len, V_ASN1_SEQUENCE); ret = ASN1_object_size(1, len, V_ASN1_SEQUENCE);
return ret; return ret;
} }
#ifndef OPENSSL_NO_STDIO
SM2CiphertextValue *d2i_SM2CiphertextValue_fp(FILE *fp, SM2CiphertextValue **a)
{
return ASN1_item_d2i_fp(ASN1_ITEM_rptr(SM2CiphertextValue), fp, a);
}
int i2d_SM2CiphertextValue_fp(FILE *fp, SM2CiphertextValue *a)
{
return ASN1_item_i2d_fp(ASN1_ITEM_rptr(SM2CiphertextValue), fp, a);
}
#endif

View File

@@ -59,20 +59,25 @@
static const EC_KEY_METHOD gmssl_ec_key_method = { static const EC_KEY_METHOD gmssl_ec_key_method = {
"GmSSL EC_KEY method", "SM2 method", /* name */
EC_KEY_METHOD_SM2, EC_KEY_METHOD_SM2, /* flags */
0,0,0,0,0,0, NULL, /* init */
ossl_ec_key_gen, NULL, /* finish */
NULL, 0, /* copy */
SM2_sign_ex, 0, /* set_group */
SM2_sign_setup, 0, /* set_private */
SM2_do_sign_ex, 0, /* set_public */
SM2_verify, ossl_ec_key_gen, /* keygen */
SM2_do_verify, NULL, /* compute_key */
SM2_encrypt, SM2_sign_ex, /* sign */
NULL, SM2_sign_setup, /* sign_setup */
SM2_decrypt, SM2_do_sign_ex, /* sign_sig */
NULL, SM2_verify, /* verify */
SM2_do_verify, /* verify_sig */
SM2_encrypt, /* encrypt */
NULL, /* do_encrypt */
SM2_decrypt, /* decrypt */
NULL, /* do_decrypt */
}; };
const EC_KEY_METHOD *EC_KEY_GmSSL(void) const EC_KEY_METHOD *EC_KEY_GmSSL(void)

View File

@@ -52,7 +52,7 @@
#include <openssl/err.h> #include <openssl/err.h>
#include <openssl/sm9.h> #include <openssl/sm9.h>
#include "e_os.h" #include "../../e_os.h"
/* private key extract algorithms */ /* private key extract algorithms */
#define SM9_HID_SIGN 0x01 #define SM9_HID_SIGN 0x01

View File

@@ -1074,6 +1074,11 @@ int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
*/ */
ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
#ifndef OPENSSL_NO_STDIO
int i2d_ECDSA_SIG_fp(FILE *fp, ECDSA_SIG *a);
ECDSA_SIG *d2i_ECDSA_SIG_fp(FILE *fp, ECDSA_SIG **a);
#endif
/** Accessor for r and s fields of ECDSA_SIG /** Accessor for r and s fields of ECDSA_SIG
* \param sig pointer to ECDSA_SIG pointer * \param sig pointer to ECDSA_SIG pointer
* \param pr pointer to BIGNUM pointer for r (may be NULL) * \param pr pointer to BIGNUM pointer for r (may be NULL)
@@ -1515,6 +1520,7 @@ int ERR_load_EC_strings(void);
# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 240 # define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP 240
# define EC_F_EC_POINT_SET_TO_INFINITY 241 # define EC_F_EC_POINT_SET_TO_INFINITY 241
# define EC_F_EC_PRE_COMP_NEW 242 # define EC_F_EC_PRE_COMP_NEW 242
# define EC_F_EC_SCHNORR_SIGN 279
# define EC_F_EC_TYPE1CURVE_TATE 243 # define EC_F_EC_TYPE1CURVE_TATE 243
# define EC_F_EC_WNAF_MUL 244 # define EC_F_EC_WNAF_MUL 244
# define EC_F_EC_WNAF_PRECOMPUTE_MULT 245 # define EC_F_EC_WNAF_PRECOMPUTE_MULT 245

View File

@@ -41,9 +41,9 @@ extern "C" {
*/ */
# define OPENSSL_VERSION_NUMBER 0x1010004fL # define OPENSSL_VERSION_NUMBER 0x1010004fL
# ifdef OPENSSL_FIPS # ifdef OPENSSL_FIPS
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.2 - OpenSSL 1.1.0d-fips 6 Dec 2018" # define OPENSSL_VERSION_TEXT "GmSSL 2.4.2 - OpenSSL 1.1.0d-fips 19 Dec 2018"
# else # else
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.2 - OpenSSL 1.1.0d 6 Dec 2018" # define OPENSSL_VERSION_TEXT "GmSSL 2.4.2 - OpenSSL 1.1.0d 19 Dec 2018"
# endif # endif
/*- /*-

View File

@@ -109,6 +109,11 @@ int SM2_verify(int type, const unsigned char *dgst, int dgstlen,
typedef struct SM2CiphertextValue_st SM2CiphertextValue; typedef struct SM2CiphertextValue_st SM2CiphertextValue;
DECLARE_ASN1_FUNCTIONS(SM2CiphertextValue) DECLARE_ASN1_FUNCTIONS(SM2CiphertextValue)
#ifndef OPENSSL_NO_STDIO
SM2CiphertextValue *d2i_SM2CiphertextValue_fp(FILE *fp, SM2CiphertextValue **a);
int i2d_SM2CiphertextValue_fp(FILE *fp, SM2CiphertextValue *a);
#endif
int i2o_SM2CiphertextValue(const EC_GROUP *group, const SM2CiphertextValue *cv, int i2o_SM2CiphertextValue(const EC_GROUP *group, const SM2CiphertextValue *cv,
unsigned char **pout); unsigned char **pout);
SM2CiphertextValue *o2i_SM2CiphertextValue(const EC_GROUP *group, const EVP_MD *md, SM2CiphertextValue *o2i_SM2CiphertextValue(const EC_GROUP *group, const EVP_MD *md,
@@ -127,7 +132,6 @@ int SM2_decrypt(int type, const unsigned char *in, size_t inlen,
#define SM2_decrypt_with_recommended(in,inlen,out,outlen,ec_key) \ #define SM2_decrypt_with_recommended(in,inlen,out,outlen,ec_key) \
SM2_decrypt(NID_sm3,in,inlen,out,outlen,ec_key) SM2_decrypt(NID_sm3,in,inlen,out,outlen,ec_key)
/* SM2 Key Exchange */ /* SM2 Key Exchange */
int SM2_compute_share_key(unsigned char *out, size_t *outlen, int SM2_compute_share_key(unsigned char *out, size_t *outlen,

View File

@@ -62,8 +62,95 @@ int main(int argc, char **argv)
# include <openssl/evp.h> # include <openssl/evp.h>
# include <openssl/err.h> # include <openssl/err.h>
# include <openssl/sm9.h> # include <openssl/sm9.h>
# include <openssl/rand.h>
# include "../crypto/sm9/sm9_lcl.h"
static int sm9test_sign(const char *id, const unsigned char *msg, size_t msglen) RAND_METHOD fake_rand;
const RAND_METHOD *old_rand;
static const char rnd_seed[] =
"string to make the random number generator think it has entropy";
static const char *rnd_number = NULL;
static int fbytes(unsigned char *buf, int num)
{
int ret = 0;
BIGNUM *bn = NULL;
if (!BN_hex2bn(&bn, rnd_number)) {
goto end;
}
if (BN_num_bytes(bn) > num) {
goto end;
}
memset(buf, 0, num);
if (!BN_bn2bin(bn, buf + num - BN_num_bytes(bn))) {
goto end;
}
ret = 1;
end:
BN_free(bn);
return ret;
}
static int change_rand(const char *hex)
{
if (!(old_rand = RAND_get_rand_method())) {
return 0;
}
fake_rand.seed = old_rand->seed;
fake_rand.cleanup = old_rand->cleanup;
fake_rand.add = old_rand->add;
fake_rand.status = old_rand->status;
fake_rand.bytes = fbytes;
fake_rand.pseudorand = old_rand->bytes;
if (!RAND_set_rand_method(&fake_rand)) {
return 0;
}
rnd_number = hex;
return 1;
}
static int restore_rand(void)
{
rnd_number = NULL;
if (!RAND_set_rand_method(old_rand))
return 0;
else return 1;
}
static int hexequbin(const char *hex, const unsigned char *bin, size_t binlen)
{
int ret = 0;
char *buf = NULL;
int i = 0;
size_t buflen = binlen * 2 + 1;
if (binlen * 2 != strlen(hex)) {
return 0;
}
if (!(buf = malloc(binlen * 2 + 1))) {
return 0;
}
for (i = 0; i < binlen; i++) {
sprintf(buf + i*2, "%02X", bin[i]);
}
buf[buflen - 1] = 0;
if (memcmp(hex, buf, binlen * 2) == 0) {
ret = 1;
}
free(buf);
return ret;
}
static int sm9test_sign(const char *id, const unsigned char *msg, size_t msglen,
int use_test_vector)
{ {
int ret = 0; int ret = 0;
SM9PublicParameters *mpk = NULL; SM9PublicParameters *mpk = NULL;
@@ -71,19 +158,114 @@ static int sm9test_sign(const char *id, const unsigned char *msg, size_t msglen)
SM9PrivateKey *sk = NULL; SM9PrivateKey *sk = NULL;
unsigned char sig[256]; unsigned char sig[256];
size_t siglen = sizeof(sig); size_t siglen = sizeof(sig);
/* test vector */
char *ks = "0130E78459D78545CB54C587E02CF480CE0B66340F319F348A1D5B1F2DC5F4";
char *Ppubs = "04"
"9F64080B3084F733E48AFF4B41B565011CE0711C5E392CFB0AB1B6791B94C408"
"29DBA116152D1F786CE843ED24A3B573414D2177386A92DD8F14D65696EA5E32"
"69850938ABEA0112B57329F447E3A0CBAD3E2FDB1A77F335E89E1408D0EF1C25"
"41E00A53DDA532DA1A7CE027B7A46F741006E85F5CDFF0730E75C05FB4E3216D";
char *ID_A = "Alice";
char *dsA = "04"
"A5702F05CF1315305E2D6EB64B0DEB923DB1A0BCF0CAFF90523AC8754AA69820"
"78559A844411F9825C109F5EE3F52D720DD01785392A727BB1556952B2B013D3";
char *M = "Chinese IBS standard";
char *r = "033C8616B06704813203DFD00965022ED15975C662337AED648835DC4B1CBE";
char *h = "823C4B21E4BD2DFE1ED92C606653E996668563152FC33F55D7BFBB9BD9705ADB";
char *S = "04"
"73BF96923CE58B6AD0E13E9643A406D8EB98417C50EF1B29CEF9ADB48B6D598C"
"856712F1C2E0968AB7769F42A99586AED139D5B8B3E15891827CC2ACED9BAA05";
char *S_comp = "03"
"73BF96923CE58B6AD0E13E9643A406D8EB98417C50EF1B29CEF9ADB48B6D598C";
if (use_test_vector) {
id = ID_A;
msg = (unsigned char *)M;
msglen = strlen(M);
/* generate master secret with test vector */
change_rand(ks);
}
if (!SM9_setup(NID_sm9bn256v1, NID_sm9sign, NID_sm9hash1_with_sm3, &mpk, &msk)) { if (!SM9_setup(NID_sm9bn256v1, NID_sm9sign, NID_sm9hash1_with_sm3, &mpk, &msk)) {
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
goto end; goto end;
} }
/* check msk->masterSecret == ks, msk->publicPpub == Ppubs */
if (use_test_vector) {
BIGNUM *masterSecret = NULL;
if (!BN_hex2bn(&masterSecret, ks)) {
ERR_print_errors_fp(stderr);
goto end;
}
if (BN_cmp(masterSecret, msk->masterSecret) != 0) {
fprintf(stderr, "%s %d: masterSecret failed\n", __FILE__, __LINE__);
goto end;
}
if (!hexequbin(Ppubs, ASN1_STRING_get0_data(msk->pointPpub),
ASN1_STRING_length(msk->pointPpub))) {
fprintf(stderr, "%s %d: publicPoint failed\n", __FILE__, __LINE__);
goto end;
}
}
/* generate private key */
if (!(sk = SM9_extract_private_key(msk, id, strlen(id)))) { if (!(sk = SM9_extract_private_key(msk, id, strlen(id)))) {
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
goto end; goto end;
} }
if (use_test_vector) {
/* check sk->privatePoint == dsA */
if (!hexequbin(dsA, ASN1_STRING_get0_data(sk->privatePoint),
ASN1_STRING_length(sk->privatePoint))) {
fprintf(stderr, "%s %d: dsA for '%s' failed\n", __FILE__, __LINE__, id);
goto end;
}
/* sign with test vector */
change_rand(r);
}
if (!SM9_sign(NID_sm3, msg, msglen, sig, &siglen, sk)) { if (!SM9_sign(NID_sm3, msg, msglen, sig, &siglen, sk)) {
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
goto end; goto end;
} }
if (use_test_vector) {
const unsigned char *p = sig;
SM9Signature *sig = NULL;
BIGNUM *bn = NULL;
int err = 0;
if (!(sig = d2i_SM9Signature(NULL, &p, siglen))) {
ERR_print_errors_fp(stderr);
goto end;
}
if (!BN_hex2bn(&bn, h)) {
SM9Signature_free(sig);
ERR_print_errors_fp(stderr);
goto end;
}
if (BN_cmp(bn, sig->h) != 0) {
fprintf(stderr, "%s %d: sig->h failed\n", __FILE__, __LINE__);
err++;
}
if (!hexequbin(S_comp, ASN1_STRING_get0_data(sig->pointS),
ASN1_STRING_length(sig->pointS))) {
fprintf(stderr, "%s %d: sig->S failed\n", __FILE__, __LINE__);
err++;
}
SM9Signature_free(sig);
BN_free(bn);
}
ret = SM9_verify(NID_sm3, msg, msglen, sig, siglen, mpk, id, strlen(id)); ret = SM9_verify(NID_sm3, msg, msglen, sig, siglen, mpk, id, strlen(id));
if (ret < 0) { if (ret < 0) {
ERR_print_errors_fp(stderr); ERR_print_errors_fp(stderr);
@@ -228,8 +410,9 @@ int main(int argc, char **argv)
int err = 0; int err = 0;
char *id = "guanzhi1980@gmail.com"; char *id = "guanzhi1980@gmail.com";
unsigned char in[] = "message to be signed or encrypted"; unsigned char in[] = "message to be signed or encrypted";
int use_test_vector = 1;
if (!sm9test_sign(id, in, sizeof(in)-1)) { if (!sm9test_sign(id, in, sizeof(in)-1, use_test_vector)) {
printf("sm9 sign tests failed\n"); printf("sm9 sign tests failed\n");
err++; err++;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -1,411 +0,0 @@
SSL_get0_next_proto_negotiated 1 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
SSL_SESSION_free 2 1_1_0d EXIST::FUNCTION:
BIO_new_buffer_ssl_connect 3 1_1_0d EXIST::FUNCTION:
SSL_get0_dane 4 1_1_0d EXIST::FUNCTION:
SSL_set_ex_data 5 1_1_0d EXIST::FUNCTION:
SSL_get0_dane_authority 6 1_1_0d EXIST::FUNCTION:
SSL_rstate_string 7 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_security_level 8 1_1_0d EXIST::FUNCTION:
SSL_CTX_up_ref 9 1_1_0d EXIST::FUNCTION:
SSL_use_certificate_ASN1 10 1_1_0d EXIST::FUNCTION:
SSL_get_peer_cert_chain 11 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_id 12 1_1_0d EXIST::FUNCTION:
SSL_get_client_ciphers 13 1_1_0d EXIST::FUNCTION:
SSL_client_version 14 1_1_0d EXIST::FUNCTION:
SSL_set_read_ahead 15 1_1_0d EXIST::FUNCTION:
SSL_get_shared_ciphers 16 1_1_0d EXIST::FUNCTION:
SSL_get_finished 17 1_1_0d EXIST::FUNCTION:
SSL_alert_type_string_long 18 1_1_0d EXIST::FUNCTION:
SSL_CTX_dane_enable 19 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_ticket_lifetime_hint 20 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_ctlog_list_file 21 1_1_0d EXIST::FUNCTION:CT
SSL_SESSION_get_protocol_version 22 1_1_0d EXIST::FUNCTION:
SSL_shutdown 23 1_1_0d EXIST::FUNCTION:
SSL_CTX_check_private_key 24 1_1_0d EXIST::FUNCTION:
PEM_write_bio_SSL_SESSION 25 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_srp_verify_param_callback 26 1_1_0d EXIST::FUNCTION:SRP
DTLSv1_2_server_method 27 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
SSL_add_dir_cert_subjects_to_stack 28 1_1_0d EXIST::FUNCTION:
SSLv3_method 29 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
SSL_CTX_get_default_passwd_cb 30 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_alpn_select_cb 31 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_security_callback 32 1_1_0d EXIST::FUNCTION:
SSL_CTX_add_client_CA 33 1_1_0d EXIST::FUNCTION:
SSL_CTX_SRP_CTX_free 34 1_1_0d EXIST::FUNCTION:SRP
SSL_CTX_get_verify_callback 35 1_1_0d EXIST::FUNCTION:
SSL_copy_session_id 36 1_1_0d EXIST::FUNCTION:
SSL_CONF_cmd_argv 37 1_1_0d EXIST::FUNCTION:
SSL_CTX_load_verify_locations 38 1_1_0d EXIST::FUNCTION:
SSL_ct_is_enabled 39 1_1_0d EXIST::FUNCTION:CT
SSL_use_PrivateKey_file 40 1_1_0d EXIST::FUNCTION:
GMTLS_server_method 41 1_1_0d EXIST::FUNCTION:GMTLS
SSL_CTX_sess_get_remove_cb 42 1_1_0d EXIST::FUNCTION:
SSL_session_reused 43 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_cipher_list 44 1_1_0d EXIST::FUNCTION:
SSL_set_tlsext_use_srtp 45 1_1_0d EXIST::FUNCTION:SRTP
SSL_SESSION_set1_id_context 46 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_srp_username_callback 47 1_1_0d EXIST::FUNCTION:SRP
SSL_COMP_set0_compression_methods 48 1_1_0d EXIST::FUNCTION:
SSL_CTX_set0_security_ex_data 49 1_1_0d EXIST::FUNCTION:
SSL_is_init_finished 50 1_1_0d EXIST::FUNCTION:
SSL_CTX_add_client_custom_ext 51 1_1_0d EXIST::FUNCTION:
SSL_SESSION_print_fp 52 1_1_0d EXIST::FUNCTION:STDIO
SSL_CTX_set1_param 53 1_1_0d EXIST::FUNCTION:
SSL_get1_session 54 1_1_0d EXIST::FUNCTION:
SSL_callback_ctrl 55 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_PrivateKey 56 1_1_0d EXIST::FUNCTION:
SSL_state_string_long 57 1_1_0d EXIST::FUNCTION:
SSL_CTX_sess_set_remove_cb 58 1_1_0d EXIST::FUNCTION:
SSL_set_session 59 1_1_0d EXIST::FUNCTION:
SSL_want 60 1_1_0d EXIST::FUNCTION:
SSL_get_ex_data 61 1_1_0d EXIST::FUNCTION:
SSL_set_tmp_dh_callback 62 1_1_0d EXIST::FUNCTION:DH
SSL_get0_verified_chain 63 1_1_0d EXIST::FUNCTION:
SSL_get_shutdown 64 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_RSAPrivateKey_ASN1 65 1_1_0d EXIST::FUNCTION:RSA
SSL_use_certificate_file 66 1_1_0d EXIST::FUNCTION:
TLS_client_method 67 1_1_0d EXIST::FUNCTION:
SSL_SRP_CTX_free 68 1_1_0d EXIST::FUNCTION:SRP
SSL_get_client_CA_list 69 1_1_0d EXIST::FUNCTION:
DTLS_server_method 70 1_1_0d EXIST::FUNCTION:
TLSv1_2_client_method 71 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
SSL_SESSION_get0_hostname 72 1_1_0d EXIST::FUNCTION:
SSL_use_RSAPrivateKey 73 1_1_0d EXIST::FUNCTION:RSA
SSL_CIPHER_get_kx_nid 74 1_1_0d EXIST::FUNCTION:
PEM_read_bio_SSL_SESSION 75 1_1_0d EXIST::FUNCTION:
TLSv1_1_server_method 76 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
SSL_read 77 1_1_0d EXIST::FUNCTION:
SSL_get_default_passwd_cb 78 1_1_0d EXIST::FUNCTION:
SSL_use_PrivateKey 79 1_1_0d EXIST::FUNCTION:
SSL_waiting_for_async 80 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_ex_data 81 1_1_0d EXIST::FUNCTION:
BIO_ssl_shutdown 82 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_set1_prefix 83 1_1_0d EXIST::FUNCTION:
SSL_get_certificate 84 1_1_0d EXIST::FUNCTION:
SSL_get_servername 85 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_srp_password 86 1_1_0d EXIST::FUNCTION:SRP
SSL_dane_tlsa_add 87 1_1_0d EXIST::FUNCTION:
SSL_CTX_free 88 1_1_0d EXIST::FUNCTION:
DTLSv1_listen 89 1_1_0d EXIST::FUNCTION:SOCK
SSL_use_RSAPrivateKey_file 90 1_1_0d EXIST::FUNCTION:RSA
SSL_get_server_random 91 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_new 92 1_1_0d EXIST::FUNCTION:
SSL_get_fd 93 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_verify_mode 94 1_1_0d EXIST::FUNCTION:
SSL_get_client_random 95 1_1_0d EXIST::FUNCTION:
SSL_get_info_callback 96 1_1_0d EXIST::FUNCTION:
SSL_get_default_passwd_cb_userdata 97 1_1_0d EXIST::FUNCTION:
SSL_CTX_clear_options 98 1_1_0d EXIST::FUNCTION:
SSL_renegotiate_pending 99 1_1_0d EXIST::FUNCTION:
SSL_get0_security_ex_data 100 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_cookie_verify_cb 101 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_info_callback 102 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_client_cert_cb 103 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_quiet_shutdown 104 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_verify_depth 105 1_1_0d EXIST::FUNCTION:
SSL_add_file_cert_subjects_to_stack 106 1_1_0d EXIST::FUNCTION:
SSL_set_alpn_protos 107 1_1_0d EXIST::FUNCTION:
SSL_set_options 108 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_ct_validation_callback 109 1_1_0d EXIST::FUNCTION:CT
SSL_write 110 1_1_0d EXIST::FUNCTION:
SSL_get_servername_type 111 1_1_0d EXIST::FUNCTION:
SSL_get_ex_data_X509_STORE_CTX_idx 112 1_1_0d EXIST::FUNCTION:
TLSv1_1_method 113 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
BIO_f_ssl 114 1_1_0d EXIST::FUNCTION:
SSL_get_security_callback 115 1_1_0d EXIST::FUNCTION:
SSL_get_psk_identity 116 1_1_0d EXIST::FUNCTION:PSK
SSL_CTX_get_options 117 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_cert_store 118 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_finish 119 1_1_0d EXIST::FUNCTION:
SSL_set_connect_state 120 1_1_0d EXIST::FUNCTION:
SSL_set_security_callback 121 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_verify_file 122 1_1_0d EXIST::FUNCTION:
SSL_set_quiet_shutdown 123 1_1_0d EXIST::FUNCTION:
SSL_set_bio 124 1_1_0d EXIST::FUNCTION:
TLS_server_method 125 1_1_0d EXIST::FUNCTION:
SSL_set_default_passwd_cb_userdata 126 1_1_0d EXIST::FUNCTION:
GMTLS_client_method 127 1_1_0d EXIST::FUNCTION:GMTLS
TLSv1_2_method 128 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
i2d_SSL_SESSION 129 1_1_0d EXIST::FUNCTION:
SSL_CTX_dane_clear_flags 130 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_cert_verify_callback 131 1_1_0d EXIST::FUNCTION:
SSL_get_peer_finished 132 1_1_0d EXIST::FUNCTION:
SSL_set_accept_state 133 1_1_0d EXIST::FUNCTION:
SSL_CONF_cmd 134 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_PrivateKey_ASN1 135 1_1_0d EXIST::FUNCTION:
SSL_CTX_has_client_custom_ext 136 1_1_0d EXIST::FUNCTION:
SSL_CTX_add_server_custom_ext 137 1_1_0d EXIST::FUNCTION:
SSL_set_ct_validation_callback 138 1_1_0d EXIST::FUNCTION:CT
SSL_set_info_callback 139 1_1_0d EXIST::FUNCTION:
SSL_CTX_config 140 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_name 141 1_1_0d EXIST::FUNCTION:
GMTLS_method 142 1_1_0d EXIST::FUNCTION:GMTLS
SSL_CTX_set0_ctlog_store 143 1_1_0d EXIST::FUNCTION:CT
PEM_write_SSL_SESSION 144 1_1_0d EXIST::FUNCTION:STDIO
SSL_CIPHER_get_bits 145 1_1_0d EXIST::FUNCTION:
SSL_free 146 1_1_0d EXIST::FUNCTION:
SSL_CTX_enable_ct 147 1_1_0d EXIST::FUNCTION:CT
SSL_CTX_set_srp_strength 148 1_1_0d EXIST::FUNCTION:SRP
SSL_CTX_sess_set_get_cb 149 1_1_0d EXIST::FUNCTION:
SSL_CTX_callback_ctrl 150 1_1_0d EXIST::FUNCTION:
SSL_get_srp_userinfo 151 1_1_0d EXIST::FUNCTION:SRP
SSL_SESSION_set_timeout 152 1_1_0d EXIST::FUNCTION:
SSL_dane_set_flags 153 1_1_0d EXIST::FUNCTION:
SSL_get0_peername 154 1_1_0d EXIST::FUNCTION:
SSL_CTX_add_session 155 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_passwd_cb_userdata 156 1_1_0d EXIST::FUNCTION:
SSL_check_chain 157 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get0_peer 158 1_1_0d EXIST::FUNCTION:
SSL_dane_enable 159 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_auth_nid 160 1_1_0d EXIST::FUNCTION:
SSL_SESSION_up_ref 161 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_read_buffer_len 162 1_1_0d EXIST::FUNCTION:
SSL_renegotiate_abbreviated 163 1_1_0d EXIST::FUNCTION:
SSL_get_session 164 1_1_0d EXIST::FUNCTION:
SSL_get_selected_srtp_profile 165 1_1_0d EXIST::FUNCTION:SRTP
SSL_CTX_set_options 166 1_1_0d EXIST::FUNCTION:
SSL_in_init 167 1_1_0d EXIST::FUNCTION:
SSL_CTX_dane_mtype_set 168 1_1_0d EXIST::FUNCTION:
SSL_pending 169 1_1_0d EXIST::FUNCTION:
SSL_CTX_get0_certificate 170 1_1_0d EXIST::FUNCTION:
SSL_get_peer_certificate 171 1_1_0d EXIST::FUNCTION:
SSL_get_current_cipher 172 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_not_resumable_session_callback 173 1_1_0d EXIST::FUNCTION:
SSL_use_RSAPrivateKey_ASN1 174 1_1_0d EXIST::FUNCTION:RSA
SSL_CTX_set_tmp_dh_callback 175 1_1_0d EXIST::FUNCTION:DH
SSL_set_default_passwd_cb 176 1_1_0d EXIST::FUNCTION:
SSL_do_handshake 177 1_1_0d EXIST::FUNCTION:
SSLv3_client_method 178 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
SSL_CTX_get_quiet_shutdown 179 1_1_0d EXIST::FUNCTION:
SSL_get_privatekey 180 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_serverinfo_file 181 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_psk_identity_hint 182 1_1_0d EXIST::FUNCTION:PSK
TLSv1_2_server_method 183 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_2_METHOD
SSL_CTX_set_verify 184 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_ex_data 185 1_1_0d EXIST::FUNCTION:
SSL_alert_desc_string 186 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_certificate 187 1_1_0d EXIST::FUNCTION:
SSL_COMP_get_id 188 1_1_0d EXIST::FUNCTION:
SSL_set_SSL_CTX 189 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_standard_name 190 1_1_0d EXIST::FUNCTION:SSL_TRACE
DTLSv1_client_method 191 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
SSL_COMP_get_compression_methods 192 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_psk_client_callback 193 1_1_0d EXIST::FUNCTION:PSK
d2i_SSL_SESSION 194 1_1_0d EXIST::FUNCTION:
SSL_set0_rbio 195 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_srp_username 196 1_1_0d EXIST::FUNCTION:SRP
SSL_CTX_set_next_proto_select_cb 197 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
SSL_get_srp_N 198 1_1_0d EXIST::FUNCTION:SRP
DTLSv1_server_method 199 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
SSL_CTX_flush_sessions 200 1_1_0d EXIST::FUNCTION:
SSL_set_ssl_method 201 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_master_key 202 1_1_0d EXIST::FUNCTION:
SSL_use_PrivateKey_ASN1 203 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_RSAPrivateKey 204 1_1_0d EXIST::FUNCTION:RSA
SSL_alert_desc_string_long 205 1_1_0d EXIST::FUNCTION:
SSL_get_verify_callback 206 1_1_0d EXIST::FUNCTION:
SSL_set_generate_session_id 207 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_certificate_ASN1 208 1_1_0d EXIST::FUNCTION:
SSL_set_session_id_context 209 1_1_0d EXIST::FUNCTION:
SSL_SESSION_new 210 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_generate_session_id 211 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_ciphers 212 1_1_0d EXIST::FUNCTION:
SSL_has_matching_session_id 213 1_1_0d EXIST::FUNCTION:
SSL_set_client_CA_list 214 1_1_0d EXIST::FUNCTION:
SSL_SESSION_set1_id 215 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_default_passwd_cb_userdata 216 1_1_0d EXIST::FUNCTION:
SSL_use_certificate_chain_file 217 1_1_0d EXIST::FUNCTION:
SRP_Calc_A_param 218 1_1_0d EXIST::FUNCTION:SRP
SSL_SESSION_print 219 1_1_0d EXIST::FUNCTION:
SSL_CTX_ctrl 220 1_1_0d EXIST::FUNCTION:
SSL_set_not_resumable_session_callback 221 1_1_0d EXIST::FUNCTION:
DTLS_method 222 1_1_0d EXIST::FUNCTION:
SSL_trace 223 1_1_0d EXIST::FUNCTION:SSL_TRACE
SSL_dup 224 1_1_0d EXIST::FUNCTION:
SSL_set_hostflags 225 1_1_0d EXIST::FUNCTION:
SSL_has_pending 226 1_1_0d EXIST::FUNCTION:
SSL_get_ssl_method 227 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_time 228 1_1_0d EXIST::FUNCTION:
SSL_get0_alpn_selected 229 1_1_0d EXIST::FUNCTION:
SSL_set_debug 230 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0
SSL_CTX_use_certificate_chain_file 231 1_1_0d EXIST::FUNCTION:
SSL_get_sigalgs 232 1_1_0d EXIST::FUNCTION:
SSL_set_srp_server_param 233 1_1_0d EXIST::FUNCTION:SRP
SSL_CONF_CTX_set_ssl_ctx 234 1_1_0d EXIST::FUNCTION:
SSL_CTX_remove_session 235 1_1_0d EXIST::FUNCTION:
SSL_get_ciphers 236 1_1_0d EXIST::FUNCTION:
SSL_CTX_dane_set_flags 237 1_1_0d EXIST::FUNCTION:
SSL_extension_supported 238 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_client_cert_engine 239 1_1_0d EXIST::FUNCTION:ENGINE
SSL_CTX_set_cookie_generate_cb 240 1_1_0d EXIST::FUNCTION:
TLSv1_method 241 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
SSL_get_current_compression 242 1_1_0d EXIST::FUNCTION:
SSL_use_psk_identity_hint 243 1_1_0d EXIST::FUNCTION:PSK
SSL_add1_host 244 1_1_0d EXIST::FUNCTION:
DTLSv1_method 245 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_METHOD
SSL_state_string 246 1_1_0d EXIST::FUNCTION:
DTLSv1_2_client_method 247 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
SSL_set_session_secret_cb 248 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_id 249 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_info_callback 250 1_1_0d EXIST::FUNCTION:
SSL_get0_param 251 1_1_0d EXIST::FUNCTION:
SSL_CONF_cmd_value_type 252 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_client_CA_list 253 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_clear_flags 254 1_1_0d EXIST::FUNCTION:
SSL_set_srp_server_param_pw 255 1_1_0d EXIST::FUNCTION:SRP
SSL_add_ssl_module 256 1_1_0d EXIST::FUNCTION:
SSL_set_default_read_buffer_len 257 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_psk_server_callback 258 1_1_0d EXIST::FUNCTION:PSK
SSL_renegotiate 259 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_security_level 260 1_1_0d EXIST::FUNCTION:
SSL_set0_security_ex_data 261 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get0_id_context 262 1_1_0d EXIST::FUNCTION:
SSL_get0_dane_tlsa 263 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_verify_dir 264 1_1_0d EXIST::FUNCTION:
TLSv1_client_method 265 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
SSL_set0_wbio 266 1_1_0d EXIST::FUNCTION:
SSL_get_error 267 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_description 268 1_1_0d EXIST::FUNCTION:
SSL_SRP_CTX_init 269 1_1_0d EXIST::FUNCTION:SRP
SSL_get_srtp_profiles 270 1_1_0d EXIST::FUNCTION:SRTP
SSL_connect 271 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_timeout 272 1_1_0d EXIST::FUNCTION:
SSL_select_next_proto 273 1_1_0d EXIST::FUNCTION:
SSL_get_state 274 1_1_0d EXIST::FUNCTION:
SSL_get_read_ahead 275 1_1_0d EXIST::FUNCTION:
SSL_get_changed_async_fds 276 1_1_0d EXIST::FUNCTION:
SSL_set1_host 277 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_ex_data 278 1_1_0d EXIST::FUNCTION:
SSL_get_rfd 279 1_1_0d EXIST::FUNCTION:
SSL_get_SSL_CTX 280 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get0_ticket 281 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_free 282 1_1_0d EXIST::FUNCTION:
ERR_load_SSL_strings 283 1_1_0d EXIST::FUNCTION:
SSL_SESSION_print_keylog 284 1_1_0d EXIST::FUNCTION:
SSL_test_functions 285 1_1_0d EXIST::FUNCTION:UNIT_TEST
SSL_CTX_set_srp_client_pwd_callback 286 1_1_0d EXIST::FUNCTION:SRP
SSL_add_client_CA 287 1_1_0d EXIST::FUNCTION:
SSL_CTX_get0_ctlog_store 288 1_1_0d EXIST::FUNCTION:CT
SSL_srp_server_param_with_username 289 1_1_0d EXIST::FUNCTION:SRP
SSL_get_cipher_list 290 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_digest_nid 291 1_1_0d EXIST::FUNCTION:
SSL_get_security_level 292 1_1_0d EXIST::FUNCTION:
TLSv1_server_method 293 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_METHOD
SSL_CTX_set_security_callback 294 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_RSAPrivateKey_file 295 1_1_0d EXIST::FUNCTION:RSA
SSL_get1_supported_ciphers 296 1_1_0d EXIST::FUNCTION:
SSL_in_before 297 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_cert_cb 298 1_1_0d EXIST::FUNCTION:
SSL_set_psk_server_callback 299 1_1_0d EXIST::FUNCTION:PSK
SSL_get_default_timeout 300 1_1_0d EXIST::FUNCTION:
SSL_set_shutdown 301 1_1_0d EXIST::FUNCTION:
SSL_set_msg_callback 302 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_client_cert_cb 303 1_1_0d EXIST::FUNCTION:
SSL_dane_clear_flags 304 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_next_protos_advertised_cb 305 1_1_0d EXIST::FUNCTION:NEXTPROTONEG
SSL_CTX_set_tlsext_use_srtp 306 1_1_0d EXIST::FUNCTION:SRTP
SSL_set_verify 307 1_1_0d EXIST::FUNCTION:
SSL_get_all_async_fds 308 1_1_0d EXIST::FUNCTION:
DTLSv1_2_method 309 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,DTLS1_2_METHOD
SSL_CTX_sess_get_new_cb 310 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_ctlog_list_file 311 1_1_0d EXIST::FUNCTION:CT
SSL_CTX_set_alpn_protos 312 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_msg_callback 313 1_1_0d EXIST::FUNCTION:
SSL_load_client_CA_file 314 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_passwd_cb 315 1_1_0d EXIST::FUNCTION:
SSL_certs_clear 316 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_is_aead 317 1_1_0d EXIST::FUNCTION:
SSL_clear_options 318 1_1_0d EXIST::FUNCTION:
SSL_CTX_ct_is_enabled 319 1_1_0d EXIST::FUNCTION:CT
SSL_set_session_ticket_ext 320 1_1_0d EXIST::FUNCTION:
SSL_export_keying_material 321 1_1_0d EXIST::FUNCTION:
SSL_CTX_get_verify_depth 322 1_1_0d EXIST::FUNCTION:
SSL_set_verify_result 323 1_1_0d EXIST::FUNCTION:
SSL_up_ref 324 1_1_0d EXIST::FUNCTION:
BIO_new_ssl 325 1_1_0d EXIST::FUNCTION:
SSL_set_trust 326 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_purpose 327 1_1_0d EXIST::FUNCTION:
SSL_CTX_get0_privatekey 328 1_1_0d EXIST::FUNCTION:
SSL_get_current_expansion 329 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get0_cipher 330 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_timeout 331 1_1_0d EXIST::FUNCTION:
SSL_peek 332 1_1_0d EXIST::FUNCTION:
SSL_alert_type_string 333 1_1_0d EXIST::FUNCTION:
SSL_CTX_get0_security_ex_data 334 1_1_0d EXIST::FUNCTION:
SSLv3_server_method 335 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,SSL3_METHOD
BIO_ssl_copy_session_id 336 1_1_0d EXIST::FUNCTION:
SSL_set_rfd 337 1_1_0d EXIST::FUNCTION:SOCK
SSL_CTX_use_PrivateKey_file 338 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_version 339 1_1_0d EXIST::FUNCTION:
SSL_clear 340 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_ssl_version 341 1_1_0d EXIST::FUNCTION:
SSL_SESSION_set_ex_data 342 1_1_0d EXIST::FUNCTION:
SSL_set1_param 343 1_1_0d EXIST::FUNCTION:
OPENSSL_init_ssl 344 1_1_0d EXIST::FUNCTION:
SSL_is_dtls 345 1_1_0d EXIST::FUNCTION:
SSL_use_certificate 346 1_1_0d EXIST::FUNCTION:
SSL_set_cipher_list 347 1_1_0d EXIST::FUNCTION:
SSL_config 348 1_1_0d EXIST::FUNCTION:
SSL_is_gmtls 349 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_session_id_context 350 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_srp_cb_arg 351 1_1_0d EXIST::FUNCTION:SRP
SSL_set_psk_client_callback 352 1_1_0d EXIST::FUNCTION:PSK
SSL_CTX_get_cert_store 353 1_1_0d EXIST::FUNCTION:
SSL_get_options 354 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_default_verify_paths 355 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_trust 356 1_1_0d EXIST::FUNCTION:
SSL_set_wfd 357 1_1_0d EXIST::FUNCTION:SOCK
SSL_CTX_use_certificate_file 358 1_1_0d EXIST::FUNCTION:
SSL_is_server 359 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_get_cipher_nid 360 1_1_0d EXIST::FUNCTION:
SSL_new 361 1_1_0d EXIST::FUNCTION:
SSL_CIPHER_find 362 1_1_0d EXIST::FUNCTION:
SSL_get_shared_sigalgs 363 1_1_0d EXIST::FUNCTION:
SSL_COMP_get_name 364 1_1_0d EXIST::FUNCTION:
BIO_new_ssl_connect 365 1_1_0d EXIST::FUNCTION:
SSL_COMP_get0_name 366 1_1_0d EXIST::FUNCTION:
SSL_SESSION_has_ticket 367 1_1_0d EXIST::FUNCTION:
SSL_get0_peer_scts 368 1_1_0d EXIST::FUNCTION:CT
SSL_CTX_get_ssl_method 369 1_1_0d EXIST::FUNCTION:
SSL_CTX_sess_get_get_cb 370 1_1_0d EXIST::FUNCTION:
SSL_SESSION_set_time 371 1_1_0d EXIST::FUNCTION:
DTLS_client_method 372 1_1_0d EXIST::FUNCTION:
PEM_read_SSL_SESSION 373 1_1_0d EXIST::FUNCTION:STDIO
SSL_set_fd 374 1_1_0d EXIST::FUNCTION:SOCK
SSL_version 375 1_1_0d EXIST::FUNCTION:
SSL_get_srp_g 376 1_1_0d EXIST::FUNCTION:SRP
SSL_get_wfd 377 1_1_0d EXIST::FUNCTION:
SSL_dup_CA_list 378 1_1_0d EXIST::FUNCTION:
SSL_CTX_set_client_CA_list 379 1_1_0d EXIST::FUNCTION:
SSL_ctrl 380 1_1_0d EXIST::FUNCTION:
SSL_check_private_key 381 1_1_0d EXIST::FUNCTION:
SSL_set_purpose 382 1_1_0d EXIST::FUNCTION:
SSL_CONF_CTX_set_ssl 383 1_1_0d EXIST::FUNCTION:
SSL_CTX_new 384 1_1_0d EXIST::FUNCTION:
SSL_get_wbio 385 1_1_0d EXIST::FUNCTION:
SSL_CTX_use_serverinfo 386 1_1_0d EXIST::FUNCTION:
SSL_enable_ct 387 1_1_0d EXIST::FUNCTION:CT
SSL_get_verify_mode 388 1_1_0d EXIST::FUNCTION:
SSL_COMP_add_compression_method 389 1_1_0d EXIST::FUNCTION:
SSL_CTX_sessions 390 1_1_0d EXIST::FUNCTION:
SSL_CTX_get0_param 391 1_1_0d EXIST::FUNCTION:
SSL_set_verify_depth 392 1_1_0d EXIST::FUNCTION:
SSL_rstate_string_long 393 1_1_0d EXIST::FUNCTION:
TLS_method 394 1_1_0d EXIST::FUNCTION:
SSL_get_srp_username 395 1_1_0d EXIST::FUNCTION:SRP
SSL_CTX_get_timeout 396 1_1_0d EXIST::FUNCTION:
SSL_get_version 397 1_1_0d EXIST::FUNCTION:
SSL_get_rbio 398 1_1_0d EXIST::FUNCTION:
SSL_CTX_SRP_CTX_init 399 1_1_0d EXIST::FUNCTION:SRP
SSL_set_cert_cb 400 1_1_0d EXIST::FUNCTION:
SSL_SESSION_get_compress_id 401 1_1_0d EXIST::FUNCTION:
SSL_get_verify_depth 402 1_1_0d EXIST::FUNCTION:
SSL_CTX_sess_set_new_cb 403 1_1_0d EXIST::FUNCTION:
SSL_get_psk_identity_hint 404 1_1_0d EXIST::FUNCTION:PSK
TLSv1_1_client_method 405 1_1_0d EXIST::FUNCTION:DEPRECATEDIN_1_1_0,TLS1_1_METHOD
SSL_CONF_CTX_set_flags 406 1_1_0d EXIST::FUNCTION:
SSL_set_security_level 407 1_1_0d EXIST::FUNCTION:
SSL_get_quiet_shutdown 408 1_1_0d EXIST::FUNCTION:
SSL_set_session_ticket_ext_cb 409 1_1_0d EXIST::FUNCTION:
SSL_get_verify_result 410 1_1_0d EXIST::FUNCTION:
SSL_accept 411 1_1_0d EXIST::FUNCTION: