SKF Wrapper

This commit is contained in:
Zhi Guan
2016-05-29 00:22:33 +02:00
parent 0cf9126a7d
commit ee4384daeb
142 changed files with 9469 additions and 6750 deletions

View File

@@ -146,12 +146,13 @@ a_digest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
a_digest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
a_digest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
a_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
a_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_digest.o: ../../include/openssl/opensslconf.h
a_digest.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
a_digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
a_digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
a_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
a_digest.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
a_digest.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
a_digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
a_digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_digest.c
a_dup.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -239,27 +240,29 @@ a_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
a_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
a_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
a_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
a_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
a_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
a_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
a_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
a_sign.o: ../cryptlib.h a_sign.c asn1_locl.h
a_sign.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
a_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
a_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
a_sign.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
a_sign.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
a_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
a_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_sign.c asn1_locl.h
a_strex.o: ../../e_os.h ../../include/openssl/asn1.h
a_strex.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
a_strex.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
a_strex.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
a_strex.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
a_strex.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_strex.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
a_strex.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
a_strex.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
a_strex.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
a_strex.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
a_strex.o: ../cryptlib.h a_strex.c charmap.h
a_strex.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
a_strex.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
a_strex.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_strex.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_strex.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
a_strex.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
a_strex.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
a_strex.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
a_strex.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_strex.c charmap.h
a_strnid.o: ../../e_os.h ../../include/openssl/asn1.h
a_strnid.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
a_strnid.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -308,11 +311,13 @@ a_verify.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
a_verify.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
a_verify.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
a_verify.o: ../../include/openssl/err.h ../../include/openssl/evp.h
a_verify.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
a_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
a_verify.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
a_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
a_verify.o: ../../include/openssl/opensslconf.h
a_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
a_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
a_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
a_verify.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
a_verify.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
a_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
a_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h a_verify.c
a_verify.o: asn1_locl.h
@@ -322,12 +327,14 @@ ameth_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ameth_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ameth_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ameth_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ameth_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ameth_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ameth_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ameth_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ameth_lib.o: ../../include/openssl/objects.h
ameth_lib.o: ../../include/openssl/opensslconf.h
ameth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ameth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ameth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ameth_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ameth_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ameth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ameth_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ameth_lib.c
ameth_lib.o: asn1_locl.h
@@ -344,11 +351,13 @@ asn1_gen.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
asn1_gen.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
asn1_gen.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
asn1_gen.o: ../../include/openssl/err.h ../../include/openssl/evp.h
asn1_gen.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
asn1_gen.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
asn1_gen.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
asn1_gen.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
asn1_gen.o: ../../include/openssl/opensslconf.h
asn1_gen.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn1_gen.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
asn1_gen.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
asn1_gen.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
asn1_gen.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
asn1_gen.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
asn1_gen.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
asn1_gen.o: ../cryptlib.h asn1_gen.c
@@ -375,11 +384,13 @@ asn_mime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
asn_mime.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
asn_mime.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
asn_mime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
asn_mime.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
asn_mime.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
asn_mime.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
asn_mime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
asn_mime.o: ../../include/openssl/opensslconf.h
asn_mime.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn_mime.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
asn_mime.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
asn_mime.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
asn_mime.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
asn_mime.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
asn_mime.o: ../cryptlib.h asn1_locl.h asn_mime.c
@@ -389,12 +400,13 @@ asn_moid.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
asn_moid.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
asn_moid.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
asn_moid.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
asn_moid.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
asn_moid.o: ../../include/openssl/opensslconf.h
asn_moid.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
asn_moid.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
asn_moid.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
asn_moid.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
asn_moid.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
asn_moid.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
asn_moid.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
asn_moid.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
asn_moid.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
asn_moid.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn_moid.c
asn_pack.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -424,13 +436,15 @@ d2i_pr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
d2i_pr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
d2i_pr.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
d2i_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
d2i_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
d2i_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
d2i_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
d2i_pr.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
d2i_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
d2i_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
d2i_pr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h d2i_pr.c
d2i_pr.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
d2i_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
d2i_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
d2i_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
d2i_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
d2i_pr.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
d2i_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
d2i_pr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
d2i_pr.o: ../cryptlib.h asn1_locl.h d2i_pr.c
d2i_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
d2i_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
d2i_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
@@ -477,13 +491,15 @@ i2d_pr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
i2d_pr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
i2d_pr.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
i2d_pr.o: ../../include/openssl/err.h ../../include/openssl/evp.h
i2d_pr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
i2d_pr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
i2d_pr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
i2d_pr.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
i2d_pr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
i2d_pr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
i2d_pr.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h i2d_pr.c
i2d_pr.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
i2d_pr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
i2d_pr.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
i2d_pr.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
i2d_pr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
i2d_pr.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
i2d_pr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
i2d_pr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
i2d_pr.o: ../cryptlib.h asn1_locl.h i2d_pr.c
i2d_pu.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
i2d_pu.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
i2d_pu.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
@@ -501,24 +517,28 @@ n_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
n_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
n_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
n_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
n_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
n_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
n_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
n_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
n_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
n_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
n_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h n_pkey.c
n_pkey.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
n_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
n_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
n_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
n_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
n_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
n_pkey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
n_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
n_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
n_pkey.o: ../cryptlib.h n_pkey.c
nsseq.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
nsseq.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
nsseq.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
nsseq.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
nsseq.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
nsseq.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
nsseq.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
nsseq.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
nsseq.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
nsseq.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
nsseq.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
nsseq.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
nsseq.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
nsseq.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
nsseq.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
nsseq.o: ../../include/openssl/x509_vfy.h nsseq.c
p5_pbe.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -527,25 +547,28 @@ p5_pbe.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p5_pbe.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p5_pbe.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p5_pbe.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p5_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p5_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p5_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p5_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
p5_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p5_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p5_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p5_pbe.o: ../cryptlib.h p5_pbe.c
p5_pbe.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p5_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p5_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p5_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p5_pbe.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
p5_pbe.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p5_pbe.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p5_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p5_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_pbe.c
p5_pbev2.o: ../../e_os.h ../../include/openssl/asn1.h
p5_pbev2.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
p5_pbev2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p5_pbev2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p5_pbev2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p5_pbev2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p5_pbev2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p5_pbev2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p5_pbev2.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p5_pbev2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p5_pbev2.o: ../../include/openssl/opensslconf.h
p5_pbev2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p5_pbev2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
p5_pbev2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p5_pbev2.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p5_pbev2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p5_pbev2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p5_pbev2.o: ../cryptlib.h p5_pbev2.c
@@ -555,41 +578,45 @@ p8_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p8_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p8_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p8_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p8_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p8_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p8_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p8_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p8_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p8_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p8_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p8_pkey.c
p8_pkey.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p8_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p8_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p8_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p8_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p8_pkey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p8_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p8_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p8_pkey.o: ../cryptlib.h p8_pkey.c
t_bitst.o: ../../e_os.h ../../include/openssl/asn1.h
t_bitst.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
t_bitst.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_bitst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_bitst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
t_bitst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_bitst.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_bitst.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_bitst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_bitst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
t_bitst.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_bitst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_bitst.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_bitst.o: ../cryptlib.h t_bitst.c
t_bitst.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
t_bitst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_bitst.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_bitst.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_bitst.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_bitst.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
t_bitst.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_bitst.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_bitst.o: ../../include/openssl/x509v3.h ../cryptlib.h t_bitst.c
t_crl.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_crl.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_crl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_crl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_crl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
t_crl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
t_crl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_crl.o: ../cryptlib.h t_crl.c
t_crl.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
t_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_crl.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
t_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h t_crl.c
t_pkey.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_pkey.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -605,57 +632,61 @@ t_req.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_req.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_req.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
t_req.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_req.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
t_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_req.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_req.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_req.o: ../cryptlib.h t_req.c
t_req.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
t_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
t_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_req.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
t_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_req.o: ../../include/openssl/x509v3.h ../cryptlib.h t_req.c
t_spki.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_spki.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_spki.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
t_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
t_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
t_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
t_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
t_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_spki.o: ../cryptlib.h t_spki.c
t_spki.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
t_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_spki.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_spki.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
t_spki.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
t_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_spki.c
t_x509.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
t_x509.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
t_x509.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
t_x509.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
t_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
t_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
t_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
t_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
t_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
t_x509.o: ../cryptlib.h asn1_locl.h t_x509.c
t_x509.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
t_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
t_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_x509.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
t_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h asn1_locl.h t_x509.c
t_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
t_x509a.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
t_x509a.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
t_x509a.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
t_x509a.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
t_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
t_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
t_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
t_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
t_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
t_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
t_x509a.o: ../cryptlib.h t_x509a.c
t_x509a.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
t_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
t_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
t_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
t_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
t_x509a.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
t_x509a.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
t_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
t_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h t_x509a.c
tasn_dec.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
tasn_dec.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
tasn_dec.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -695,12 +726,13 @@ tasn_prn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
tasn_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tasn_prn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tasn_prn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
tasn_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
tasn_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tasn_prn.o: ../../include/openssl/opensslconf.h
tasn_prn.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
tasn_prn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tasn_prn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tasn_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tasn_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tasn_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tasn_prn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tasn_prn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tasn_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tasn_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
tasn_prn.o: ../cryptlib.h asn1_locl.h tasn_prn.c
@@ -722,12 +754,14 @@ x_algor.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
x_algor.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
x_algor.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
x_algor.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_algor.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
x_algor.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_algor.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_algor.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_algor.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_algor.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_algor.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_algor.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_algor.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_algor.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_algor.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_algor.o: ../../include/openssl/x509_vfy.h x_algor.c
x_attrib.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -736,11 +770,13 @@ x_attrib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_attrib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_attrib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_attrib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_attrib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_attrib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_attrib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_attrib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_attrib.o: ../../include/openssl/opensslconf.h
x_attrib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_attrib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_attrib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_attrib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_attrib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_attrib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_attrib.c
x_bignum.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -758,24 +794,28 @@ x_crl.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
x_crl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
x_crl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_crl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_crl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
x_crl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_crl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_crl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_crl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_crl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_crl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_crl.o: ../../include/openssl/x509v3.h ../cryptlib.h asn1_locl.h x_crl.c
x_crl.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_crl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_crl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_crl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_crl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_crl.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_crl.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_crl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_crl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
x_crl.o: ../cryptlib.h asn1_locl.h x_crl.c
x_exten.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
x_exten.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
x_exten.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
x_exten.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_exten.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
x_exten.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_exten.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_exten.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_exten.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_exten.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_exten.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_exten.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_exten.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_exten.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_exten.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_exten.o: ../../include/openssl/x509_vfy.h x_exten.c
x_info.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -783,13 +823,15 @@ x_info.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_info.c
x_info.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_info.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_info.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_info.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_info.o: ../cryptlib.h x_info.c
x_long.o: ../../e_os.h ../../include/openssl/asn1.h
x_long.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_long.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -805,23 +847,27 @@ x_name.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_name.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_name.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_name.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_name.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_name.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_name.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_name.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_name.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_name.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_name.o: ../../include/openssl/x509_vfy.h ../cryptlib.h asn1_locl.h x_name.c
x_name.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_name.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_name.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_name.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_name.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_name.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_name.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_name.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_name.o: ../cryptlib.h asn1_locl.h x_name.c
x_nx509.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
x_nx509.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
x_nx509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
x_nx509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_nx509.o: ../../include/openssl/ecdsa.h ../../include/openssl/evp.h
x_nx509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_nx509.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_nx509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_nx509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_nx509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_nx509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_nx509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_nx509.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_nx509.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_nx509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_nx509.o: ../../include/openssl/x509_vfy.h x_nx509.c
x_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -830,25 +876,28 @@ x_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_pkey.c
x_pkey.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_pkey.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_pkey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_pkey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_pkey.o: ../cryptlib.h x_pkey.c
x_pubkey.o: ../../e_os.h ../../include/openssl/asn1.h
x_pubkey.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_pubkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_pubkey.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
x_pubkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_pubkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
x_pubkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_pubkey.o: ../../include/openssl/opensslconf.h
x_pubkey.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_pubkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_pubkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_pubkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_pubkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
x_pubkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_pubkey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_pubkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_pubkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_pubkey.o: ../cryptlib.h asn1_locl.h x_pubkey.c
@@ -858,76 +907,88 @@ x_req.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_req.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_req.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_req.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_req.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_req.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_req.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_req.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_req.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_req.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_req.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_req.c
x_req.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_req.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_req.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_req.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_req.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_req.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_req.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_req.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_req.o: ../cryptlib.h x_req.c
x_sig.o: ../../e_os.h ../../include/openssl/asn1.h
x_sig.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_sig.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_sig.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_sig.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_sig.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_sig.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_sig.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_sig.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_sig.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_sig.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_sig.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_sig.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_sig.c
x_sig.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_sig.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_sig.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_sig.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_sig.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_sig.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_sig.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_sig.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_sig.o: ../cryptlib.h x_sig.c
x_spki.o: ../../e_os.h ../../include/openssl/asn1.h
x_spki.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_spki.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_spki.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_spki.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_spki.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_spki.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_spki.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_spki.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_spki.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_spki.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_spki.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_spki.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_spki.c
x_spki.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_spki.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_spki.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_spki.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_spki.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_spki.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_spki.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_spki.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_spki.o: ../cryptlib.h x_spki.c
x_val.o: ../../e_os.h ../../include/openssl/asn1.h
x_val.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_val.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_val.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_val.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_val.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_val.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_val.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_val.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_val.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_val.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_val.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_val.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_val.c
x_val.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_val.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_val.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_val.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_val.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_val.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_val.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_val.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_val.o: ../cryptlib.h x_val.c
x_x509.o: ../../e_os.h ../../include/openssl/asn1.h
x_x509.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_x509.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
x_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
x_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
x_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
x_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_x509.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_x509.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_x509.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_x509.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_x509.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_x509.o: ../../include/openssl/x509v3.h ../cryptlib.h x_x509.c
x_x509.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
x_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_x509.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
x_x509.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
x_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_x509.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
x_x509.o: ../cryptlib.h x_x509.c
x_x509a.o: ../../e_os.h ../../include/openssl/asn1.h
x_x509a.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
x_x509a.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
x_x509a.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
x_x509a.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
x_x509a.o: ../../include/openssl/err.h ../../include/openssl/evp.h
x_x509a.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
x_x509a.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
x_x509a.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
x_x509a.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
x_x509a.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
x_x509a.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
x_x509a.o: ../../include/openssl/x509_vfy.h ../cryptlib.h x_x509a.c
x_x509a.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
x_x509a.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
x_x509a.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
x_x509a.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
x_x509a.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
x_x509a.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
x_x509a.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
x_x509a.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
x_x509a.o: ../cryptlib.h x_x509a.c

View File

@@ -17,8 +17,8 @@ TEST=
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=cbcmac.c cbcm_ameth.c cbcm_pmeth.c
LIBOBJ=cbcmac.o cbcm_ameth.o cbcm_pmeth.o
LIBSRC=cbcmac.c cbcmac_err.c cbcm_ameth.c cbcm_pmeth.c
LIBOBJ=cbcmac.o cbcmac_err.o cbcm_ameth.o cbcm_pmeth.o
SRC= $(LIBSRC)
@@ -76,38 +76,49 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
cm_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
cm_ameth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cm_ameth.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
cm_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
cm_ameth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cm_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cm_ameth.o: ../../include/openssl/opensslconf.h
cm_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cm_ameth.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
cm_ameth.o: ../../include/openssl/symhacks.h ../asn1/asn1_locl.h ../cryptlib.h
cm_ameth.o: cm_ameth.c
cm_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h
cm_pmeth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cm_pmeth.o: ../../include/openssl/cmac.h ../../include/openssl/conf.h
cm_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cm_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cm_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cm_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cm_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cm_pmeth.o: ../../include/openssl/opensslconf.h
cm_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cm_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cm_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cm_pmeth.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cm_pmeth.o: ../cryptlib.h ../evp/evp_locl.h cm_pmeth.c
cmac.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
cmac.o: ../../include/openssl/buffer.h ../../include/openssl/cmac.h
cmac.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cmac.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cmac.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cmac.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cmac.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cmac.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
cmac.o: ../../include/openssl/symhacks.h ../cryptlib.h cmac.c
cbcm_ameth.o: ../../e_os.h ../../include/openssl/asn1.h
cbcm_ameth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cbcm_ameth.o: ../../include/openssl/cbcmac.h ../../include/openssl/crypto.h
cbcm_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
cbcm_ameth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cbcm_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cbcm_ameth.o: ../../include/openssl/opensslconf.h
cbcm_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cbcm_ameth.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
cbcm_ameth.o: ../../include/openssl/symhacks.h ../asn1/asn1_locl.h
cbcm_ameth.o: ../cryptlib.h cbcm_ameth.c
cbcm_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h
cbcm_pmeth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cbcm_pmeth.o: ../../include/openssl/cbcmac.h ../../include/openssl/conf.h
cbcm_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cbcm_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cbcm_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cbcm_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cbcm_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cbcm_pmeth.o: ../../include/openssl/objects.h
cbcm_pmeth.o: ../../include/openssl/opensslconf.h
cbcm_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cbcm_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cbcm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cbcm_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cbcm_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cbcm_pmeth.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cbcm_pmeth.o: ../cryptlib.h ../evp/evp_locl.h cbcm_pmeth.c
cbcmac.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cbcmac.o: ../../include/openssl/cbcmac.h ../../include/openssl/crypto.h
cbcmac.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
cbcmac.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cbcmac.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cbcmac.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cbcmac.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
cbcmac.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cbcmac.o: cbcmac.c
cbcmac_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cbcmac_err.o: ../../include/openssl/cbcmac.h ../../include/openssl/crypto.h
cbcmac_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
cbcmac_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cbcmac_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cbcmac_err.o: ../../include/openssl/opensslconf.h
cbcmac_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cbcmac_err.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
cbcmac_err.o: ../../include/openssl/symhacks.h cbcmac_err.c

View File

@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/cbcmac.h>
@@ -55,10 +56,12 @@ int CBCMAC_Init(CBCMAC_CTX *ctx, const void *key, size_t keylen,
{
int i, block_size;
if (!EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, key, NULL, eng)) {
if (!EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, eng, key, NULL)) {
CBCMACerr(CBCMAC_F_CBCMAC_INIT, CBCMAC_R_CIPHER_CTX_INIT_FAILED);
return 0;
}
if (EVP_CIPHER_CTX_mode(&ctx->cipher_ctx) != EVP_CIPH_ECB_MODE) {
CBCMACerr(CBCMAC_F_CBCMAC_INIT, CBCMAC_R_CIPHER_NOT_ECB_MODE);
return 0;
}
ctx->worklen = 0;
@@ -90,6 +93,7 @@ int CBCMAC_Update(CBCMAC_CTX *ctx, const void *data, size_t datalen)
}
if (!EVP_EncryptUpdate(&ctx->cipher_ctx, ctx->cbcstate, &len,
ctx->workspace, block_size)) {
CBCMACerr(CBCMAC_F_CBCMAC_UPDATE, ERR_R_EVP_LIB);
return 0;
}
}
@@ -127,7 +131,10 @@ int CBCMAC_Final(CBCMAC_CTX *ctx, unsigned char *out, size_t *outlen)
for (i = ctx->worklen; i < block_size; i++) {
ctx->workspace[i] = ctx->cbcstate[i];
}
EVP_EncryptUpdate(&(ctx->cipher_ctx), out, outlen, ctx->workspace, block_size);
if (!EVP_EncryptUpdate(&(ctx->cipher_ctx), out, outlen, ctx->workspace, block_size)) {
CBCMACerr(CBCMAC_F_CBCMAC_FINAL, ERR_R_EVP_LIB);
return 0;
}
} else {
for (i = 0; i < block_size; i++) {
@@ -135,7 +142,7 @@ int CBCMAC_Final(CBCMAC_CTX *ctx, unsigned char *out, size_t *outlen)
}
}
return 0;
return 1;
}
int CBCMAC_resume(CBCMAC_CTX *ctx)

View File

@@ -53,6 +53,7 @@
* 2. the message length should be multiple of block size
* 3. the implementation do not add padding
*/
#ifndef HEADER_CBCMAC_H
#define HEADER_CBCMAC_H
@@ -77,8 +78,25 @@ int CBCMAC_Update(CBCMAC_CTX *ctx, const void *data, size_t datalen);
int CBCMAC_Final(CBCMAC_CTX *ctx, unsigned char *out, size_t *outlen);
int CBCMAC_resume(CBCMAC_CTX *ctx);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_CBCMAC_strings(void);
/* Error codes for the CBCMAC functions. */
/* Function codes. */
# define CBCMAC_F_CBCMAC_FINAL 100
# define CBCMAC_F_CBCMAC_INIT 101
# define CBCMAC_F_CBCMAC_UPDATE 102
/* Reason codes. */
# define CBCMAC_R_CIPHER_CTX_INIT_FAILED 100
# define CBCMAC_R_CIPHER_NOT_ECB_MODE 101
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,96 @@
/* crypto/cbcmac/cbcmac_err.c */
/* ====================================================================
* Copyright (c) 1999-2016 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/cbcmac.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_CBCMAC,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_CBCMAC,0,reason)
static ERR_STRING_DATA CBCMAC_str_functs[] = {
{ERR_FUNC(CBCMAC_F_CBCMAC_FINAL), "CBCMAC_Final"},
{ERR_FUNC(CBCMAC_F_CBCMAC_INIT), "CBCMAC_Init"},
{ERR_FUNC(CBCMAC_F_CBCMAC_UPDATE), "CBCMAC_Update"},
{0, NULL}
};
static ERR_STRING_DATA CBCMAC_str_reasons[] = {
{ERR_REASON(CBCMAC_R_CIPHER_CTX_INIT_FAILED), "cipher ctx init failed"},
{ERR_REASON(CBCMAC_R_CIPHER_NOT_ECB_MODE), "cipher not ecb mode"},
{0, NULL}
};
#endif
void ERR_load_CBCMAC_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CBCMAC_str_functs[0].error) == NULL) {
ERR_load_strings(0, CBCMAC_str_functs);
ERR_load_strings(0, CBCMAC_str_reasons);
}
#endif
}

View File

@@ -93,12 +93,13 @@ cm_pmeth.o: ../../include/openssl/cmac.h ../../include/openssl/conf.h
cm_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cm_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cm_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cm_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cm_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cm_pmeth.o: ../../include/openssl/opensslconf.h
cm_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cm_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cm_pmeth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cm_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cm_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cm_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cm_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cm_pmeth.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cm_pmeth.o: ../cryptlib.h ../evp/evp_locl.h cm_pmeth.c

View File

@@ -87,13 +87,15 @@ cms_asn1.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cms_asn1.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_asn1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_asn1.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_asn1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_asn1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_asn1.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_asn1.o: ../../include/openssl/opensslconf.h
cms_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_asn1.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_asn1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_asn1.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_asn1.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_asn1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_asn1.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_asn1.o: cms.h cms_asn1.c cms_lcl.h
@@ -103,15 +105,16 @@ cms_att.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_att.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_att.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_att.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_att.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_att.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_att.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_att.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_att.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_att.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_att.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_att.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_att.o: cms.h cms_att.c cms_lcl.h
cms_att.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_att.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_att.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_att.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_att.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_att.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_att.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_att.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_att.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_att.o: ../../include/openssl/x509v3.h cms.h cms_att.c cms_lcl.h
cms_cd.o: ../../e_os.h ../../include/openssl/asn1.h
cms_cd.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
cms_cd.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
@@ -119,15 +122,17 @@ cms_cd.o: ../../include/openssl/comp.h ../../include/openssl/conf.h
cms_cd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_cd.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_cd.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_cd.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_cd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_cd.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_cd.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_cd.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_cd.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_cd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_cd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_cd.o: ../../include/openssl/x509v3.h ../cryptlib.h cms_cd.c cms_lcl.h
cms_cd.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_cd.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_cd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_cd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_cd.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_cd.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_cd.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_cd.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_cd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_cd.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_cd.o: ../cryptlib.h cms_cd.c cms_lcl.h
cms_dd.o: ../../e_os.h ../../include/openssl/asn1.h
cms_dd.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
cms_dd.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
@@ -135,15 +140,16 @@ cms_dd.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_dd.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_dd.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_dd.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_dd.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_dd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_dd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_dd.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_dd.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_dd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_dd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_dd.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_dd.o: ../cryptlib.h cms_dd.c cms_lcl.h
cms_dd.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_dd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_dd.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_dd.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_dd.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_dd.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_dd.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_dd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_dd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_dd.o: ../../include/openssl/x509v3.h ../cryptlib.h cms_dd.c cms_lcl.h
cms_enc.o: ../../e_os.h ../../include/openssl/asn1.h
cms_enc.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
cms_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
@@ -151,15 +157,17 @@ cms_enc.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_enc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_enc.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
cms_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_enc.o: ../../include/openssl/x509v3.h ../cryptlib.h cms_enc.c cms_lcl.h
cms_enc.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_enc.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_enc.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
cms_enc.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_enc.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_enc.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_enc.o: ../cryptlib.h cms_enc.c cms_lcl.h
cms_env.o: ../../e_os.h ../../include/openssl/aes.h
cms_env.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cms_env.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
@@ -167,29 +175,32 @@ cms_env.o: ../../include/openssl/cms.h ../../include/openssl/conf.h
cms_env.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_env.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_env.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_env.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_env.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_env.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_env.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_env.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_env.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
cms_env.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_env.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_env.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_env.o: ../asn1/asn1_locl.h ../cryptlib.h cms_env.c cms_lcl.h
cms_env.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_env.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_env.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_env.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_env.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_env.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
cms_env.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_env.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_env.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_env.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_env.o: ../../include/openssl/x509v3.h ../asn1/asn1_locl.h ../cryptlib.h
cms_env.o: cms_env.c cms_lcl.h
cms_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cms_err.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
cms_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_err.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
cms_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_err.o: cms_err.c
cms_err.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_err.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_err.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_err.o: ../../include/openssl/x509_vfy.h cms_err.c
cms_ess.o: ../../e_os.h ../../include/openssl/asn1.h
cms_ess.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
cms_ess.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
@@ -197,29 +208,32 @@ cms_ess.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_ess.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_ess.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_ess.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_ess.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_ess.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_ess.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_ess.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_ess.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
cms_ess.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_ess.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_ess.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_ess.o: ../../include/openssl/x509v3.h ../cryptlib.h cms_ess.c cms_lcl.h
cms_ess.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_ess.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_ess.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_ess.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_ess.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_ess.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
cms_ess.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_ess.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_ess.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_ess.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_ess.o: ../cryptlib.h cms_ess.c cms_lcl.h
cms_io.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cms_io.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cms_io.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_io.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_io.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_io.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_io.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_io.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_io.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_io.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_io.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_io.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_io.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h cms.h
cms_io.o: cms_io.c cms_lcl.h
cms_io.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_io.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_io.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_io.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_io.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_io.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_io.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_io.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_io.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_io.o: ../../include/openssl/x509_vfy.h cms.h cms_io.c cms_lcl.h
cms_kari.o: ../../e_os.h ../../include/openssl/aes.h
cms_kari.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cms_kari.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
@@ -227,13 +241,14 @@ cms_kari.o: ../../include/openssl/cms.h ../../include/openssl/conf.h
cms_kari.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_kari.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_kari.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_kari.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_kari.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_kari.o: ../../include/openssl/opensslconf.h
cms_kari.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_kari.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_kari.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_kari.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_kari.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_kari.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
cms_kari.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_kari.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_kari.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_kari.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_kari.o: ../../include/openssl/x509v3.h ../asn1/asn1_locl.h ../cryptlib.h
@@ -244,15 +259,16 @@ cms_lib.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_lib.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_lib.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_lib.o: cms.h cms_lcl.h cms_lib.c
cms_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_lib.o: ../../include/openssl/x509v3.h cms.h cms_lcl.h cms_lib.c
cms_pwri.o: ../../e_os.h ../../include/openssl/aes.h
cms_pwri.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cms_pwri.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
@@ -260,13 +276,14 @@ cms_pwri.o: ../../include/openssl/cms.h ../../include/openssl/conf.h
cms_pwri.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cms_pwri.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cms_pwri.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
cms_pwri.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
cms_pwri.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_pwri.o: ../../include/openssl/opensslconf.h
cms_pwri.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cms_pwri.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_pwri.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_pwri.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_pwri.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_pwri.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
cms_pwri.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_pwri.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_pwri.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_pwri.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_pwri.o: ../../include/openssl/x509v3.h ../asn1/asn1_locl.h ../cryptlib.h
@@ -278,15 +295,17 @@ cms_sd.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_sd.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_sd.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_sd.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_sd.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_sd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cms_sd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_sd.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
cms_sd.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_sd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_sd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_sd.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_sd.o: ../asn1/asn1_locl.h ../cryptlib.h cms_lcl.h cms_sd.c
cms_sd.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_sd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_sd.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cms_sd.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
cms_sd.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
cms_sd.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cms_sd.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cms_sd.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cms_sd.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cms_sd.o: ../../include/openssl/x509v3.h ../asn1/asn1_locl.h ../cryptlib.h
cms_sd.o: cms_lcl.h cms_sd.c
cms_smime.o: ../../e_os.h ../../include/openssl/asn1.h
cms_smime.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
cms_smime.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
@@ -294,12 +313,13 @@ cms_smime.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
cms_smime.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cms_smime.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cms_smime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cms_smime.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cms_smime.o: ../../include/openssl/objects.h
cms_smime.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cms_smime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cms_smime.o: ../../include/openssl/opensslconf.h
cms_smime.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cms_smime.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cms_smime.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
cms_smime.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cms_smime.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cms_smime.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cms_smime.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
cms_smime.o: ../asn1/asn1_locl.h ../cryptlib.h cms_lcl.h cms_smime.c

View File

@@ -116,12 +116,13 @@ conf_mall.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_mall.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
conf_mall.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
conf_mall.o: ../../include/openssl/err.h ../../include/openssl/evp.h
conf_mall.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
conf_mall.o: ../../include/openssl/objects.h
conf_mall.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
conf_mall.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_mall.o: ../../include/openssl/opensslconf.h
conf_mall.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_mall.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
conf_mall.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
conf_mall.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
conf_mall.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
conf_mall.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mall.c
conf_mod.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -130,12 +131,13 @@ conf_mod.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
conf_mod.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_mod.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
conf_mod.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
conf_mod.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_mod.o: ../../include/openssl/opensslconf.h
conf_mod.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
conf_mod.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
conf_mod.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
conf_mod.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_mod.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
conf_mod.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
conf_mod.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
conf_mod.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
conf_mod.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
conf_mod.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_mod.c
conf_sap.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -145,10 +147,12 @@ conf_sap.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
conf_sap.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
conf_sap.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
conf_sap.o: ../../include/openssl/err.h ../../include/openssl/evp.h
conf_sap.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
conf_sap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
conf_sap.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
conf_sap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
conf_sap.o: ../../include/openssl/opensslconf.h
conf_sap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
conf_sap.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
conf_sap.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
conf_sap.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
conf_sap.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
conf_sap.o: ../../include/openssl/x509_vfy.h ../cryptlib.h conf_sap.c

View File

@@ -76,3 +76,90 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
cpk_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cpk_asn1.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cpk_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cpk_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cpk_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
cpk_asn1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cpk_asn1.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cpk_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cpk_asn1.o: ../../include/openssl/opensslconf.h
cpk_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cpk_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cpk_asn1.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cpk_asn1.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cpk_asn1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cpk_asn1.o: ../../include/openssl/x509_vfy.h cpk.h cpk_asn1.c
cpk_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cpk_err.o: ../../include/openssl/buffer.h ../../include/openssl/cpk.h
cpk_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cpk_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cpk_err.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
cpk_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cpk_err.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cpk_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cpk_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cpk_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
cpk_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
cpk_err.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
cpk_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
cpk_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
cpk_err.o: cpk_err.c
cpk_kap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cpk_kap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
cpk_kap.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cpk_kap.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cpk_kap.o: ../../include/openssl/ecies.h ../../include/openssl/err.h
cpk_kap.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cpk_kap.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cpk_kap.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cpk_kap.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cpk_kap.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cpk_kap.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cpk_kap.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cpk_kap.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cpk_kap.o: ../../include/openssl/x509_vfy.h cpk.h cpk_kap.c
cpk_lib.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
cpk_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
cpk_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
cpk_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
cpk_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
cpk_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
cpk_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
cpk_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
cpk_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
cpk_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
cpk_lib.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
cpk_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cpk_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cpk_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cpk_lib.o: ../../include/openssl/x509_vfy.h cpk.h cpk_lib.c
cpk_map.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cpk_map.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
cpk_map.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cpk_map.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cpk_map.o: ../../include/openssl/ecies.h ../../include/openssl/err.h
cpk_map.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cpk_map.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cpk_map.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cpk_map.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cpk_map.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cpk_map.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cpk_map.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cpk_map.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cpk_map.o: ../../include/openssl/x509_vfy.h cpk.h cpk_map.c
cpk_prn.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
cpk_prn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
cpk_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
cpk_prn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
cpk_prn.o: ../../include/openssl/ecies.h ../../include/openssl/err.h
cpk_prn.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
cpk_prn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
cpk_prn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
cpk_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
cpk_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
cpk_prn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
cpk_prn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
cpk_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
cpk_prn.o: ../../include/openssl/x509_vfy.h cpk.h cpk_prn.c

View File

@@ -61,152 +61,38 @@
extern "C" {
#endif
#define CPK_LIB_VERSION "0.9"
#define CPK_MAX_ID_LENGTH 64
/**
* @struct CPK_MASTER_SECRET
* @brief The in-memory structure to represent a cpk master secret.
*/
typedef struct cpk_master_secret_st {
long version; /**< The version of the master secret.*/
X509_NAME *id; /**< The id of the master secret.*/
X509_ALGOR *pkey_algor; /**< The public key algorithm used in the master secret.*/
X509_ALGOR *map_algor; /**< The map algorithm used in the master secret.*/
ASN1_OCTET_STRING *secret_factors; /**< The secret factors of the master secret.*/
long version;
X509_NAME *id;
X509_ALGOR *pkey_algor;
X509_ALGOR *map_algor;
ASN1_OCTET_STRING *secret_factors;
} CPK_MASTER_SECRET;
/**
* @def
* @brief Declare 4 basic ASN1 functions of CPK_MASTER_SECRET and a pointer
* to an ASN1_ITEM with detail information of the fields of
* CPK_MASTER_SECRET in it.
*
* The macro would generate following 4 function declarations and 1 pointer:\n
* CPK_MASTER_SECRET *CPK_MASTER_SECRET_new(void): alloc a new instance of CPK_MASTER_SECRET.\n
* void CPK_MASTER_SECRET_free(CPK_MASTER_SECRET* a): free the instance a.\n
* CPK_MASTER_SECRET *d2i_CPK_MASTER_SECRET(CPK_MASTER_SECRET **a, const unsigned char **in, long len):
* convert the CPK_MASTER_SECRET instance from the DER format to the internal format.\n
* int i2d_CPK_MASTER_SECRET(CPK_MASTER_SECRET *a, unsigned char* out): convert an CPK_MASTER_SECRET
* to the DER format.\n
* ASN1_ITEM* CPK_MASTER_SECRET_it: a pointer to a instance of ASN1_ITEM struct which contains
* information on the conversion between DER and internal.\n
*/
DECLARE_ASN1_FUNCTIONS(CPK_MASTER_SECRET)
/**
* @struct CPK_PUBLIC_PARAMS
* @brief The in-memory structure to represent a set of cpk public parameters.
*/
typedef struct cpk_public_params_st {
long version; /**< The version of the public parameters.*/
X509_NAME *id; /**< The id of the public parameters.*/
X509_ALGOR *pkey_algor; /**< The public key algorithm used in the public parameters.*/
X509_ALGOR *map_algor; /**< The map algorithm used in the public parameters.*/
ASN1_OCTET_STRING *public_factors;/**< The public factors of the public parameters.*/
long version;
X509_NAME *id;
X509_ALGOR *pkey_algor;
X509_ALGOR *map_algor;
ASN1_OCTET_STRING *public_factors;
} CPK_PUBLIC_PARAMS;
/**
* @brief Declare 4 basic ASN1 functions of CPK_PUBLIC_PARAMS and a pointer to an ASN1_ITEM
* with detail information of the fields of CPK_PUBLIC_PARAMS in it.
*
* The macro would generate following 4 function declarations and 1 pointer:\n
* CPK_PUBLIC_PARAMS *CPK_PUBLIC_PARAMS_new(void): alloc a new instance of CPK_PUBLIC_PARAMS.\n
* void CPK_PUBLIC_PARAMS_free(CPK_PUBLIC_PARAMS* a): free the instance a.\n
* CPK_PUBLIC_PARAMS *d2i_CPK_PUBLIC_PARAMS(CPK_PUBLIC_PARAMS **a, const unsigned char **in, long len):
* convert the CPK_PUBLIC_PARAMS instance from the DER format to the internal format.\n
* int i2d_CPK_PUBLIC_PARAMS(CPK_PUBLIC_PARAMS *a, unsigned char* out): convert a CPK_PUBLIC_PARAMS
* to the DER format.\n
* ASN1_ITEM* CPK_PUBLIC_PARAMS_it: a pointer to a instance of ASN1_ITEM struct which contains
* information on the conversion between DER and internal.\n
*/
DECLARE_ASN1_FUNCTIONS(CPK_PUBLIC_PARAMS)
/**
* @brief Get a new default map algorithm.
*
* @return Returns a pointer to a new instance of the default map algorithm of the type X509_ALGOR.
*/
X509_ALGOR *CPK_MAP_new_default();
/**
* @brief Check if the given map algorithm is valid.
*
* @param[in] algor The pointer to the algorithm to check.
* @return Returns 1 if the given algorithm is valid.
*/
X509_ALGOR *CPK_MAP_new_default(void);
int CPK_MAP_is_valid(const X509_ALGOR *algor);
/**
* @brief Get the number of factors of the given algorithm.
*
* @param[in] algor The pointer to the algorithm.
* @return Returns the number of factors of the algorithm.
*/
int CPK_MAP_num_factors(const X509_ALGOR *algor);
/**
* @brief Get the number of indexes of the given algorithm.
*
* @param[in] algor The pointer to the algorithm.
* @return Returns the number of indexes of the algorithm.
*/
int CPK_MAP_num_indexes(const X509_ALGOR *algor);
/**
* @brief Convert the string to the index vector.
*
* @param[in] algor The pointer to the algorithm to do the map function.
* @param[in] str The pointer to a string in the memory, ended by '\0'.
* @param[out] index The pointer to a array which will receive the index.
* @return Returns 1 on success.
*/
int CPK_MAP_str2index(const X509_ALGOR *algor, const char *str, int *index);
/**
* @brief Print the parameters of the map algortihm.
*
* @param[out] out A IO abstraction to receive the output stream.
* @param[in] indent The amount of the indentation in the output stream.
* @param[in] flags The flag set to control the ouput.
* @return Returns 1 on success.
*/
int CPK_MAP_print(BIO *out, X509_ALGOR *map, int indent, unsigned long flags);
/**
* @brief Create a master secret with the given domain id, public key algorithm and map algorithm.
*
* @param[in] domain_id The domain identifier of the master secret.
* @param[in] pkey The pointer to the public key algorithm of the master secret.
* @param[in] map_algor The pointer to the map algorithm of the master secret.
* @return Returns a poniter to the created master secret on success, or NULL on failure.
*/
CPK_MASTER_SECRET *CPK_MASTER_SECRET_create(const char *domain_id, EVP_PKEY *pkey, X509_ALGOR *map_algor);
/**
* @brief Extract the public parameters from the master secret.
*
* @param[in] master The master secret to extract from.
* @return Returns the pointer to the extracted public parameters on success, or NULL on failure.
*/
CPK_PUBLIC_PARAMS *CPK_MASTER_SECRET_extract_public_params(CPK_MASTER_SECRET *master);
/**
* @brief Extract the private key of a given identifier from the master secret.
*
* @param[in] master The master secret to extract from.
* @param[in] id The identifier which is used to maps to the private key.
* @return Returns the pointer to the extracted private key on success, or NULL on failure.
*/
EVP_PKEY *CPK_MASTER_SECRET_extract_private_key(CPK_MASTER_SECRET *master, const char *id);
/**
* @brief Extract the public key of a given identifier from the public parameters.
*
* @param[in] params The public parameters to extract from.
* @param[in] id The identifier which is used to maps to the public key.
* @return Returns the pointer to the extracted public key EVP_PKEY on success, or NULL on failure.
*/
EVP_PKEY *CPK_PUBLIC_PARAMS_extract_public_key(CPK_PUBLIC_PARAMS *params, const char *id);
@@ -216,374 +102,74 @@ int CPK_PUBLIC_PARAMS_compute_share_key(CPK_PUBLIC_PARAMS *params,
char *CPK_MASTER_SECRET_get_name(CPK_MASTER_SECRET *master, char *buf, int size);
char *CPK_PUBLIC_PARAMS_get_name(CPK_PUBLIC_PARAMS *params);
/**
* @brief Generate the message digest of the given master secret with the given parameters.
*
* This function takes the secret_factors field of the given parameter of CPK_MASTER_SECRET as
* the input and the parameter type of EVP_MD as the message digest
* algorithm to compute the message digest, and put the result in the parameter md, the length
* of the result in the paramter len.
* @param[in] master The master secret to compute the digest.
* @param[in] type The message digest algorithm to use to comput the digest.
* @param[out] md The buffer to receive the result of the computation of message digest.
* @param[out] len If len is not null, the variable it point to will be assigned the length of
* the message digest.
* @return Returns 1 on success, 0 on failure.
*/
int CPK_MASTER_SECRET_digest(CPK_MASTER_SECRET *master, const EVP_MD *type, unsigned char *md, unsigned int *len);
/**
* @brief Generate the message digest of the given public parameters with the given parameters.
*
* This function takes the secret_factors field of the given parameter of CPK_PUBLIC_PARAMS as
* the input and the parameter type of EVP_MD as the message digest
* algorithm to compute the message digest, and put the result in the parameter md, the length
* of the result in the paramter len.
* @param[in] params The public parameters to compute the digest.
* @param[in] type The message digest algorithm to use to comput the digest.
* @param[out] md The buffer to receive the result of the computation of message digest.
* @param[out] len If len is not null, the variable it point to will be assigned the length of
* the message digest.
* @return Returns 1 on success, 0 on failure.
*/
int CPK_PUBLIC_PARAMS_digest(CPK_PUBLIC_PARAMS *params, const EVP_MD *type, unsigned char *md, unsigned int *len);
/**
* @brief Print the master secret to a BIO, including the version, the domain uri, the public
* algorithm and the map algorithm.
*
* @param[out] out A IO abstraction to receive the output stream.
* @param[in] master The CPK_MASTER_SECRET instance to print.
* @param[in] indent The amount of the indentation.
* @param[in] flags The flag set to control the ouput.
* @return Returns 1 on success, 0 on failure.
*/
int CPK_MASTER_SECRET_print(BIO *out, CPK_MASTER_SECRET *master, int indent, unsigned long flags);
/**
* @brief Print the public parameters to a BIO.
*
* @param[out] out A IO abstraction to receive the output stream.
* @param[in] params The CPK_PUBLIC_PARAMS instance to print.
* @param[in] indent The amount of the indentation.
* @param[in] flags The flag set to control the ouput.
* @return Returns 1 on success, 0 on failure.
*/
int CPK_PUBLIC_PARAMS_print(BIO *out, CPK_PUBLIC_PARAMS *params, int indent, unsigned long flags);
/**
* @brief Validate the public parameters with the given master secret.
*
* @param[in] master The master secret used for the validation.
* @param[in] params The public parameters to validate.
* @return Returns 1 if the public parameter is valid, returns 0 otherwise.
*/
int CPK_MASTER_SECRET_validate_public_params(CPK_MASTER_SECRET *master, CPK_PUBLIC_PARAMS *params);
/**
* @brief Validate the private key with the given public parameters.
*
* @param[in] params The public parameter used for the validation.
* @param[in] id the identifier of the private key owner.
* @param[in] pkey pkey The private key to validate.
* @return Returns 1 if the private key is valid, returns a integer less or equal than 0 otherwise.
*/
int CPK_PUBLIC_PARAMS_validate_private_key(CPK_PUBLIC_PARAMS *params, const char *id, const EVP_PKEY *pkey);
/**
* @brief Convert the master secret in DER format in the IO abstraction to an instance of CPK_MASTER_SECRET.
*
* @param[in] bp A pointer to the IO abstraction which ocntaints the master secret in DER format.
* @param[out] master A pointer to receive the pointer to the converted master secret of the type CPK_MASTER_SECRET.
* @return Returns the pointer to the converted master secret of the type CPK_MASTER_SECRET on success,
* or null on failure.
*/
CPK_MASTER_SECRET *d2i_CPK_MASTER_SECRET_bio(BIO *bp, CPK_MASTER_SECRET **master);
/**
* @brief Convert the master key from CPK_MASTER_SECRET to a byte stream in DER format, and write
* the stream to an IO abstraction.
*
* @param[out] bp A pointer to the IO abstraction which receives the stream.
* @param[in] master A pointer to the master key of the type CPK_MASTER_SECRET.
* @return Returns the size of the output stream on success, of an integer less or equal than 0
* indicating an error.
*/
int i2d_CPK_MASTER_SECRET_bio(BIO *bp, CPK_MASTER_SECRET *master);
/**
* @brief Convert the public parameters in DER format in the IO abstraction to an instance of CPK_PUBLIC_PARAMS.
*
* @param[in] bp A pointer to the IO abstraction which ocntaints the public parameters in DER format.
* @param[out] params A pointer to receive the pointer to the converted public parameters of the type CPK_PUBLIC_PARAMS.
* @return Returns the pointer to the converted public parameters of the type CPK_PUBLIC_PARAMS on success,
* or null on failure.
*/
CPK_PUBLIC_PARAMS *d2i_CPK_PUBLIC_PARAMS_bio(BIO *bp, CPK_PUBLIC_PARAMS **params);
/**
* @brief Convert the public parameters from CPK_PUBLIC_PARAMS to a byte stream in DER format,
* and write the stream to an IO abstraction.
*
* @param[out] bp A pointer to the IO abstraction which receives the stream.
* @param[in] master A pointer to the public parameters of the type CPK_PUBLIC_PARAMS.
* @return Returns the size of the output stream on success, of an integer less or equal than 0
* indicating an error.
*/
int i2d_CPK_PUBLIC_PARAMS_bio(BIO *bp, CPK_PUBLIC_PARAMS *params);
/* BEGIN ERROR CODES */
/*
* SignerInfo ::= SEQUENCE {
* version INTEGER {1},
* signer IssuerAndSerialNumber,
* digestAlgor DigestAlgorithmIdentifier,
* signedAttrs [0] IMPLICIT Attributes OPTIONAL,
* signingAlgor SigningAlgorithmIdentifier,
* signature OCTET STRING {{ECDSASigValue}},
* unsignedAttrs [1] IMPLICIT Attributes OPTIONAL
* }
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
typedef struct cpk_signer_info_st {
long version;
X509_NAME *signer;
X509_ALGOR *digest_algor;
STACK_OF(X509_ATTRIBUTE) *signed_attr;
X509_ALGOR *sign_algor;
ASN1_OCTET_STRING *signature;
STACK_OF(X509_ATTRIBTE) *unsigned_attr;
EVP_PKEY *_privkey; /* private member */
} CPK_SIGNER_INFO;
DECLARE_STACK_OF(CPK_SIGNER_INFO)
DECLARE_ASN1_SET_OF(CPK_SIGNER_INFO)
DECLARE_ASN1_FUNCTIONS(CPK_SIGNER_INFO)
int CPK_SIGNER_INFO_set(CPK_SIGNER_INFO *si, const EVP_MD *sign_alg, const EVP_PKEY *sign_key);
int CPK_SIGNER_INFO_add_attr(CPK_SIGNER_INFO *si, int nid, int atrtype, void *value);
int CPK_SIGNER_INFO_add_signed_attr(CPK_SIGNER_INFO *si, int nid, int atrtype, void *value);
int CPK_SIGNER_INFO_add_signed_time(CPK_SIGNER_INFO *si);
int CPK_SIGNER_INFO_add_signed_digest(CPK_SIGNER_INFO *si, const EVP_MD_CTX *ctx);
ASN1_TYPE *CPK_SIGNER_INFO_get_attr(CPK_SIGNER_INFO *si, int nid);
ASN1_TYPE *CPK_SIGNER_INFO_get_signed_attr(CPK_SIGNER_INFO *si, int nid);
ASN1_UTCTIME *CPK_SIGNER_INFO_get_signed_time(CPK_SIGNER_INFO *si);
int CPK_SIGNER_INFO_do_sign(CPK_SIGNER_INFO *si, EVP_MD_CTX *md_ctx);
int CPK_SIGNER_INFO_do_verify(const CPK_SIGNER_INFO *si, EVP_MD_CTX *ctx, const CPK_PUBLIC_PARAMS *params);
/*
* RecipientInfo ::= SEQUENCE {
* version INTEGER {0},
* recipient IssuerAndSerialNumber,
* keyEncryptionAlgor EncryptionAlgorithmIdentifier,
* encryptedKey OCTET STRING
* }
* RecipientInfos ::= SET OF RecipientInfo
*/
typedef struct cpk_recip_info_st {
long version;
X509_NAME *recipient;
X509_ALGOR *enc_algor;
ASN1_OCTET_STRING *enc_data;
/* private */
EVP_PKEY *_pubkey;
} CPK_RECIP_INFO;
DECLARE_STACK_OF(CPK_RECIP_INFO)
DECLARE_ASN1_SET_OF(CPK_RECIP_INFO)
DECLARE_ASN1_FUNCTIONS(CPK_RECIP_INFO)
int CPK_RECIP_INFO_set(CPK_RECIP_INFO *ri, const X509_NAME *recipient, const ECIES_PARAMS *ecies);
int CPK_RECIP_INFO_do_encrypt(CPK_RECIP_INFO *ri, const unsigned char *in, size_t inlen);
int CPK_RECIP_INFO_do_decrypt(CPK_RECIP_INFO *ri, const EVP_PKEY *pkey, unsigned char *out, size_t *outlen);
/*
* SingerInfos ::= SET OF SignerInfo
*
* SignedData ::= SEQUENCE {
* version INTEGER,
* digestAlgors DigestAlgorithmIdentifiers,
* contentInfo ContentInfo,
* signerInfos SignerInfos,
* }
*/
typedef struct cpk_signed_st {
long version;
STACK_OF(X509_ALGOR) *digest_algors;
STACK_OF(X509) *cert; /* [ 0 ] */
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
STACK_OF(CPK_SIGINFO) *signer_infos;
struct CPK_CMS_st *contents;
} CPK_SIGNED;
DECLARE_ASN1_FUNCTIONS(CPK_SIGNED)
typedef struct cpk_enc_content_st {
ASN1_OBJECT *content_type;
X509_ALGOR *enc_algor;
ASN1_OCTET_STRING *enc_data; /* [ 0 ] */
/* private */
const EVP_CIPHER *cipher;
} CPK_ENC_CONTENT;
DECLARE_ASN1_FUNCTIONS(CPK_ENC_CONTENT)
typedef struct cpk_envelope_st {
long version;
STACK_OF(CPK_RECIP_INFO) *recip_infos;
CPK_ENC_CONTENT *enc_data;
} CPK_ENVELOPE;
DECLARE_ASN1_FUNCTIONS(CPK_ENVELOPE)
typedef struct cpk_sign_envelope_st {
long version;
STACK_OF(X509_ALGOR) *digest_algors;
STACK_OF(X509) *cert; /* [ 0 ] */
STACK_OF(X509_CRL) *crl; /* [ 1 ] */
STACK_OF(CPK_SIGNER_INFO) *signer_infos;
CPK_ENC_CONTENT *enc_data;
STACK_OF(CPK_RECIP_INFO) *recip_infos;
} CPK_SIGN_ENVELOPE;
DECLARE_ASN1_FUNCTIONS(CPK_SIGN_ENVELOPE)
typedef struct cpk_cms_st {
int state; /* used during processing */
int detached;
ASN1_OBJECT *type;
union {
char *ptr;
/* NID_pkcs7_data */
ASN1_OCTET_STRING *data;
/* NID_pkcs7_signed */
CPK_SIGNED *sign;
/* NID_pkcs7_enveloped */
CPK_ENVELOPE *enveloped;
/* NID_pkcs7_signedAndEnveloped */
CPK_SIGN_ENVELOPE *signed_and_enveloped;
/* Anything else */
ASN1_TYPE *other;
} d;
} CPK_CMS;
DECLARE_STACK_OF(CPK_CMS)
DECLARE_ASN1_SET_OF(CPK_CMS)
DECLARE_PKCS12_STACK_OF(CPK_CMS)
DECLARE_ASN1_FUNCTIONS(CPK_CMS)
DECLARE_ASN1_ITEM(CPK_CMS_ATTR_SIGN)
DECLARE_ASN1_ITEM(CPK_CMS_ATTR_VERIFY)
DECLARE_ASN1_NDEF_FUNCTION(CPK_CMS)
#define CPK_CMS_OP_SET_DETACHED_SIGNATURE 1
#define CPK_CMS_OP_GET_DETACHED_SIGNATURE 2
#define CPK_CMS_get_signed_attributes(si) ((si)->auth_attr)
#define CPK_CMS_get_attributes(si) ((si)->unauth_attr)
#define CPK_CMS_type_is_signed(a) \
(OBJ_obj2nid((a)->type) == NID_pkcs7_signed)
#define CPK_CMS_type_is_enveloped(a) \
(OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)
#define CPK_CMS_type_is_signedAndEnveloped(a) \
(OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)
#define CPK_CMS_type_is_data(a) \
(OBJ_obj2nid((a)->type) == NID_pkcs7_data)
#define CPK_CMS_set_detached(p,v) \
CPK_CMS_ctrl(p,CPK_CMS_OP_SET_DETACHED_SIGNATURE,v,NULL)
#define CPK_CMS_get_detached(p) \
CPK_CMS_ctrl(p,CPK_CMS_OP_GET_DETACHED_SIGNATURE,0,NULL)
#define CPK_CMS_is_detached(p7) \
(CPK_CMS_type_is_signed(p7) && CPK_CMS_get_detached(p7))
long CPK_CMS_ctrl(CPK_CMS *p7, int cmd, long larg, char *parg);
int CPK_CMS_set_type(CPK_CMS *p7, int type);
int CPK_CMS_set_cipher(CPK_CMS *p7, const EVP_CIPHER *cipher);
int CPK_CMS_set_content(CPK_CMS *p7, CPK_CMS *p7_data);
int CPK_CMS_content_new(CPK_CMS *p7, int type);
int CPK_CMS_add_signer(CPK_CMS *p7, const EVP_MD *sign_alg, const EVP_PKEY *sign_key);
int CPK_CMS_add_recipient(CPK_CMS *p7, const X509_NAME *id, const ECIES_PARAMS *params);
BIO *CPK_CMS_dataInit(CPK_CMS *p7, BIO *bio);
BIO *CPK_CMS_dataDecode(CPK_CMS *p7, BIO *in_bio, const EVP_PKEY *keyinfo);
int CPK_CMS_dataUpdate(CPK_CMS *p7, BIO *bio, const unsigned char *data, int len);
int CPK_CMS_dataFinal(CPK_CMS *p7, BIO *bio);
STACK_OF(CPK_SIGNER_INFO) *CPK_CMS_get_signer_infos(CPK_CMS *p7);
int CPK_CMS_dataVerify(CPK_PUBLIC_PARAMS *params, BIO *bio, CPK_CMS *p7, CPK_SIGNER_INFO *si);
/* ERR function (should in openssl/err.h) begin */
#define ERR_LIB_CPK 130
#define ERR_R_CPK_LIB ERR_LIB_CPK
#define CPKerr(f,r) ERR_PUT_error(ERR_LIB_CPK,(f),(r),__FILE__,__LINE__)
/* end */
void ERR_load_CPK_strings(void);
/**
* @defgroup error_cpk Definations to handle errors of cpk runtime.
* @{
*/
/* Error codes for the ECIES functions. */
/* Error codes for the CPK functions. */
/* Function codes. */
#define CPK_F_CPK_MASTER_SECRET_CREATE 100
#define CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS 101
#define CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY 102
#define CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY 103
#define CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY 116
#define CPK_F_CPK_MASTER_SECRET_DIGEST 104
#define CPK_F_CPK_PUBLIC_PARAMS_DIGEST 105
#define CPK_F_CPK_MASTER_SECRET_PRINT 106
#define CPK_F_CPK_PUBLIC_PARAMS_PRINT 107
#define CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS 108
#define CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY 109
#define CPK_F_CPK_MAP_NEW_DEFAULT 110
#define CPK_F_CPK_MAP_NUM_FACTORS 111
#define CPK_F_CPK_MAP_NUM_INDEXES 112
#define CPK_F_CPK_MAP_STR2INDEX 113
#define CPK_F_X509_ALGOR_GET1_EC_KEY 114
#define CPK_F_X509_ALGOR_GET1_DSA 115
# define CPK_F_CPK_MAP_NEW_DEFAULT 100
# define CPK_F_CPK_MAP_NUM_FACTORS 101
# define CPK_F_CPK_MAP_NUM_INDEXES 102
# define CPK_F_CPK_MAP_STR2INDEX 103
# define CPK_F_CPK_MASTER_SECRET_CREATE 104
# define CPK_F_CPK_MASTER_SECRET_DIGEST 105
# define CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY 106
# define CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS 107
# define CPK_F_CPK_MASTER_SECRET_PRINT 108
# define CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS 109
# define CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY 110
# define CPK_F_CPK_PUBLIC_PARAMS_DIGEST 111
# define CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY 112
# define CPK_F_CPK_PUBLIC_PARAMS_PRINT 113
# define CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY 114
# define CPK_F_X509_ALGOR_GET1_DSA 115
# define CPK_F_X509_ALGOR_GET1_EC_KEY 116
/* Reason codes. */
#define CPK_R_BAD_ARGUMENT 100
#define CPK_R_UNKNOWN_DIGEST_TYPE 101
#define CPK_R_UNKNOWN_CIPHER_TYPE 102
#define CPK_R_UNKNOWN_MAP_TYPE 103
#define CPK_R_UNKNOWN_CURVE 104
#define CPK_R_STACK_ERROR 105
#define CPK_R_DERIVE_KEY_FAILED 106
#define CPK_R_ECIES_ENCRYPT_FAILED 107
#define CPK_R_ECIES_DECRYPT_FAILED 108
#define CPK_R_DER_DECODE_FAILED 109
#define CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE 110
#define CPK_R_SET_SIGNER 111
#define CPK_R_SET_RECIP_INFO 112
#define CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST 113
#define CPK_R_BAD_DATA 114
#define CPK_R_MAP_FAILED 115
#define CPK_R_ADD_SIGNING_TIME 116
#define CPK_R_VERIFY_FAILED 117
#define CPK_R_UNKNOWN_ECDH_TYPE 118
#define CPK_R_DIGEST_FAILED 119
#define CPK_R_WITHOUT_DECRYPT_KEY 120
#define CPK_R_UNKNOWN_PKCS7_TYPE 121
#define CPK_R_INVALID_ID_LENGTH 122
#define CPK_R_INVALID_PKEY_TYPE 123
#define CPK_R_INVALID_MAP_ALGOR 124
#define CPK_R_PKEY_TYPE_NOT_MATCH 125
# define CPK_R_ADD_SIGNING_TIME 100
# define CPK_R_BAD_ARGUMENT 101
# define CPK_R_BAD_DATA 102
# define CPK_R_DERIVE_KEY_FAILED 103
# define CPK_R_DER_DECODE_FAILED 104
# define CPK_R_DIGEST_FAILED 105
# define CPK_R_ECIES_DECRYPT_FAILED 106
# define CPK_R_ECIES_ENCRYPT_FAILED 107
# define CPK_R_INVALID_ID_LENGTH 108
# define CPK_R_INVALID_MAP_ALGOR 109
# define CPK_R_INVALID_PKEY_TYPE 110
# define CPK_R_MAP_FAILED 111
# define CPK_R_PKEY_TYPE_NOT_MATCH 112
# define CPK_R_SET_RECIP_INFO 113
# define CPK_R_SET_SIGNER 114
# define CPK_R_STACK_ERROR 115
# define CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST 116
# define CPK_R_UNKNOWN_CIPHER_TYPE 117
# define CPK_R_UNKNOWN_CURVE 118
# define CPK_R_UNKNOWN_DIGEST_TYPE 119
# define CPK_R_UNKNOWN_ECDH_TYPE 120
# define CPK_R_UNKNOWN_MAP_TYPE 121
# define CPK_R_UNKNOWN_PKCS7_TYPE 122
# define CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE 123
# define CPK_R_VERIFY_FAILED 124
# define CPK_R_WITHOUT_DECRYPT_KEY 125
/**
* @}
*/
#ifdef __cplusplus
}
#endif

View File

@@ -89,87 +89,3 @@ int i2d_CPK_PUBLIC_PARAMS_bio(BIO *bp, CPK_PUBLIC_PARAMS *params) {
return ASN1_item_i2d_bio(ASN1_ITEM_rptr(CPK_PUBLIC_PARAMS), bp, params);
}
#if 0
/* This is the ANY DEFINED BY table for the top level PKCS#7 structure */
ASN1_ADB_TEMPLATE(cpkcmsdefault) = ASN1_EXP_OPT(CPK_CMS, d.other, ASN1_ANY, 0);
ASN1_ADB(CPK_CMS) = {
ADB_ENTRY(NID_pkcs7_data, ASN1_NDEF_EXP_OPT(CPK_CMS, d.data, ASN1_OCTET_STRING_NDEF, 0)),
ADB_ENTRY(NID_pkcs7_signed, ASN1_NDEF_EXP_OPT(CPK_CMS, d.sign, CPK_SIGNED, 0)),
ADB_ENTRY(NID_pkcs7_enveloped, ASN1_NDEF_EXP_OPT(CPK_CMS, d.enveloped, CPK_ENVELOPE, 0)),
ADB_ENTRY(NID_pkcs7_signedAndEnveloped,
ASN1_NDEF_EXP_OPT(CPK_CMS, d.signed_and_enveloped, CPK_SIGN_ENVELOPE, 0)),
} ASN1_ADB_END(CPK_CMS, 0, type, 0, &cpkcmsdefault_tt, NULL);
ASN1_NDEF_SEQUENCE(CPK_CMS) = {
ASN1_SIMPLE(CPK_CMS, type, ASN1_OBJECT),
ASN1_ADB_OBJECT(CPK_CMS)
}ASN1_NDEF_SEQUENCE_END(CPK_CMS)
IMPLEMENT_ASN1_FUNCTIONS(CPK_CMS)
IMPLEMENT_ASN1_NDEF_FUNCTION(CPK_CMS)
IMPLEMENT_ASN1_DUP_FUNCTION(CPK_CMS)
ASN1_NDEF_SEQUENCE(CPK_SIGNED) = {
ASN1_SIMPLE(CPK_SIGNED, version, LONG),
ASN1_SET_OF(CPK_SIGNED, digest_algors, X509_ALGOR),
ASN1_SIMPLE(CPK_SIGNED, contents, CPK_CMS),
ASN1_IMP_SEQUENCE_OF_OPT(CPK_SIGNED, cert, X509, 0),
ASN1_IMP_SET_OF_OPT(CPK_SIGNED, crl, X509_CRL, 1),
ASN1_SET_OF(CPK_SIGNED, signer_infos, CPK_SIGNER_INFO)
} ASN1_NDEF_SEQUENCE_END(CPK_SIGNED)
IMPLEMENT_ASN1_FUNCTIONS(CPK_SIGNED)
ASN1_SEQUENCE(CPK_SIGNER_INFO) = {
ASN1_SIMPLE(CPK_SIGNER_INFO, version, LONG),
ASN1_SIMPLE(CPK_SIGNER_INFO, signer, X509_NAME),
ASN1_SIMPLE(CPK_SIGNER_INFO, digest_algor, X509_ALGOR),
ASN1_IMP_SEQUENCE_OF_OPT(CPK_SIGNER_INFO, signed_attr, X509_ATTRIBUTE, 0),
ASN1_SIMPLE(CPK_SIGNER_INFO, sign_algor, X509_ALGOR),
ASN1_SIMPLE(CPK_SIGNER_INFO, signature, ASN1_OCTET_STRING),
ASN1_IMP_SET_OF_OPT(CPK_SIGNER_INFO, unsigned_attr, X509_ATTRIBUTE, 1)
} ASN1_SEQUENCE_END(CPK_SIGNER_INFO)
IMPLEMENT_ASN1_FUNCTIONS(CPK_SIGNER_INFO)
IMPLEMENT_ASN1_DUP_FUNCTION(CPK_SIGNER_INFO)
ASN1_NDEF_SEQUENCE(CPK_ENVELOPE) = {
ASN1_SIMPLE(CPK_ENVELOPE, version, LONG),
ASN1_SET_OF(CPK_ENVELOPE, recip_infos, CPK_RECIP_INFO),
ASN1_SIMPLE(CPK_ENVELOPE, enc_data, CPK_ENC_CONTENT)
} ASN1_NDEF_SEQUENCE_END(CPK_ENVELOPE)
IMPLEMENT_ASN1_FUNCTIONS(CPK_ENVELOPE)
ASN1_SEQUENCE(CPK_RECIP_INFO) = {
ASN1_SIMPLE(CPK_RECIP_INFO, version, LONG),
ASN1_SIMPLE(CPK_RECIP_INFO, recipient, X509_NAME),
ASN1_SIMPLE(CPK_RECIP_INFO, enc_algor, X509_ALGOR),
ASN1_SIMPLE(CPK_RECIP_INFO, enc_data, ASN1_OCTET_STRING)
} ASN1_SEQUENCE_END(CPK_RECIP_INFO)
IMPLEMENT_ASN1_FUNCTIONS(CPK_RECIP_INFO)
IMPLEMENT_ASN1_DUP_FUNCTION(CPK_RECIP_INFO)
ASN1_NDEF_SEQUENCE(CPK_ENC_CONTENT) = {
ASN1_SIMPLE(CPK_ENC_CONTENT, content_type, ASN1_OBJECT),
ASN1_SIMPLE(CPK_ENC_CONTENT, enc_algor, X509_ALGOR),
ASN1_IMP_OPT(CPK_ENC_CONTENT, enc_data, ASN1_OCTET_STRING, 0)
} ASN1_NDEF_SEQUENCE_END(CPK_ENC_CONTENT)
IMPLEMENT_ASN1_FUNCTIONS(CPK_ENC_CONTENT)
ASN1_NDEF_SEQUENCE(CPK_SIGN_ENVELOPE) = {
ASN1_SIMPLE(CPK_SIGN_ENVELOPE, version, LONG),
ASN1_SET_OF(CPK_SIGN_ENVELOPE, recip_infos, CPK_RECIP_INFO),
ASN1_SET_OF(CPK_SIGN_ENVELOPE, digest_algors, X509_ALGOR),
ASN1_SIMPLE(CPK_SIGN_ENVELOPE, enc_data, CPK_ENC_CONTENT),
ASN1_IMP_SET_OF_OPT(CPK_SIGN_ENVELOPE, cert, X509, 0),
ASN1_IMP_SET_OF_OPT(CPK_SIGN_ENVELOPE, crl, X509_CRL, 1),
ASN1_SET_OF(CPK_SIGN_ENVELOPE, signer_infos, CPK_SIGNER_INFO)
} ASN1_NDEF_SEQUENCE_END(CPK_SIGN_ENVELOPE)
IMPLEMENT_ASN1_FUNCTIONS(CPK_SIGN_ENVELOPE)
#endif

View File

@@ -1,6 +1,6 @@
/* crypto/cpk/cpk_err.c */
/* ====================================================================
* Copyright (c) 2007 - 2015 The GmSSL Project. All rights reserved.
* Copyright (c) 1999-2016 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
@@ -16,27 +16,27 @@
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the GmSSL Project.
* (http://gmssl.org/)"
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
* 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 "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
* 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 GmSSL Project
* (http://gmssl.org/)"
* "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 GmSSL PROJECT ``AS IS'' AND ANY
* 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 GmSSL PROJECT OR
* 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;
@@ -47,68 +47,85 @@
* 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "cpk.h"
#include <openssl/cpk.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CPK,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CPK,0,reason)
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_CPK,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_CPK,0,reason)
static ERR_STRING_DATA CPK_str_functs[] =
{
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_CREATE), "CPK_MASTER_SECRET_create"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS), "CPK_MASTER_SECRET_extract_public_params"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY), "CPK_MASTER_SECRET_extract_private_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY), "CPK_PUBLIC_PARAMS_extract_public_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY), "CPK_PUBLIC_PARAMS_compute_share_key"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_DIGEST), "CPK_F_CPK_MASTER_SECRET_digest"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_DIGEST), "CPK_F_CPK_PUBLIC_PARAMS_digest"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_PRINT), "CPK_F_CPK_MASTER_SECRET_print"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_PRINT), "CPK_F_CPK_PUBLIC_PARAMS_print"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS), "CPK_F_CPK_MASTER_SECRET_validate_public_params"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY), "CPK_F_CPK_PUBLIC_PARAMS_validate_private_key"},
{ERR_FUNC(CPK_F_CPK_MAP_NEW_DEFAULT), "CPK_F_CPK_MAP_new_default"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_FACTORS), "CPK_F_CPK_MAP_num_factors"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_INDEXES), "CPK_F_CPK_MAP_num_indexes"},
{ERR_FUNC(CPK_F_CPK_MAP_STR2INDEX), "CPK_F_CPK_MAP_STR2INDEX"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_EC_KEY), "X509_ALGOR_get1_ec_key"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_DSA), "X509_ALGOR_get1_dsa"},
{0, NULL}
static ERR_STRING_DATA CPK_str_functs[] = {
{ERR_FUNC(CPK_F_CPK_MAP_NEW_DEFAULT), "CPK_MAP_new_default"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_FACTORS), "CPK_MAP_num_factors"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_INDEXES), "CPK_MAP_num_indexes"},
{ERR_FUNC(CPK_F_CPK_MAP_STR2INDEX), "CPK_MAP_str2index"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_CREATE), "CPK_MASTER_SECRET_create"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_DIGEST), "CPK_MASTER_SECRET_digest"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY),
"CPK_MASTER_SECRET_extract_private_key"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS),
"CPK_MASTER_SECRET_extract_public_params"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_PRINT), "CPK_MASTER_SECRET_print"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS),
"CPK_MASTER_SECRET_validate_public_params"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY),
"CPK_PUBLIC_PARAMS_compute_share_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_DIGEST), "CPK_PUBLIC_PARAMS_digest"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY),
"CPK_PUBLIC_PARAMS_extract_public_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_PRINT), "CPK_PUBLIC_PARAMS_print"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY),
"CPK_PUBLIC_PARAMS_validate_private_key"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_DSA), "X509_ALGOR_GET1_DSA"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_EC_KEY), "X509_ALGOR_GET1_EC_KEY"},
{0, NULL}
};
static ERR_STRING_DATA CPK_str_reasons[] =
{
{ERR_REASON(CPK_R_BAD_ARGUMENT), "bad argument"},
{ERR_REASON(CPK_R_UNKNOWN_DIGEST_TYPE), "unknown digest algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_CIPHER_TYPE), "unknown cipher algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_MAP_TYPE), "unknown cpk map algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_CURVE), "unknown elliptic curve"},
{ERR_REASON(CPK_R_STACK_ERROR), "stack error"},
{ERR_REASON(CPK_R_DERIVE_KEY_FAILED), "derive key failed"},
{ERR_REASON(CPK_R_ECIES_ENCRYPT_FAILED), "ecies encryption failed"},
{ERR_REASON(CPK_R_ECIES_DECRYPT_FAILED), "ecies decryption failed"},
{ERR_REASON(CPK_R_DER_DECODE_FAILED), "DER decode failed"},
{ERR_REASON(CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE),"CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE"},
{ERR_REASON(CPK_R_SET_SIGNER), "CPK_R_SET_SIGNER"},
{ERR_REASON(CPK_R_SET_RECIP_INFO), "CPK_R_SET_RECIP_INFO"},
{ERR_REASON(CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST),"CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST"},
{ERR_REASON(CPK_R_BAD_DATA), "bad data"},
{ERR_REASON(CPK_R_MAP_FAILED), "CPK_R_MAP_FAILED"},
{ERR_REASON(CPK_R_ADD_SIGNING_TIME), "CPK_R_ADD_SIGNING_TIME"},
{ERR_REASON(CPK_R_VERIFY_FAILED), "CPK_R_VERIFY_FAILED"},
{ERR_REASON(CPK_R_UNKNOWN_ECDH_TYPE), "CPK_R_UNKNOWN_ECDH_TYPE"},
{ERR_REASON(CPK_R_DIGEST_FAILED), "CPK_R_DIGEST_FAILED"},
{ERR_REASON(CPK_R_WITHOUT_DECRYPT_KEY), "CPK_R_WITHOUT_DECRYPT_KEY"},
{ERR_REASON(CPK_R_UNKNOWN_PKCS7_TYPE), "CPK_R_UNKNOWN_PKCS7_TYPE"},
{ERR_REASON(CPK_R_INVALID_ID_LENGTH), "invalid identity length"},
{ERR_REASON(CPK_R_INVALID_PKEY_TYPE), "invalid public key type"},
{ERR_REASON(CPK_R_INVALID_MAP_ALGOR), "invalid map algorithm"},
{ERR_REASON(CPK_R_PKEY_TYPE_NOT_MATCH), "public key type not match"},
{0, NULL}
static ERR_STRING_DATA CPK_str_reasons[] = {
{ERR_REASON(CPK_R_ADD_SIGNING_TIME), "add signing time"},
{ERR_REASON(CPK_R_BAD_ARGUMENT), "bad argument"},
{ERR_REASON(CPK_R_BAD_DATA), "bad data"},
{ERR_REASON(CPK_R_DERIVE_KEY_FAILED), "derive key failed"},
{ERR_REASON(CPK_R_DER_DECODE_FAILED), "der decode failed"},
{ERR_REASON(CPK_R_DIGEST_FAILED), "digest failed"},
{ERR_REASON(CPK_R_ECIES_DECRYPT_FAILED), "ecies decrypt failed"},
{ERR_REASON(CPK_R_ECIES_ENCRYPT_FAILED), "ecies encrypt failed"},
{ERR_REASON(CPK_R_INVALID_ID_LENGTH), "invalid id length"},
{ERR_REASON(CPK_R_INVALID_MAP_ALGOR), "invalid map algor"},
{ERR_REASON(CPK_R_INVALID_PKEY_TYPE), "invalid pkey type"},
{ERR_REASON(CPK_R_MAP_FAILED), "map failed"},
{ERR_REASON(CPK_R_PKEY_TYPE_NOT_MATCH), "pkey type not match"},
{ERR_REASON(CPK_R_SET_RECIP_INFO), "set recip info"},
{ERR_REASON(CPK_R_SET_SIGNER), "set signer"},
{ERR_REASON(CPK_R_STACK_ERROR), "stack error"},
{ERR_REASON(CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST),
"unable to find message digest"},
{ERR_REASON(CPK_R_UNKNOWN_CIPHER_TYPE), "unknown cipher type"},
{ERR_REASON(CPK_R_UNKNOWN_CURVE), "unknown curve"},
{ERR_REASON(CPK_R_UNKNOWN_DIGEST_TYPE), "unknown digest type"},
{ERR_REASON(CPK_R_UNKNOWN_ECDH_TYPE), "unknown ecdh type"},
{ERR_REASON(CPK_R_UNKNOWN_MAP_TYPE), "unknown map type"},
{ERR_REASON(CPK_R_UNKNOWN_PKCS7_TYPE), "unknown pkcs7 type"},
{ERR_REASON(CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE),
"unsupported pkcs7 content type"},
{ERR_REASON(CPK_R_VERIFY_FAILED), "verify failed"},
{ERR_REASON(CPK_R_WITHOUT_DECRYPT_KEY), "without decrypt key"},
{0, NULL}
};
#endif
@@ -117,10 +134,9 @@ void ERR_load_CPK_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CPK_str_functs[0].error) == NULL) {
ERR_load_strings(0, CPK_str_functs);
ERR_load_strings(0, CPK_str_reasons);
}
if (ERR_func_error_string(CPK_str_functs[0].error) == NULL) {
ERR_load_strings(0, CPK_str_functs);
ERR_load_strings(0, CPK_str_reasons);
}
#endif
}

126
crypto/cpk/cpk_err2.c Normal file
View File

@@ -0,0 +1,126 @@
/* crypto/cpk/cpk_err.c */
/* ====================================================================
* Copyright (c) 2007 - 2015 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <openssl/err.h>
#include "cpk.h"
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_CPK,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_CPK,0,reason)
static ERR_STRING_DATA CPK_str_functs[] =
{
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_CREATE), "CPK_MASTER_SECRET_create"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS), "CPK_MASTER_SECRET_extract_public_params"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY), "CPK_MASTER_SECRET_extract_private_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY), "CPK_PUBLIC_PARAMS_extract_public_key"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_COMPUTE_SHARE_KEY), "CPK_PUBLIC_PARAMS_compute_share_key"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_DIGEST), "CPK_F_CPK_MASTER_SECRET_digest"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_DIGEST), "CPK_F_CPK_PUBLIC_PARAMS_digest"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_PRINT), "CPK_F_CPK_MASTER_SECRET_print"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_PRINT), "CPK_F_CPK_PUBLIC_PARAMS_print"},
{ERR_FUNC(CPK_F_CPK_MASTER_SECRET_VALIDATE_PUBLIC_PARAMS), "CPK_F_CPK_MASTER_SECRET_validate_public_params"},
{ERR_FUNC(CPK_F_CPK_PUBLIC_PARAMS_VALIDATE_PRIVATE_KEY), "CPK_F_CPK_PUBLIC_PARAMS_validate_private_key"},
{ERR_FUNC(CPK_F_CPK_MAP_NEW_DEFAULT), "CPK_F_CPK_MAP_new_default"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_FACTORS), "CPK_F_CPK_MAP_num_factors"},
{ERR_FUNC(CPK_F_CPK_MAP_NUM_INDEXES), "CPK_F_CPK_MAP_num_indexes"},
{ERR_FUNC(CPK_F_CPK_MAP_STR2INDEX), "CPK_F_CPK_MAP_STR2INDEX"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_EC_KEY), "X509_ALGOR_get1_ec_key"},
{ERR_FUNC(CPK_F_X509_ALGOR_GET1_DSA), "X509_ALGOR_get1_dsa"},
{0, NULL}
};
static ERR_STRING_DATA CPK_str_reasons[] =
{
{ERR_REASON(CPK_R_BAD_ARGUMENT), "bad argument"},
{ERR_REASON(CPK_R_UNKNOWN_DIGEST_TYPE), "unknown digest algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_CIPHER_TYPE), "unknown cipher algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_MAP_TYPE), "unknown cpk map algorithm"},
{ERR_REASON(CPK_R_UNKNOWN_CURVE), "unknown elliptic curve"},
{ERR_REASON(CPK_R_STACK_ERROR), "stack error"},
{ERR_REASON(CPK_R_DERIVE_KEY_FAILED), "derive key failed"},
{ERR_REASON(CPK_R_ECIES_ENCRYPT_FAILED), "ecies encryption failed"},
{ERR_REASON(CPK_R_ECIES_DECRYPT_FAILED), "ecies decryption failed"},
{ERR_REASON(CPK_R_DER_DECODE_FAILED), "DER decode failed"},
{ERR_REASON(CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE),"CPK_R_UNSUPPORTED_PKCS7_CONTENT_TYPE"},
{ERR_REASON(CPK_R_SET_SIGNER), "CPK_R_SET_SIGNER"},
{ERR_REASON(CPK_R_SET_RECIP_INFO), "CPK_R_SET_RECIP_INFO"},
{ERR_REASON(CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST),"CPK_R_UNABLE_TO_FIND_MESSAGE_DIGEST"},
{ERR_REASON(CPK_R_BAD_DATA), "bad data"},
{ERR_REASON(CPK_R_MAP_FAILED), "CPK_R_MAP_FAILED"},
{ERR_REASON(CPK_R_ADD_SIGNING_TIME), "CPK_R_ADD_SIGNING_TIME"},
{ERR_REASON(CPK_R_VERIFY_FAILED), "CPK_R_VERIFY_FAILED"},
{ERR_REASON(CPK_R_UNKNOWN_ECDH_TYPE), "CPK_R_UNKNOWN_ECDH_TYPE"},
{ERR_REASON(CPK_R_DIGEST_FAILED), "CPK_R_DIGEST_FAILED"},
{ERR_REASON(CPK_R_WITHOUT_DECRYPT_KEY), "CPK_R_WITHOUT_DECRYPT_KEY"},
{ERR_REASON(CPK_R_UNKNOWN_PKCS7_TYPE), "CPK_R_UNKNOWN_PKCS7_TYPE"},
{ERR_REASON(CPK_R_INVALID_ID_LENGTH), "invalid identity length"},
{ERR_REASON(CPK_R_INVALID_PKEY_TYPE), "invalid public key type"},
{ERR_REASON(CPK_R_INVALID_MAP_ALGOR), "invalid map algorithm"},
{ERR_REASON(CPK_R_PKEY_TYPE_NOT_MATCH), "public key type not match"},
{0, NULL}
};
#endif
void ERR_load_CPK_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(CPK_str_functs[0].error) == NULL) {
ERR_load_strings(0, CPK_str_functs);
ERR_load_strings(0, CPK_str_reasons);
}
#endif
}

View File

@@ -250,7 +250,7 @@ CPK_PUBLIC_PARAMS *CPK_MASTER_SECRET_extract_public_params(CPK_MASTER_SECRET *ma
break;
default:
CPKerr(CPK_F_CPK_MASTER_SECRET_CREATE, CPK_R_INVALID_PKEY_TYPE);
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS, CPK_R_INVALID_PKEY_TYPE);
goto err;
}
return param;
@@ -562,34 +562,24 @@ static int extract_dsa_params(CPK_MASTER_SECRET *master, CPK_PUBLIC_PARAMS *para
unsigned char *pub_ptr;
if (!pri || !pub || !ctx) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!(dsa = (DSA *)X509_ALGOR_get1_DSA(master->pkey_algor))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_BAD_DATA);
goto err;
}
pri_size = BN_num_bytes(dsa->q);
pub_size = BN_num_bytes(dsa->p);
if ((num_factors = CPK_MAP_num_factors(master->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (M_ASN1_STRING_length(master->secret_factors) != pri_size * num_factors) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_BAD_DATA);
goto err;
}
ASN1_STRING_free(param->public_factors);
if (!ASN1_STRING_set(param->public_factors, NULL, pub_size * num_factors)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -600,24 +590,16 @@ static int extract_dsa_params(CPK_MASTER_SECRET *master, CPK_PUBLIC_PARAMS *para
for (i = 0; i < num_factors; i++) {
if (!BN_bin2bn(pri_ptr, pri_size, pri)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(pri) || BN_cmp(pri, dsa->q) >= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_BAD_DATA);
goto err;
}
if (!BN_mod_exp(pub, dsa->g, pri, dsa->p, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_BN_LIB);
goto err;
}
if (!BN_bn2bin(pub, pub_ptr + pub_size - BN_num_bytes(pub))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_BN_LIB);
goto err;
}
@@ -646,35 +628,23 @@ static DSA *extract_dsa_priv_key(CPK_MASTER_SECRET *master, const char *id)
if (!bn || !ctx) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!(dsa = X509_ALGOR_get1_DSA(master->pkey_algor))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_BAD_DATA);
goto err;
}
if ((num_indexes = CPK_MAP_num_indexes(master->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!(index = OPENSSL_malloc(sizeof(int) * num_indexes))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!CPK_MAP_str2index(master->map_algor, id, index)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!dsa->priv_key) {
if (!(dsa->priv_key = BN_new())) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
}
@@ -684,30 +654,21 @@ static DSA *extract_dsa_priv_key(CPK_MASTER_SECRET *master, const char *id)
for (i = 0; i < num_indexes; i++) {
p = M_ASN1_STRING_data(master->secret_factors) + bn_size * index[i];
if (!BN_bin2bn(p, bn_size, bn)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(bn) || BN_cmp(bn, dsa->q) >= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_BAD_DATA);
goto err;
}
if (!BN_mod_add(dsa->priv_key, dsa->priv_key, bn, dsa->q, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_X509_LIB);
goto err;
}
}
if (!(dsa->pub_key))
if (!(dsa->pub_key = BN_new())) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!BN_mod_exp(dsa->pub_key, dsa->g, dsa->priv_key, dsa->p, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY, ERR_R_BN_LIB);
goto err;
}
e = 0;
@@ -735,35 +696,23 @@ static DSA *extract_dsa_pub_key(CPK_PUBLIC_PARAMS *param, const char *id)
if (!bn || !ctx) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!(dsa = X509_ALGOR_get1_DSA(param->pkey_algor))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_BAD_DATA);
goto err;
}
if ((num_indexes = CPK_MAP_num_indexes(param->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!(index = OPENSSL_malloc(sizeof(int) * num_indexes))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!CPK_MAP_str2index(param->map_algor, id, index)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!dsa->pub_key) {
if (!(dsa->pub_key = BN_new())) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
}
@@ -773,18 +722,12 @@ static DSA *extract_dsa_pub_key(CPK_PUBLIC_PARAMS *param, const char *id)
for (i = 0; i < num_indexes; i++) {
p = M_ASN1_STRING_data(param->public_factors) + bn_size * index[i];
if (!BN_bin2bn(p, bn_size, bn)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(bn) || BN_cmp(bn, dsa->p) >= 0) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_BAD_DATA);
goto err;
}
if (!BN_mod_add(dsa->pub_key, dsa->pub_key, bn, dsa->p, ctx)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_X509_LIB);
goto err;
}
}
@@ -860,35 +803,26 @@ static int extract_ec_params(CPK_MASTER_SECRET *master, CPK_PUBLIC_PARAMS *param
unsigned char *pt_ptr;
if (!bn || !order || !ctx) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!(ec_key = X509_ALGOR_get1_EC_KEY(master->pkey_algor))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS, CPK_R_BAD_DATA);
goto err;
}
ec_group = EC_KEY_get0_group(ec_key);
if (!(EC_GROUP_get_order(ec_group, order, ctx))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS, ERR_R_EC_LIB);
goto err;
}
bn_size = BN_num_bytes(order);
pt_size = bn_size + 1;
if ((num_factors = CPK_MAP_num_factors(master->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (M_ASN1_STRING_length(master->secret_factors) != bn_size * num_factors) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS, CPK_R_BAD_DATA);
goto err;
}
if (!ASN1_STRING_set(param->public_factors, NULL, pt_size * num_factors)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_MALLOC_FAILURE);
goto err;
}
@@ -897,30 +831,21 @@ static int extract_ec_params(CPK_MASTER_SECRET *master, CPK_PUBLIC_PARAMS *param
memset(pt_ptr, 0, M_ASN1_STRING_length(param->public_factors));
if (!(pt = EC_POINT_new(ec_group))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS, ERR_R_X509_LIB);
goto err;
}
for (i = 0; i < num_factors; i++) {
if (!BN_bin2bn(bn_ptr, bn_size, bn)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(bn) || BN_cmp(bn, order) >= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
CPK_R_BAD_DATA);
goto err;
}
if (!EC_POINT_mul(ec_group, pt, bn, NULL, NULL, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_EC_LIB);
goto err;
}
if (!EC_POINT_point2oct(ec_group, pt,
POINT_CONVERSION_COMPRESSED, pt_ptr, pt_size, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PUBLIC_PARAMS,
ERR_R_EC_LIB);
goto err;
}
bn_ptr += bn_size;
@@ -954,41 +879,29 @@ static EC_KEY *extract_ec_priv_key(CPK_MASTER_SECRET *master, const char *id)
if (!priv_key || !bn || !order || !ctx) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if (!(ec_key = X509_ALGOR_get1_EC_KEY(master->pkey_algor))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY, ERR_R_CPK_LIB);
goto err;
}
ec_group = EC_KEY_get0_group(ec_key);
if (!(pub_key = EC_POINT_new(ec_group))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_MALLOC_FAILURE);
goto err;
}
if ((num_indexes = CPK_MAP_num_indexes(master->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!(index = OPENSSL_malloc(sizeof(int) * num_indexes))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!CPK_MAP_str2index(master->map_algor, id, index)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
BN_zero(priv_key);
if (!(EC_GROUP_get_order(EC_KEY_get0_group(ec_key), order, ctx))) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY, ERR_R_EC_LIB);
goto err;
}
bn_size = BN_num_bytes(order);
@@ -999,33 +912,23 @@ static EC_KEY *extract_ec_priv_key(CPK_MASTER_SECRET *master, const char *id)
bn_size * index[i];
if (!BN_bin2bn(p, bn_size, bn)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY, ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(bn) || BN_cmp(bn, order) >= 0) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
CPK_R_BAD_DATA);
goto err;
}
if (!BN_mod_add(priv_key, priv_key, bn, order, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY, ERR_R_BN_LIB);
goto err;
}
}
if (!EC_KEY_set_private_key(ec_key, priv_key)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_EC_LIB);
goto err;
}
if (!EC_POINT_mul(ec_group, pub_key, priv_key, NULL, NULL, ctx)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_EC_LIB);
goto err;
}
if (!EC_KEY_set_public_key(ec_key, pub_key)) {
CPKerr(CPK_F_CPK_MASTER_SECRET_EXTRACT_PRIVATE_KEY,
ERR_R_EC_LIB);
goto err;
}
e = 0;
@@ -1058,55 +961,39 @@ static EC_KEY *extract_ec_pub_key(CPK_PUBLIC_PARAMS *param, const char *id)
int i, bn_size, pt_size, num_indexes, num_factors;
if (!(ec_key = X509_ALGOR_get1_EC_KEY(param->pkey_algor))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_CPK_LIB);
goto err;
}
ec_group = EC_KEY_get0_group(ec_key);
if (!(pub_key = EC_POINT_new(ec_group))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY, ERR_R_EC_LIB);
goto err;
}
if (!(pt = EC_POINT_new(ec_group))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY, ERR_R_EC_LIB);
goto err;
}
if (!EC_GROUP_get_order(ec_group, order, ctx)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY, ERR_R_EC_LIB);
goto err;
}
bn_size = BN_num_bytes(order);
pt_size = bn_size + 1;
if ((num_factors = CPK_MAP_num_factors(param->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_CPK_LIB);
goto err;
}
if (M_ASN1_STRING_length(param->public_factors) != pt_size * num_factors) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_BAD_DATA);
goto err;
}
if ((num_indexes = CPK_MAP_num_indexes(param->map_algor)) <= 0) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!(index = OPENSSL_malloc(sizeof(int) * num_indexes))) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!CPK_MAP_str2index(param->map_algor, id, index)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_INVALID_MAP_ALGOR);
goto err;
}
if (!EC_POINT_set_to_infinity(ec_group, pub_key)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY, ERR_R_EC_LIB);
goto err;
}
for (i = 0; i < num_indexes; i++) {
@@ -1115,20 +1002,14 @@ static EC_KEY *extract_ec_pub_key(CPK_PUBLIC_PARAMS *param, const char *id)
pt_size * index[i];
if (!EC_POINT_oct2point(ec_group, pt, p, pt_size, ctx)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
CPK_R_BAD_DATA);
goto err;
}
if (!EC_POINT_add(ec_group, pub_key, pub_key, pt, ctx)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_EC_LIB);
goto err;
}
}
if (!EC_KEY_set_public_key(ec_key, pub_key)) {
CPKerr(CPK_F_CPK_PUBLIC_PARAMS_EXTRACT_PUBLIC_KEY,
ERR_R_EC_LIB);
goto err;
}
e = 0;

View File

@@ -85,11 +85,13 @@ dh_ameth.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dh_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dh_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
dh_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dh_ameth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dh_ameth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
dh_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dh_ameth.o: ../../include/openssl/opensslconf.h
dh_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dh_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dh_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dh_ameth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dh_ameth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dh_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dh_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
dh_ameth.o: dh_ameth.c
@@ -139,11 +141,13 @@ dh_kdf.o: ../../include/openssl/buffer.h ../../include/openssl/cms.h
dh_kdf.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_kdf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dh_kdf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dh_kdf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dh_kdf.o: ../../include/openssl/err.h ../../include/openssl/evp.h
dh_kdf.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
dh_kdf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dh_kdf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dh_kdf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
dh_kdf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dh_kdf.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
dh_kdf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_kdf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
dh_kdf.o: dh_kdf.c
@@ -161,14 +165,15 @@ dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dh_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dh_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dh_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dh_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dh_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
dh_lib.o: ../cryptlib.h dh_lib.c
dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dh_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dh_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dh_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dh_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dh_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dh_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h dh_lib.c
dh_pmeth.o: ../../e_os.h ../../include/openssl/asn1.h
dh_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
dh_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -176,12 +181,13 @@ dh_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
dh_pmeth.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
dh_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
dh_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
dh_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dh_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dh_pmeth.o: ../../include/openssl/opensslconf.h
dh_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
dh_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dh_pmeth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dh_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dh_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dh_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dh_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dh_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dh_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dh_pmeth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ../evp/evp_locl.h
dh_pmeth.o: dh_pmeth.c

View File

@@ -85,12 +85,13 @@ dsa_ameth.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
dsa_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dsa_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dsa_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
dsa_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dsa_ameth.o: ../../include/openssl/objects.h
dsa_ameth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
dsa_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dsa_ameth.o: ../../include/openssl/opensslconf.h
dsa_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dsa_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_ameth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dsa_ameth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dsa_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dsa_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
dsa_ameth.o: dsa_ameth.c
@@ -148,14 +149,15 @@ dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
dsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
dsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
dsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
dsa_lib.o: ../cryptlib.h dsa_lib.c
dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
dsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
dsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dsa_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dsa_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dsa_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h dsa_lib.c
dsa_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
dsa_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
dsa_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@@ -173,12 +175,13 @@ dsa_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
dsa_pmeth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
dsa_pmeth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
dsa_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
dsa_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
dsa_pmeth.o: ../../include/openssl/objects.h
dsa_pmeth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
dsa_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
dsa_pmeth.o: ../../include/openssl/opensslconf.h
dsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
dsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
dsa_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
dsa_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
dsa_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
dsa_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
dsa_pmeth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ../evp/evp_locl.h
dsa_pmeth.o: dsa_locl.h dsa_pmeth.c

View File

@@ -124,11 +124,13 @@ ec_ameth.o: ../../include/openssl/cms.h ../../include/openssl/crypto.h
ec_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ec_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ec_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ec_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ec_ameth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ec_ameth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ec_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ec_ameth.o: ../../include/openssl/opensslconf.h
ec_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ec_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ec_ameth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ec_ameth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ec_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ec_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
ec_ameth.o: ec_ameth.c
@@ -136,11 +138,12 @@ ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_asn1.o: ../../include/openssl/ec.h ../../include/openssl/err.h
ec_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ec_asn1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ec_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ec_asn1.o: ../../include/openssl/symhacks.h ec_asn1.c ec_lcl.h
ec_asn1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ec_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ec_asn1.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ec_asn1.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ec_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ec_asn1.o: ec_asn1.c ec_lcl.h
ec_check.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ec_check.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ec_check.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
@@ -209,13 +212,15 @@ ec_pmeth.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ec_pmeth.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ec_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ec_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ec_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ec_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ec_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
ec_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ec_pmeth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ec_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ec_pmeth.o: ../../include/openssl/opensslconf.h
ec_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ec_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ec_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ec_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ec_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ec_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ec_pmeth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ../evp/evp_locl.h
ec_pmeth.o: ec_lcl.h ec_pmeth.c

View File

@@ -1264,32 +1264,31 @@ void ERR_load_EC_strings(void);
# define EC_F_OLD_EC_PRIV_DECODE 222
# define EC_F_PKEY_EC_CTRL 197
# define EC_F_PKEY_EC_CTRL_STR 198
# define EC_F_PKEY_EC_DECRYPT 301
# define EC_F_PKEY_EC_DERIVE 217
# define EC_F_PKEY_EC_ENCRYPT 300
# define EC_F_PKEY_EC_KEYGEN 199
# define EC_F_PKEY_EC_PARAMGEN 219
# define EC_F_PKEY_EC_SIGN 218
# ifndef OPENSSL_NO_GMSSL
# define EC_F_PKEY_EC_ENCRYPT 300
# define EC_F_PKEY_EC_DECRYPT 301
# define EC_F_PKEY_SM2_INIT 302
# define EC_F_PKEY_SM2_COPY 303
# define EC_F_PKEY_SM2_CLEANUP 304
# define EC_F_PKEY_SM2_PARAMGEN 305
# define EC_F_PKEY_SM2_KEYGEN 306
# define EC_F_PKEY_SM2_SIGN 307
# define EC_F_PKEY_SM2_VERIFY 308
# define EC_F_PKEY_SM2_SIGNCTX_INIT 309
# define EC_F_PKEY_SM2_SIGNCTX 310
# define EC_F_PKEY_SM2_VERIFYCTX_INIT 311
# define EC_F_PKEY_SM2_VERIFYCTX 312
# define EC_F_PKEY_SM2_ENCRYPT 313
# define EC_F_PKEY_SM2_DECRYPT 314
# define EC_F_PKEY_SM2_DERIVE_INIT 315
# define EC_F_PKEY_SM2_DERIVE 316
# define EC_F_PKEY_SM2_CTRL 317
# define EC_F_PKEY_SM2_CTRL_STR 318
# endif
# define EC_F_PKEY_EC_SIGNCTX 246
# define EC_F_PKEY_EC_SIGNCTX_INIT 247
# define EC_F_PKEY_SM2_CLEANUP 304
# define EC_F_PKEY_SM2_COPY 303
# define EC_F_PKEY_SM2_CTRL 317
# define EC_F_PKEY_SM2_CTRL_STR 318
# define EC_F_PKEY_SM2_DECRYPT 314
# define EC_F_PKEY_SM2_DERIVE 316
# define EC_F_PKEY_SM2_DERIVE_INIT 315
# define EC_F_PKEY_SM2_ENCRYPT 313
# define EC_F_PKEY_SM2_INIT 302
# define EC_F_PKEY_SM2_KEYGEN 306
# define EC_F_PKEY_SM2_PARAMGEN 305
# define EC_F_PKEY_SM2_SIGN 307
# define EC_F_PKEY_SM2_SIGNCTX 310
# define EC_F_PKEY_SM2_SIGNCTX_INIT 309
# define EC_F_PKEY_SM2_VERIFY 308
# define EC_F_PKEY_SM2_VERIFYCTX 312
# define EC_F_PKEY_SM2_VERIFYCTX_INIT 311
/* Reason codes. */
# define EC_R_ASN1_ERROR 115

View File

@@ -2835,7 +2835,7 @@ static const struct {
}
};
#ifndef OPENSSL_NO_SM2
#ifndef OPENSSL_NO_GMSSL
static const struct {
EC_CURVE_DATA h;
unsigned char data[0 + 32 * 6];
@@ -2865,12 +2865,42 @@ static const struct {
0xBC, 0x37, 0x36, 0xA2, 0xF4, 0xF6, 0x77, 0x9C, 0x59, 0xBD, 0xCE, 0xE3,
0x6B, 0x69, 0x21, 0x53, 0xD0, 0xA9, 0x87, 0x7C, 0xC6, 0x2A, 0x47, 0x40,
0x02, 0xDF, 0x32, 0xE5, 0x21, 0x39, 0xF0, 0xA0,
/* order */
/* order */
0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x72, 0x03, 0xDF, 0x6B, 0x21, 0xC6, 0x05, 0x2B,
0x53, 0xBB, 0xF4, 0x09, 0x39, 0xD5, 0x41, 0x23
}
};
static const struct {
EC_CURVE_DATA h;
unsigned char data[0 + 24 * 6];
} _EC_WAPI_PRIME_192V1 = {
{
NID_X9_62_prime_field, 0, 24, 1
},
{
/* no seed */
/* p */
0xBD, 0xB6, 0xF4, 0xFE, 0x3E, 0x8B, 0x1D, 0x9E, 0x0D, 0xA8, 0xC0, 0xD4,
0x6F, 0x4C, 0x31, 0x8C, 0xEF, 0xE4, 0xAF, 0xE3, 0xB6, 0xB8, 0x55, 0x1F,
/* a */
0xBB, 0x8E, 0x5E, 0x8F, 0xBC, 0x11, 0x5E, 0x13, 0x9F, 0xE6, 0xA8, 0x14,
0xFE, 0x48, 0xAA, 0xA6, 0xF0, 0xAD, 0xA1, 0xAA, 0x5D, 0xF9, 0x19, 0x85,
/* b */
0x18, 0x54, 0xBE, 0xBD, 0xC3, 0x1B, 0x21, 0xB7, 0xAE, 0xFC, 0x80, 0xAB,
0x0E, 0xCD, 0x10, 0xD5, 0xB1, 0xB3, 0x30, 0x8E, 0x6D, 0xBF, 0x11, 0xC1,
/* x */
0x4A, 0xD5, 0xF7, 0x04, 0x8D, 0xE7, 0x09, 0xAD, 0x51, 0x23, 0x6D, 0xE6,
0x5E, 0x4D, 0x4B, 0x48, 0x2C, 0x83, 0x6D, 0xC6, 0xE4, 0x10, 0x66, 0x40,
/* y */
0x02, 0xBB, 0x3A, 0x02, 0xD4, 0xAA, 0xAD, 0xAC, 0xAE, 0x24, 0x81, 0x7A,
0x4C, 0xA3, 0xA1, 0xB0, 0x14, 0xB5, 0x27, 0x04, 0x32, 0xDB, 0x27, 0xD2,
/* order */
0xBD, 0xB6, 0xF4, 0xFE, 0x3E, 0x8B, 0x1D, 0x9E, 0x0D, 0xA8, 0xC0, 0xD4,
0x0F, 0xC9, 0x62, 0x19, 0x5D, 0xFA, 0xE7, 0x6F, 0x56, 0x56, 0x46, 0x77,
}
};
#endif
typedef struct _ec_list_element_st {
@@ -3082,9 +3112,11 @@ static const ec_list_element curve_list[] = {
"RFC 5639 curve over a 512 bit prime field"},
{NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0,
"RFC 5639 curve over a 512 bit prime field"},
#ifndef OPENSSL_NO_SM2
#ifndef OPENSSL_NO_GMSSL
{NID_sm2p256v1, &_EC_SM2_PRIME_256V1.h, 0,
"SM2 curve over a 256 bit prime field"},
{NID_wapip192v1, &_EC_WAPI_PRIME_192V1.h, 0,
"WAPI curve over a 192 bit prime field"},
#endif
};

View File

@@ -1,6 +1,6 @@
/* crypto/ec/ec_err.c */
/* ====================================================================
* Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved.
* Copyright (c) 1999-2016 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
@@ -250,15 +250,31 @@ static ERR_STRING_DATA EC_str_functs[] = {
{ERR_FUNC(EC_F_OLD_EC_PRIV_DECODE), "OLD_EC_PRIV_DECODE"},
{ERR_FUNC(EC_F_PKEY_EC_CTRL), "PKEY_EC_CTRL"},
{ERR_FUNC(EC_F_PKEY_EC_CTRL_STR), "PKEY_EC_CTRL_STR"},
{ERR_FUNC(EC_F_PKEY_EC_DECRYPT), "PKEY_EC_DECRYPT"},
{ERR_FUNC(EC_F_PKEY_EC_DERIVE), "PKEY_EC_DERIVE"},
{ERR_FUNC(EC_F_PKEY_EC_ENCRYPT), "PKEY_EC_ENCRYPT"},
{ERR_FUNC(EC_F_PKEY_EC_KEYGEN), "PKEY_EC_KEYGEN"},
{ERR_FUNC(EC_F_PKEY_EC_PARAMGEN), "PKEY_EC_PARAMGEN"},
{ERR_FUNC(EC_F_PKEY_EC_SIGN), "PKEY_EC_SIGN"},
{ERR_FUNC(EC_F_PKEY_EC_ENCRYPT), "PKEY_EC_ENCRYPT"},
{ERR_FUNC(EC_F_PKEY_EC_DECRYPT), "PKEY_EC_DECRYPT"},
{ERR_FUNC(EC_F_PKEY_SM2_SIGN), "PKEY_SM2_SIGN"},
{ERR_FUNC(EC_F_PKEY_SM2_ENCRYPT), "PKEY_SM2_ENCRYPT"},
{ERR_FUNC(EC_F_PKEY_EC_SIGNCTX), "PKEY_EC_SIGNCTX"},
{ERR_FUNC(EC_F_PKEY_EC_SIGNCTX_INIT), "PKEY_EC_SIGNCTX_INIT"},
{ERR_FUNC(EC_F_PKEY_SM2_CLEANUP), "PKEY_SM2_CLEANUP"},
{ERR_FUNC(EC_F_PKEY_SM2_COPY), "PKEY_SM2_COPY"},
{ERR_FUNC(EC_F_PKEY_SM2_CTRL), "PKEY_SM2_CTRL"},
{ERR_FUNC(EC_F_PKEY_SM2_CTRL_STR), "PKEY_SM2_CTRL_STR"},
{ERR_FUNC(EC_F_PKEY_SM2_DECRYPT), "PKEY_SM2_DECRYPT"},
{ERR_FUNC(EC_F_PKEY_SM2_DERIVE), "PKEY_SM2_DERIVE"},
{ERR_FUNC(EC_F_PKEY_SM2_DERIVE_INIT), "PKEY_SM2_DERIVE_INIT"},
{ERR_FUNC(EC_F_PKEY_SM2_ENCRYPT), "PKEY_SM2_ENCRYPT"},
{ERR_FUNC(EC_F_PKEY_SM2_INIT), "PKEY_SM2_INIT"},
{ERR_FUNC(EC_F_PKEY_SM2_KEYGEN), "PKEY_SM2_KEYGEN"},
{ERR_FUNC(EC_F_PKEY_SM2_PARAMGEN), "PKEY_SM2_PARAMGEN"},
{ERR_FUNC(EC_F_PKEY_SM2_SIGN), "PKEY_SM2_SIGN"},
{ERR_FUNC(EC_F_PKEY_SM2_SIGNCTX), "PKEY_SM2_SIGNCTX"},
{ERR_FUNC(EC_F_PKEY_SM2_SIGNCTX_INIT), "PKEY_SM2_SIGNCTX_INIT"},
{ERR_FUNC(EC_F_PKEY_SM2_VERIFY), "PKEY_SM2_VERIFY"},
{ERR_FUNC(EC_F_PKEY_SM2_VERIFYCTX), "PKEY_SM2_VERIFYCTX"},
{ERR_FUNC(EC_F_PKEY_SM2_VERIFYCTX_INIT), "PKEY_SM2_VERIFYCTX_INIT"},
{0, NULL}
};

View File

@@ -177,7 +177,7 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx)
static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
const unsigned char *dgst, size_t dgstlen)
{
int ret;
int ret = 0;
EC_PKEY_CTX *dctx = ctx->data;
EC_KEY *ec_key = ctx->pkey->pkey.ec;
int type;
@@ -209,6 +209,8 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
ret = ECDSA_sign(type, dgst, dgstlen, sig, &len, ec_key);
} else if (dctx->sign_type == NID_sm_scheme) {
ret = SM2_sign(type, dgst, dgstlen, sig, &len, ec_key);
} else {
//error
}
if (ret <= 0)
@@ -239,14 +241,12 @@ static int pkey_ec_verify(EVP_PKEY_CTX *ctx,
return ret;
}
#if 0
static int int_update(EVP_MD_CTX *ctx, const void *data, size_t count)
{
if (!EVP_DigestUpdate(ctx, data, count))
return 0;
return 1;
}
#endif
static int pkey_ec_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
{
@@ -256,23 +256,22 @@ static int pkey_ec_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
unsigned char zid[EVP_MAX_MD_SIZE];
unsigned int zidlen = sizeof(zid);
// the reason might be we need to init mctx->udpate
if (dctx->sign_type == NID_sm_scheme) {
/*
if (!SM2_compute_id_digest(md, zid, &zidlen, ec_key)) {
ECerr(EC_F_PKEY_SM2_SIGNCTX_INIT, ERR_R_SM2_LIB);
ECerr(EC_F_PKEY_EC_SIGNCTX_INIT, ERR_R_SM2_LIB);
return 0;
}
mctx->update = int_update;
if (!mctx->update(mctx, zid, zidlen)) {
ECerr(EC_F_PKEY_SM2_SIGNCTX_INIT, ERR_R_EVP_LIB);
ECerr(EC_F_PKEY_EC_SIGNCTX_INIT, ERR_R_EVP_LIB);
return 0;
}
*/
}
//ctx->update = int_update;
return 1;
}
@@ -280,7 +279,7 @@ static int pkey_ec_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx)
static int pkey_ec_signctx(EVP_PKEY_CTX *ctx,
unsigned char *sig, size_t *siglen, EVP_MD_CTX *mctx)
{
int ret;
int ret = 0;
unsigned int len;
EC_PKEY_CTX *dctx = ctx->data;
EC_KEY *ec_key = ctx->pkey->pkey.ec;
@@ -292,15 +291,16 @@ static int pkey_ec_signctx(EVP_PKEY_CTX *ctx,
*siglen = SM2_signature_size(ec_key);
return 1;
} else if (*siglen < (size_t)SM2_signature_size(ec_key)) {
ECerr(EC_F_PKEY_SM2_SIGNCTX, EC_R_BUFFER_TOO_SMALL);
ECerr(EC_F_PKEY_EC_SIGNCTX, EC_R_BUFFER_TOO_SMALL);
return 0;
}
if (!EVP_DigestFinal_ex(mctx, dgst, &dgstlen)) {
ECerr(EC_F_PKEY_SM2_SIGNCTX, ERR_R_EVP_LIB);
ECerr(EC_F_PKEY_EC_SIGNCTX, ERR_R_EVP_LIB);
return 0;
}
len = *siglen;
if (dctx->sign_type == NID_sm_scheme)
ret = SM2_sign(type, dgst, dgstlen, sig, &len, ec_key);
else if (dctx->sign_type == NID_secg_scheme)

View File

@@ -105,14 +105,15 @@ ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ech_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ech_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ech_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ech_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ech_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ech_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
ech_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ech_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ech_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ech_lib.o: ech_lib.c ech_locl.h
ech_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ech_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ech_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ech_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ech_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ech_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ech_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ech_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ech_lib.o: ../../include/openssl/x509_vfy.h ech_lib.c ech_locl.h
ech_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
ech_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
ech_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h

View File

@@ -99,13 +99,15 @@ ecs_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ecs_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ecs_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_lib.o: ../../include/openssl/x509_vfy.h ecs_lib.c ecs_locl.h
ecs_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ecs_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ecs_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecs_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
ecs_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ecs_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ecs_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ecs_lib.o: ecs_lib.c ecs_locl.h
ecs_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecs_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
@@ -119,12 +121,14 @@ ecs_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ecs_sign.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ecs_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ecs_sign.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ecs_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ecs_sign.o: ecs_locl.h ecs_sign.c
@@ -132,11 +136,13 @@ ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_vrf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
ecs_vrf.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_vrf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_vrf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ecs_vrf.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_vrf.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_vrf.c

View File

@@ -17,13 +17,12 @@ TEST=eciestest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= ecies_lib.c ecies_asn1.c ecies_err.c kdf_x9_63.c
LIBOBJ= ecies_lib.o ecies_asn1.o ecies_err.o kdf_x9_63.o
LIBSRC= ecies_lib.c ecies_asn1.c ecies_err.c
LIBOBJ= ecies_lib.o ecies_asn1.o ecies_err.o
SRC= $(LIBSRC)
EXHEADER= ecies.h kdf.h
EXHEADER= ecies.h
HEADER= ecies_locl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
@@ -77,66 +76,50 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
ecs_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ecs_asn1.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
ecs_asn1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ecs_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
ecs_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_asn1.o: ../../include/openssl/symhacks.h ecs_asn1.c ecs_locl.h
ecs_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h
ecs_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h
ecs_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ecs_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
ecs_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_err.o: ecs_err.c
ecs_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
ecs_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecs_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ecs_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ecs_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_lib.o: ../../include/openssl/x509_vfy.h ecs_lib.c ecs_locl.h
ecs_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
ecs_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_ossl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ecs_ossl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_ossl.o: ../../include/openssl/opensslconf.h
ecs_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
ecs_ossl.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_ossl.c
ecs_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ecs_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecs_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ecs_sign.o: ecs_locl.h ecs_sign.c
ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecs_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecs_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecs_vrf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecs_vrf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecs_vrf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecs_vrf.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_vrf.c
ecies_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
ecies_asn1.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
ecies_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecies_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ecies_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ecies_asn1.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ecies_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecies_asn1.o: ../../include/openssl/objects.h
ecies_asn1.o: ../../include/openssl/opensslconf.h
ecies_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecies_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecies_asn1.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ecies_asn1.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ecies_asn1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecies_asn1.o: ../../include/openssl/x509_vfy.h ecies.h ecies_asn1.c
ecies_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ecies_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
ecies_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ecies_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ecies_err.o: ../../include/openssl/ecies.h ../../include/openssl/err.h
ecies_err.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ecies_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecies_err.o: ../../include/openssl/objects.h
ecies_err.o: ../../include/openssl/opensslconf.h
ecies_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecies_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ecies_err.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ecies_err.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ecies_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ecies_err.o: ../../include/openssl/x509_vfy.h ecies_err.c
ecies_lib.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
ecies_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
ecies_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ecies_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ecies_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
ecies_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ecies_lib.o: ../../include/openssl/hmac.h ../../include/openssl/kdf.h
ecies_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ecies_lib.o: ../../include/openssl/objects.h
ecies_lib.o: ../../include/openssl/opensslconf.h
ecies_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ecies_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ecies_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ecies_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ecies_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ecies_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ecies_lib.o: ecies_lib.c

View File

@@ -142,31 +142,34 @@ int ECIES_decrypt_with_recommended(unsigned char *out, size_t *outlen,
void ERR_load_ECIES_strings(void);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_ECIES_strings(void);
/* Error codes for the ECIES functions. */
/* Function codes. */
#define ECIES_F_I2D_ECIESPARAMETERS 100
#define ECIES_F_D2I_ECIESPARAMETERS 101
#define ECIES_F_ECIES_SET_PARAMETERS 102
#define ECIES_F_ECIES_GET_PARAMETERS 103
#define ECIES_F_ECIES_DO_ENCRYPT 104
#define ECIES_F_ECIES_DO_DECRYPT 105
#define ECIES_F_ECIES_ENCRYPT 106
#define ECIES_F_ECIES_DECRYPT 107
# define ECIES_F_D2I_ECIESPARAMETERS 100
# define ECIES_F_ECIES_DECRYPT 101
# define ECIES_F_ECIES_DO_DECRYPT 102
# define ECIES_F_ECIES_DO_ENCRYPT 103
# define ECIES_F_ECIES_ENCRYPT 104
# define ECIES_F_I2D_ECIESPARAMETERS 105
/* Reason codes. */
#define ECIES_R_BAD_DATA 100
#define ECIES_R_UNKNOWN_CIPHER_TYPE 101
#define ECIES_R_ENCRYPT_FAILED 102
#define ECIES_R_DECRYPT_FAILED 103
#define ECIES_R_UNKNOWN_MAC_TYPE 104
#define ECIES_R_GEN_MAC_FAILED 105
#define ECIES_R_VERIFY_MAC_FAILED 106
#define ECIES_R_ECDH_FAILED 107
#define ECIES_R_BUFFER_TOO_SMALL 108
# define ECIES_R_BAD_DATA 100
# define ECIES_R_BUFFER_TOO_SMALL 101
# define ECIES_R_DECRYPT_FAILED 102
# define ECIES_R_ECDH_FAILED 103
# define ECIES_R_ENCRYPT_FAILED 104
# define ECIES_R_GEN_MAC_FAILED 105
# define ECIES_R_VERIFY_MAC_FAILED 106
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,6 +1,6 @@
/* crypto/ecies/ecies_err.c */
/* ====================================================================
* Copyright (c) 2007 - 2015 The GmSSL Project. All rights reserved.
* Copyright (c) 1999-2016 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
@@ -16,27 +16,27 @@
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the GmSSL Project.
* (http://gmssl.org/)"
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
* 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 "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
* 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 GmSSL Project
* (http://gmssl.org/)"
* "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 GmSSL PROJECT ``AS IS'' AND ANY
* 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 GmSSL PROJECT OR
* 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;
@@ -47,40 +47,47 @@
* 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "ecies.h"
#include <openssl/ecies.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECIES,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECIES,0,reason)
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECIES,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECIES,0,reason)
static ERR_STRING_DATA ECIES_str_functs[] = {
{ERR_FUNC(ECIES_F_ECIES_SET_PARAMETERS),"ECIES_set_parameters"},
{ERR_FUNC(ECIES_F_ECIES_GET_PARAMETERS),"ECIES_get_parameters"},
{ERR_FUNC(ECIES_F_ECIES_DO_ENCRYPT), "ECIES_do_encrypt"},
{ERR_FUNC(ECIES_F_ECIES_DO_DECRYPT), "ECIES_do_decrypt"},
{ERR_FUNC(ECIES_F_ECIES_ENCRYPT), "ECIES_encrypt"},
{ERR_FUNC(ECIES_F_ECIES_DECRYPT), "ECIES_decrypt"},
{0,NULL}
{ERR_FUNC(ECIES_F_D2I_ECIESPARAMETERS), "d2i_ECIESParameters"},
{ERR_FUNC(ECIES_F_ECIES_DECRYPT), "ECIES_decrypt"},
{ERR_FUNC(ECIES_F_ECIES_DO_DECRYPT), "ECIES_do_decrypt"},
{ERR_FUNC(ECIES_F_ECIES_DO_ENCRYPT), "ECIES_do_encrypt"},
{ERR_FUNC(ECIES_F_ECIES_ENCRYPT), "ECIES_encrypt"},
{ERR_FUNC(ECIES_F_I2D_ECIESPARAMETERS), "i2d_ECIESParameters"},
{0, NULL}
};
static ERR_STRING_DATA ECIES_str_reasons[] = {
{ERR_REASON(ECIES_R_BAD_DATA), "bad data"},
{ERR_REASON(ECIES_R_UNKNOWN_CIPHER_TYPE),"unknown cipher type"},
{ERR_REASON(ECIES_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(ECIES_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(ECIES_R_UNKNOWN_MAC_TYPE), "unknown MAC type"},
{ERR_REASON(ECIES_R_GEN_MAC_FAILED), "MAC generation failed"},
{ERR_REASON(ECIES_R_VERIFY_MAC_FAILED), "MAC verification failed"},
{ERR_REASON(ECIES_R_ECDH_FAILED), "ECDH failed"},
{ERR_REASON(ECIES_R_BUFFER_TOO_SMALL), "buffer too small"},
{0,NULL}
{ERR_REASON(ECIES_R_BAD_DATA), "bad data"},
{ERR_REASON(ECIES_R_BUFFER_TOO_SMALL), "buffer too small"},
{ERR_REASON(ECIES_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(ECIES_R_ECDH_FAILED), "ECDH failed"},
{ERR_REASON(ECIES_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(ECIES_R_GEN_MAC_FAILED), "MAC generation failed"},
{ERR_REASON(ECIES_R_VERIFY_MAC_FAILED), "MAC verification failed"},
{0, NULL}
};
#endif
@@ -89,10 +96,9 @@ void ERR_load_ECIES_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(ECIES_str_functs[0].error) == NULL) {
ERR_load_strings(0,ECIES_str_functs);
ERR_load_strings(0,ECIES_str_reasons);
}
if (ERR_func_error_string(ECIES_str_functs[0].error) == NULL) {
ERR_load_strings(0, ECIES_str_functs);
ERR_load_strings(0, ECIES_str_reasons);
}
#endif
}

View File

@@ -57,8 +57,8 @@
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/ecdh.h>
#include "ecies.h"
#include "kdf.h"
#include <openssl/kdf.h>
#include <openssl/ecies.h>
static void *ecies_data_dup(void *data) {
@@ -342,7 +342,7 @@ int ECIES_do_decrypt(const ECIES_CIPHERTEXT_VALUE *cv,
}
if (!(ephem_point = EC_POINT_new(EC_KEY_get0_group(pri_key))))
{
ECIESerr(ECIES_F_ECIES_DO_ENCRYPT, ERR_R_MALLOC_FAILURE);
ECIESerr(ECIES_F_ECIES_DO_DECRYPT, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_POINT_oct2point(EC_KEY_get0_group(pri_key), ephem_point,
@@ -397,7 +397,7 @@ int ECIES_do_decrypt(const ECIES_CIPHERTEXT_VALUE *cv,
ECIESerr(ECIES_F_ECIES_DO_DECRYPT, ECIES_R_VERIFY_MAC_FAILED);
goto err;
}
if (memcmp(cv->mactag->data, mac, len))
if (OPENSSL_memcmp(cv->mactag->data, mac, len))
{
ECIESerr(ECIES_F_ECIES_DO_DECRYPT, ECIES_R_VERIFY_MAC_FAILED);
goto err;
@@ -507,12 +507,12 @@ int ECIES_decrypt(const ECIES_PARAMS *param,
const unsigned char *p = in;
if (!(cv = d2i_ECIES_CIPHERTEXT_VALUE(NULL, &p, (long)inlen))) {
ECIESerr(ECIES_F_ECIES_ENCRYPT, ECIES_R_ENCRYPT_FAILED);
ECIESerr(ECIES_F_ECIES_DECRYPT, ECIES_R_ENCRYPT_FAILED);
return 0;
}
if (!ECIES_do_decrypt(cv, param, out, outlen, ec_key)) {
ECIESerr(ECIES_F_ECIES_ENCRYPT, ECIES_R_ENCRYPT_FAILED);
ECIESerr(ECIES_F_ECIES_DECRYPT, ECIES_R_ENCRYPT_FAILED);
goto end;
}
@@ -554,4 +554,3 @@ int ECIES_decrypt_with_recommended(unsigned char *out, size_t *outlen,
return ECIES_decrypt(&param, out, outlen, in, inlen, ec_key);
}

View File

@@ -92,39 +92,44 @@ eng_all.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_all.c eng_int.h
eng_all.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_all.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
eng_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_all.o: ../cryptlib.h eng_all.c eng_int.h
eng_cnf.o: ../../e_os.h ../../include/openssl/asn1.h
eng_cnf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
eng_cnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
eng_cnf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_cnf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_cnf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_cnf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_cnf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_cnf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_cnf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_cnf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_cnf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_cnf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_cnf.o: ../cryptlib.h eng_cnf.c eng_int.h
eng_cnf.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_cnf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_cnf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_cnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_cnf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_cnf.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_cnf.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_cnf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_cnf.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_cnf.c eng_int.h
eng_cryptodev.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
eng_cryptodev.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
eng_cryptodev.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_cryptodev.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_cryptodev.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_cryptodev.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_cryptodev.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_cryptodev.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_cryptodev.o: ../../include/openssl/obj_mac.h
eng_cryptodev.o: ../../include/openssl/objects.h
eng_cryptodev.o: ../../include/openssl/opensslconf.h
eng_cryptodev.o: ../../include/openssl/opensslv.h
eng_cryptodev.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_cryptodev.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_cryptodev.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
eng_cryptodev.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_cryptodev.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_cryptodev.o: eng_cryptodev.c
@@ -134,11 +139,13 @@ eng_ctrl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_ctrl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_ctrl.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_ctrl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_ctrl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_ctrl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_ctrl.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_ctrl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_ctrl.o: ../../include/openssl/opensslconf.h
eng_ctrl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_ctrl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_ctrl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_ctrl.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_ctrl.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_ctrl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_ctrl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_ctrl.c eng_int.h
eng_dyn.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -147,52 +154,57 @@ eng_dyn.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
eng_dyn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_dyn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_dyn.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_dyn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_dyn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_dyn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_dyn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_dyn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_dyn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_dyn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_dyn.o: ../cryptlib.h eng_dyn.c eng_int.h
eng_dyn.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_dyn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_dyn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_dyn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_dyn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_dyn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_dyn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_dyn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_dyn.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_dyn.c eng_int.h
eng_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
eng_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_err.o: eng_err.c
eng_err.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_err.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_err.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_err.o: ../../include/openssl/x509_vfy.h eng_err.c
eng_fat.o: ../../e_os.h ../../include/openssl/asn1.h
eng_fat.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
eng_fat.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
eng_fat.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_fat.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_fat.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_fat.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_fat.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_fat.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_fat.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_fat.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_fat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_fat.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_fat.o: ../cryptlib.h eng_fat.c eng_int.h
eng_fat.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_fat.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_fat.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_fat.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_fat.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_fat.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_fat.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_fat.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_fat.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_fat.c eng_int.h
eng_init.o: ../../e_os.h ../../include/openssl/asn1.h
eng_init.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
eng_init.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_init.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_init.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_init.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_init.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_init.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_init.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_init.o: ../../include/openssl/opensslconf.h
eng_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_init.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_init.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_init.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_init.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_init.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_init.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_init.c eng_int.h
eng_lib.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -201,25 +213,28 @@ eng_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
eng_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_lib.o: ../cryptlib.h eng_int.h eng_lib.c
eng_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
eng_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
eng_lib.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
eng_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_lib.c
eng_list.o: ../../e_os.h ../../include/openssl/asn1.h
eng_list.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
eng_list.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_list.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_list.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_list.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_list.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_list.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_list.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_list.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_list.o: ../../include/openssl/opensslconf.h
eng_list.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_list.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_list.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_list.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_list.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_list.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_list.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_list.c
eng_openssl.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -229,15 +244,17 @@ eng_openssl.o: ../../include/openssl/dsa.h ../../include/openssl/dso.h
eng_openssl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_openssl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_openssl.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_openssl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_openssl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_openssl.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_openssl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_openssl.o: ../../include/openssl/objects.h
eng_openssl.o: ../../include/openssl/opensslconf.h
eng_openssl.o: ../../include/openssl/opensslv.h
eng_openssl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
eng_openssl.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
eng_openssl.o: ../../include/openssl/rand.h ../../include/openssl/rc4.h
eng_openssl.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
eng_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_openssl.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_openssl.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_openssl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_openssl.c
eng_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -246,11 +263,13 @@ eng_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
eng_pkey.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_pkey.o: ../../include/openssl/opensslconf.h
eng_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_pkey.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c
eng_rdrand.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -258,12 +277,14 @@ eng_rdrand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
eng_rdrand.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
eng_rdrand.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
eng_rdrand.o: ../../include/openssl/engine.h ../../include/openssl/err.h
eng_rdrand.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
eng_rdrand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_rdrand.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
eng_rdrand.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_rdrand.o: ../../include/openssl/objects.h
eng_rdrand.o: ../../include/openssl/opensslconf.h
eng_rdrand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_rdrand.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
eng_rdrand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
eng_rdrand.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
eng_rdrand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
eng_rdrand.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
eng_rdrand.o: eng_rdrand.c
@@ -273,12 +294,13 @@ eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
eng_table.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
eng_table.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
eng_table.o: ../../include/openssl/err.h ../../include/openssl/evp.h
eng_table.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
eng_table.o: ../../include/openssl/objects.h
eng_table.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
eng_table.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
eng_table.o: ../../include/openssl/opensslconf.h
eng_table.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
eng_table.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
eng_table.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
eng_table.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
eng_table.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
eng_table.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
eng_table.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
eng_table.o: eng_table.c
@@ -288,12 +310,13 @@ tb_asnmth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_asnmth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_asnmth.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_asnmth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_asnmth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_asnmth.o: ../../include/openssl/objects.h
tb_asnmth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_asnmth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_asnmth.o: ../../include/openssl/opensslconf.h
tb_asnmth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_asnmth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_asnmth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_asnmth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_asnmth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_asnmth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_asnmth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
tb_asnmth.o: eng_int.h tb_asnmth.c
@@ -303,12 +326,13 @@ tb_cipher.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_cipher.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_cipher.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_cipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_cipher.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_cipher.o: ../../include/openssl/objects.h
tb_cipher.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_cipher.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_cipher.o: ../../include/openssl/opensslconf.h
tb_cipher.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_cipher.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_cipher.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_cipher.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_cipher.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_cipher.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_cipher.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
tb_cipher.o: tb_cipher.c
@@ -317,26 +341,28 @@ tb_dh.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
tb_dh.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_dh.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
tb_dh.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_dh.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
tb_dh.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_dh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_dh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
tb_dh.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_dh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_dh.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
tb_dh.o: ../cryptlib.h eng_int.h tb_dh.c
tb_dh.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
tb_dh.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_dh.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_dh.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_dh.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_dh.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_dh.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_dh.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_dh.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_dh.c
tb_digest.o: ../../e_os.h ../../include/openssl/asn1.h
tb_digest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
tb_digest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_digest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_digest.o: ../../include/openssl/objects.h
tb_digest.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_digest.o: ../../include/openssl/opensslconf.h
tb_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_digest.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_digest.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
tb_digest.o: tb_digest.c
@@ -345,38 +371,43 @@ tb_dsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
tb_dsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_dsa.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
tb_dsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_dsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
tb_dsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_dsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_dsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
tb_dsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_dsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_dsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
tb_dsa.o: ../cryptlib.h eng_int.h tb_dsa.c
tb_dsa.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
tb_dsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_dsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_dsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_dsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_dsa.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_dsa.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_dsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_dsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_dsa.c
tb_ecdh.o: ../../e_os.h ../../include/openssl/asn1.h
tb_ecdh.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
tb_ecdh.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_ecdh.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_ecdh.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_ecdh.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_ecdh.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_ecdh.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_ecdh.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_ecdh.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_ecdh.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_ecdh.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_ecdh.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_ecdh.c
tb_ecdh.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_ecdh.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_ecdh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_ecdh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
tb_ecdh.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_ecdh.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
tb_ecdh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_ecdh.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
tb_ecdh.o: ../cryptlib.h eng_int.h tb_ecdh.c
tb_ecdsa.o: ../../e_os.h ../../include/openssl/asn1.h
tb_ecdsa.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
tb_ecdsa.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_ecdsa.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_ecdsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_ecdsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_ecdsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_ecdsa.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_ecdsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_ecdsa.o: ../../include/openssl/opensslconf.h
tb_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_ecdsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_ecdsa.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_ecdsa.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_ecdsa.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_ecdsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_ecdsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_ecdsa.c
tb_pkmeth.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -385,12 +416,13 @@ tb_pkmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_pkmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_pkmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_pkmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_pkmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_pkmeth.o: ../../include/openssl/objects.h
tb_pkmeth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_pkmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_pkmeth.o: ../../include/openssl/opensslconf.h
tb_pkmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_pkmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_pkmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_pkmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_pkmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_pkmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_pkmeth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
tb_pkmeth.o: tb_pkmeth.c
@@ -400,36 +432,41 @@ tb_rand.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_rand.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_rand.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_rand.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_rand.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_rand.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_rand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_rand.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_rand.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_rand.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_rand.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_rand.c
tb_rand.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_rand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_rand.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
tb_rand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_rand.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
tb_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_rand.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
tb_rand.o: ../cryptlib.h eng_int.h tb_rand.c
tb_rsa.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
tb_rsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
tb_rsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
tb_rsa.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
tb_rsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
tb_rsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
tb_rsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_rsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
tb_rsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
tb_rsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
tb_rsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
tb_rsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
tb_rsa.o: ../cryptlib.h eng_int.h tb_rsa.c
tb_rsa.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
tb_rsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_rsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_rsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_rsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_rsa.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_rsa.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_rsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_rsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_rsa.c
tb_store.o: ../../e_os.h ../../include/openssl/asn1.h
tb_store.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
tb_store.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
tb_store.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
tb_store.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
tb_store.o: ../../include/openssl/err.h ../../include/openssl/evp.h
tb_store.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
tb_store.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
tb_store.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
tb_store.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
tb_store.o: ../../include/openssl/opensslconf.h
tb_store.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
tb_store.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
tb_store.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
tb_store.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
tb_store.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
tb_store.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
tb_store.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_store.c

View File

@@ -85,24 +85,29 @@ err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
err.o: ../cryptlib.h err.c
err_all.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
err_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
err_all.o: ../../include/openssl/cms.h ../../include/openssl/comp.h
err_all.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
err_all.o: ../../include/openssl/cbcmac.h ../../include/openssl/cms.h
err_all.o: ../../include/openssl/comp.h ../../include/openssl/conf.h
err_all.o: ../../include/openssl/cpk.h ../../include/openssl/crypto.h
err_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
err_all.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
err_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
err_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
err_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
err_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/ecies.h
err_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
err_all.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
err_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
err_all.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
err_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
err_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem2.h
err_all.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
err_all.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
err_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
err_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
err_all.o: ../../include/openssl/ts.h ../../include/openssl/ui.h
err_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
err_all.o: ../../include/openssl/x509v3.h err_all.c
err_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/otp.h
err_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
err_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
err_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
err_all.o: ../../include/openssl/sha.h ../../include/openssl/skf.h
err_all.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
err_all.o: ../../include/openssl/sm9.h ../../include/openssl/stack.h
err_all.o: ../../include/openssl/symhacks.h ../../include/openssl/ts.h
err_all.o: ../../include/openssl/ui.h ../../include/openssl/x509.h
err_all.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
err_all.o: err_all.c
err_prn.o: ../../e_os.h ../../include/openssl/bio.h
err_prn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
err_prn.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h

View File

@@ -157,8 +157,12 @@ static ERR_STRING_DATA ERR_str_libraries[] = {
{ERR_PACK(ERR_LIB_HMAC, 0, 0), "HMAC routines"},
# ifndef OPENSSL_NO_GMSSL
{ERR_PACK(ERR_LIB_ECIES, 0, 0), "ECIES routines"},
{ERR_PACK(ERR_LIB_CPK, 0, 0), "CPK routines"},
{ERR_PACK(ERR_LIB_SM2, 0, 0), "SM2 routines"},
{ERR_PACK(ERR_LIB_SKF, 0, 0), "SKF routines"},
{ERR_PACK(ERR_LIB_CBCMAC, 0, 0), "CBCMAC routines"},
{ERR_PACK(ERR_LIB_OTP, 0, 0), "OTP routines"},
{ERR_PACK(ERR_LIB_SM9, 0, 0), "SM9 routines"},
# endif
{0, NULL},
};

View File

@@ -197,10 +197,15 @@ typedef struct err_state_st {
# define ERR_LIB_TS 47
# define ERR_LIB_HMAC 48
# define ERR_LIB_JPAKE 49
# ifndef OPENSSL_NO_GMSSL
# define ERR_LIB_ECIES 50
# define ERR_LIB_SM2 51
# define ERR_LIB_SKF 52
# define ERR_LIB_CPK 51
# define ERR_LIB_SM2 52
# define ERR_LIB_SKF 53
# define ERR_LIB_CBCMAC 54
# define ERR_LIB_OTP 55
# define ERR_LIB_SM9 56
# endif
# define ERR_LIB_USER 128
@@ -238,10 +243,15 @@ typedef struct err_state_st {
# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__)
# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__)
# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
# ifndef OPENSSL_NO_GMSSL
# define ECIESerr(f,r) ERR_PUT_error(ERR_LIB_ECIES,(f),(r),__FILE__,__LINE__)
# define CPKerr(f,r) ERR_PUT_error(ERR_LIB_CPK,(f),(r),__FILE__,__LINE__)
# define SM2err(f,r) ERR_PUT_error(ERR_LIB_SM2,(f),(r),__FILE__,__LINE__)
# define SKFerr(f,r) ERR_PUT_error(ERR_LIB_SKF,(f),(r),__FILE__,__LINE__)
# define CBCMACerr(f,r) ERR_PUT_error(ERR_LIB_CBCMAC,(f),(r),__FILE__,__LINE__);
# define OTPerr(f,r) ERR_PUT_error(ERR_LIB_OTP,(f),(r),__FILE__,__LINE__);
# define SM9err(f,r) ERR_PUT_error(ERR_LIB_SM9,(f),(r),__FILE__,__LINE__);
# endif
/*
@@ -299,10 +309,15 @@ typedef struct err_state_st {
# define ERR_R_ECDH_LIB ERR_LIB_ECDH/* 43 */
# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */
# define ERR_R_TS_LIB ERR_LIB_TS/* 45 */
# ifndef OPENSSL_NO_GMSSL
# define ERR_R_ECIES_LIB ERR_LIB_ECIES/* 50 */
# define ERR_R_SM2_LIB ERR_LIB_SM2/* 51 */
# define ERR_R_SKF_LIB ERR_LIB_SKF/* 52 */
# define ERR_R_CPK_LIB ERR_LIB_CPK/* 51 */
# define ERR_R_SM2_LIB ERR_LIB_SM2/* 52 */
# define ERR_R_SKF_LIB ERR_LIB_SKF/* 53 */
# define ERR_R_CBCMAC_LIB ERR_LIB_CBCMAC/* 54 */
# define ERR_R_OTP_LIB ERR_LIB_CBCMAC/* 55 */
# define ERR_R_SM9_LIB ERR_LIB_SM9/* 56 */
# endif
# define ERR_R_NESTED_ASN1_ERROR 58

View File

@@ -107,8 +107,15 @@
#ifndef OPENSSL_NO_JPAKE
# include <openssl/jpake.h>
#endif
#ifndef OPENSSL_NO_GMSSL
# include <openssl/sm2.h>
# include <openssl/skf.h>
# include <openssl/cpk.h>
# include <openssl/ecies.h>
# include <openssl/cbcmac.h>
# include <openssl/otp.h>
# include <openssl/sm9.h>
#endif
void ERR_load_crypto_strings(void)
@@ -169,7 +176,12 @@ void ERR_load_crypto_strings(void)
# endif
# ifndef OPENSSL_NO_GMSSL
ERR_load_ECIES_strings();
ERR_load_CPK_strings();
ERR_load_SM2_strings();
ERR_load_SKF_strings();
ERR_load_CBCMAC_strings();
ERR_load_OTP_strings();
ERR_load_SM9_strings();
# endif
#endif
}

View File

@@ -37,7 +37,11 @@ L CMS crypto/cms/cms.h crypto/cms/cms_err.c
L JPAKE crypto/jpake/jpake.h crypto/jpake/jpake_err.c
L ECIES crypto/ecies/ecies.h crypto/ecies/ecies_err.c
L SM2 crypto/sm2/sm2.h crypto/sm2/sm2_err.c
L SKF crypto/skf/skf.h crypto/skf/skf_err.c
L SKF crypto/skf/skf_ex.h crypto/skf/skf_err.c
L CPK crypto/cpk/cpk.h crypto/cpk/cpk_err.c
L CBCMAC crypto/cbcmac/cbcmac.h crypto/cbcmac/cbcmac_err.c
L OTP crypto/otp/otp.h crypto/otp/otp_err.c
L SM9 crypto/sm9/sm9.h crypto/sm9/sm9_err.c
# additional header files to be scanned for function names
L NONE crypto/x509/x509_vfy.h NONE

View File

@@ -144,53 +144,57 @@ c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
c_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
c_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
c_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
c_all.o: ../cryptlib.h c_all.c
c_all.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
c_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
c_all.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
c_all.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
c_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
c_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_all.c
c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
c_allc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
c_allc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
c_allc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
c_allc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
c_allc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
c_allc.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
c_allc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
c_allc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
c_allc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
c_allc.o: ../cryptlib.h c_allc.c
c_allc.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
c_allc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
c_allc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
c_allc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
c_allc.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
c_allc.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
c_allc.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
c_allc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
c_allc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_allc.c
c_alld.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
c_alld.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
c_alld.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
c_alld.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
c_alld.o: ../../include/openssl/err.h ../../include/openssl/evp.h
c_alld.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
c_alld.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
c_alld.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
c_alld.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
c_alld.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
c_alld.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
c_alld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
c_alld.o: ../cryptlib.h c_alld.c
c_alld.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
c_alld.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
c_alld.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
c_alld.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
c_alld.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
c_alld.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
c_alld.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
c_alld.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
c_alld.o: ../../include/openssl/x509_vfy.h ../cryptlib.h c_alld.c
digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
digest.o: ../cryptlib.h digest.c
digest.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
digest.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
digest.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h digest.c
e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -306,7 +310,6 @@ e_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
e_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
e_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
e_null.o: ../cryptlib.h e_null.c
e_old.o: e_old.c
e_rc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_rc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
e_rc2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -343,27 +346,6 @@ e_rc5.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
e_rc5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
e_rc5.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
e_rc5.o: ../../include/openssl/symhacks.h ../cryptlib.h e_rc5.c
e_sms4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_sms4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
e_sms4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
e_sms4.o: ../../include/openssl/evp.h ../../include/openssl/sms4.h
e_sms4.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
e_sms4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_sms4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
e_sms4.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
e_sms4.o: ../../include/openssl/symhacks.h ../cryptlib.h e_sms4.c evp_locl.h
e_zuc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_zuc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
e_zuc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
#e_zuc.o: ../../include/openssl/evp.h ../../include/openssl/zuc.h
e_zuc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
e_zuc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_zuc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
e_zuc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
e_zuc.o: ../../include/openssl/symhacks.h ../cryptlib.h e_zuc.c evp_locl.h
e_seed.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_seed.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
e_seed.o: ../../include/openssl/err.h ../../include/openssl/evp.h
@@ -373,6 +355,16 @@ e_seed.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
e_seed.o: ../../include/openssl/safestack.h ../../include/openssl/seed.h
e_seed.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
e_seed.o: e_seed.c evp_locl.h
e_sms4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_sms4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
e_sms4.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
e_sms4.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
e_sms4.o: ../../include/openssl/modes.h ../../include/openssl/obj_mac.h
e_sms4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
e_sms4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
e_sms4.o: ../../include/openssl/safestack.h ../../include/openssl/sms4.h
e_sms4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
e_sms4.o: ../cryptlib.h ../modes/modes_lcl.h e_sms4.c evp_locl.h
e_xcbc_d.o: ../../e_os.h ../../include/openssl/asn1.h
e_xcbc_d.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
e_xcbc_d.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
@@ -385,6 +377,15 @@ e_xcbc_d.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
e_xcbc_d.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
e_xcbc_d.o: ../../include/openssl/ui_compat.h ../cryptlib.h e_xcbc_d.c
e_xcbc_d.o: evp_locl.h
e_zuc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
e_zuc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
e_zuc.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
e_zuc.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
e_zuc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
e_zuc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
e_zuc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
e_zuc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
e_zuc.o: ../../include/openssl/zuc.h ../cryptlib.h e_zuc.c evp_locl.h
encode.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
encode.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
encode.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -410,28 +411,31 @@ evp_cnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
evp_cnf.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h
evp_cnf.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_cnf.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
evp_cnf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
evp_cnf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_cnf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
evp_cnf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
evp_cnf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_cnf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_cnf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_cnf.o: ../../include/openssl/x509v3.h ../cryptlib.h evp_cnf.c
evp_cnf.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
evp_cnf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_cnf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_cnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_cnf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
evp_cnf.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
evp_cnf.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
evp_cnf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
evp_cnf.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
evp_cnf.o: ../cryptlib.h evp_cnf.c
evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h
evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
evp_enc.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
evp_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
evp_enc.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
evp_enc.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
evp_enc.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
evp_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
evp_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_enc.c evp_locl.h
evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
@@ -445,14 +449,16 @@ evp_key.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_key.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
evp_key.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
evp_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
evp_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
evp_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_key.o: ../../include/openssl/ui.h ../../include/openssl/x509.h
evp_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_key.c
evp_key.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
evp_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
evp_key.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
evp_key.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
evp_key.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
evp_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_key.o: ../cryptlib.h evp_key.c
evp_lib.o: ../../e_os.h ../../include/openssl/asn1.h
evp_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
@@ -467,25 +473,28 @@ evp_pbe.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_pbe.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_pbe.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_pbe.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
evp_pbe.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
evp_pbe.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_pbe.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
evp_pbe.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
evp_pbe.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
evp_pbe.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
evp_pbe.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
evp_pbe.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h evp_pbe.c
evp_pbe.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
evp_pbe.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_pbe.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_pbe.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_pbe.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
evp_pbe.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_pbe.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
evp_pbe.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_pbe.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_pbe.o: ../cryptlib.h evp_locl.h evp_pbe.c
evp_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
evp_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
evp_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
evp_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
evp_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
evp_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
evp_pkey.o: ../../include/openssl/opensslconf.h
evp_pkey.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
evp_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
evp_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
evp_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
evp_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
evp_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
evp_pkey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
evp_pkey.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
evp_pkey.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
evp_pkey.o: ../asn1/asn1_locl.h ../cryptlib.h evp_pkey.c
@@ -514,14 +523,15 @@ m_ecdsa.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
m_ecdsa.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
m_ecdsa.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
m_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
m_ecdsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
m_ecdsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_ecdsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_ecdsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_ecdsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_ecdsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_ecdsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_ecdsa.o: ../cryptlib.h m_ecdsa.c
m_ecdsa.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
m_ecdsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_ecdsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_ecdsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
m_ecdsa.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
m_ecdsa.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
m_ecdsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_ecdsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_ecdsa.c
m_md2.o: ../../e_os.h ../../include/openssl/bio.h
m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -534,76 +544,75 @@ m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_md4.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_md4.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_md4.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_md4.o: ../../include/openssl/lhash.h ../../include/openssl/md4.h
m_md4.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_md4.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_md4.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_md4.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
m_md4.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_md4.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_md4.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md4.c
m_md4.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_md4.o: ../../include/openssl/md4.h ../../include/openssl/obj_mac.h
m_md4.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_md4.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_md4.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
m_md4.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_md4.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_md4.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_md4.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_md4.o: ../cryptlib.h evp_locl.h m_md4.c
m_md5.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_md5.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_md5.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_md5.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_md5.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_md5.o: ../../include/openssl/lhash.h ../../include/openssl/md5.h
m_md5.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_md5.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_md5.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_md5.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
m_md5.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_md5.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_md5.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_md5.c
m_md5.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_md5.o: ../../include/openssl/md5.h ../../include/openssl/obj_mac.h
m_md5.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_md5.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_md5.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
m_md5.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_md5.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_md5.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_md5.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_md5.o: ../cryptlib.h evp_locl.h m_md5.c
m_mdc2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_mdc2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_mdc2.o: ../../include/openssl/des.h ../../include/openssl/des_old.h
m_mdc2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_mdc2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_mdc2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_mdc2.o: ../../include/openssl/lhash.h ../../include/openssl/mdc2.h
m_mdc2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_mdc2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_mdc2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_mdc2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
m_mdc2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_mdc2.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
m_mdc2.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
m_mdc2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_mdc2.c
m_sm3.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_sm3.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_sm3.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
m_sm3.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
m_sm3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_sm3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_sm3.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rsa.h
m_sm3.o: ../../include/openssl/safestack.h ../../include/openssl/sm3.h
m_sm3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_sm3.o: ../cryptlib.h m_sm3.c
m_mdc2.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_mdc2.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h
m_mdc2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_mdc2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_mdc2.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
m_mdc2.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_mdc2.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_mdc2.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_mdc2.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
m_mdc2.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_mdc2.o: ../cryptlib.h evp_locl.h m_mdc2.c
m_null.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_null.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_null.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_null.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_null.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_null.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_null.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_null.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_null.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
m_null.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_null.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_null.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_null.c
m_null.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_null.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_null.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_null.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_null.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_null.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_null.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_null.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_null.o: ../cryptlib.h m_null.c
m_ripemd.o: ../../e_os.h ../../include/openssl/asn1.h
m_ripemd.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
m_ripemd.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
m_ripemd.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
m_ripemd.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
m_ripemd.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
m_ripemd.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_ripemd.o: ../../include/openssl/opensslconf.h
m_ripemd.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
m_ripemd.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_ripemd.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_ripemd.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_ripemd.o: ../../include/openssl/pkcs7.h ../../include/openssl/ripemd.h
m_ripemd.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_ripemd.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
m_ripemd.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
m_ripemd.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_ripemd.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h
m_ripemd.o: m_ripemd.c
@@ -612,14 +621,15 @@ m_sha.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_sha.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_sha.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_sha.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_sha.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_sha.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_sha.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_sha.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
m_sha.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_sha.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_sha.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_sha.o: ../cryptlib.h evp_locl.h m_sha.c
m_sha.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_sha.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_sha.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_sha.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_sha.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
m_sha.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
m_sha.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
m_sha.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_sha.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_sha.c
m_sha1.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_sha1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_sha1.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -635,64 +645,85 @@ m_sigver.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
m_sigver.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
m_sigver.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
m_sigver.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
m_sigver.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
m_sigver.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_sigver.o: ../../include/openssl/opensslconf.h
m_sigver.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
m_sigver.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_sigver.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_sigver.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_sigver.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
m_sigver.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_sigver.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
m_sigver.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
m_sigver.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
m_sigver.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h
m_sigver.o: m_sigver.c
m_sm3.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_sm3.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_sm3.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_sm3.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_sm3.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_sm3.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_sm3.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_sm3.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_sm3.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_sm3.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_sm3.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_sm3.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_sm3.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_sm3.o: ../cryptlib.h m_sm3.c
m_wp.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
m_wp.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
m_wp.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
m_wp.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
m_wp.o: ../../include/openssl/err.h ../../include/openssl/evp.h
m_wp.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
m_wp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
m_wp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
m_wp.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
m_wp.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
m_wp.o: ../../include/openssl/symhacks.h ../../include/openssl/whrlpool.h
m_wp.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
m_wp.o: ../cryptlib.h evp_locl.h m_wp.c
m_wp.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
m_wp.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
m_wp.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
m_wp.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
m_wp.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
m_wp.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
m_wp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
m_wp.o: ../../include/openssl/whrlpool.h ../../include/openssl/x509.h
m_wp.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h m_wp.c
names.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
names.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
names.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
names.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
names.o: ../../include/openssl/err.h ../../include/openssl/evp.h
names.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
names.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
names.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
names.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
names.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
names.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
names.o: ../../include/openssl/x509_vfy.h ../cryptlib.h names.c
names.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
names.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
names.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
names.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
names.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
names.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
names.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
names.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
names.o: ../cryptlib.h names.c
p5_crpt.o: ../../e_os.h ../../include/openssl/asn1.h
p5_crpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p5_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p5_crpt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p5_crpt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p5_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p5_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p5_crpt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p5_crpt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p5_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p5_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p5_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p5_crpt.o: ../cryptlib.h p5_crpt.c
p5_crpt.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p5_crpt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p5_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p5_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p5_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p5_crpt.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p5_crpt.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p5_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p5_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p5_crpt.c
p5_crpt2.o: ../../e_os.h ../../include/openssl/asn1.h
p5_crpt2.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p5_crpt2.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p5_crpt2.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p5_crpt2.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p5_crpt2.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h
p5_crpt2.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p5_crpt2.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p5_crpt2.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p5_crpt2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p5_crpt2.o: ../../include/openssl/opensslconf.h
p5_crpt2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p5_crpt2.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p5_crpt2.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p5_crpt2.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p5_crpt2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p5_crpt2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h evp_locl.h
p5_crpt2.o: p5_crpt2.c
@@ -701,27 +732,31 @@ p_dec.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p_dec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p_dec.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p_dec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_dec.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_dec.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_dec.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_dec.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
p_dec.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
p_dec.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p_dec.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_dec.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_dec.c
p_dec.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_dec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_dec.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_dec.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_dec.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
p_dec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_dec.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p_dec.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_dec.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_dec.o: ../cryptlib.h p_dec.c
p_enc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
p_enc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p_enc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
p_enc.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
p_enc.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_enc.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_enc.c
p_enc.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_enc.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
p_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_enc.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_enc.o: ../cryptlib.h p_enc.c
p_lib.o: ../../e_os.h ../../include/openssl/asn1.h
p_lib.o: ../../include/openssl/asn1_mac.h ../../include/openssl/bio.h
p_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
@@ -730,63 +765,71 @@ p_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
p_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
p_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
p_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_lib.o: ../asn1/asn1_locl.h ../cryptlib.h p_lib.c
p_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
p_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
p_lib.o: p_lib.c
p_open.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
p_open.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p_open.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p_open.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p_open.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_open.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_open.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_open.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_open.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
p_open.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_open.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_open.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_open.o: ../cryptlib.h p_open.c
p_open.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_open.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_open.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_open.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_open.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
p_open.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p_open.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p_open.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_open.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_open.c
p_seal.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
p_seal.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p_seal.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p_seal.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_seal.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
p_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
p_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_seal.c
p_seal.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_seal.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_seal.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_seal.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
p_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_seal.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p_seal.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_seal.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_seal.o: ../cryptlib.h p_seal.c
p_sign.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
p_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_sign.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_sign.c
p_sign.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_sign.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p_sign.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
p_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p_sign.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p_sign.o: ../cryptlib.h p_sign.c
p_verify.o: ../../e_os.h ../../include/openssl/asn1.h
p_verify.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p_verify.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p_verify.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p_verify.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p_verify.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p_verify.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p_verify.o: ../../include/openssl/opensslconf.h
p_verify.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p_verify.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p_verify.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p_verify.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p_verify.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p_verify.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p_verify.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p_verify.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p_verify.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p_verify.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p_verify.c
pmeth_fn.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -816,12 +859,13 @@ pmeth_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pmeth_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pmeth_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
pmeth_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pmeth_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pmeth_lib.o: ../../include/openssl/objects.h
pmeth_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pmeth_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pmeth_lib.o: ../../include/openssl/opensslconf.h
pmeth_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pmeth_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pmeth_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pmeth_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pmeth_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pmeth_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pmeth_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
pmeth_lib.o: evp_locl.h pmeth_lib.c

View File

@@ -348,7 +348,7 @@ const EVP_CIPHER *EVP_sms4_wrap(void)
//TODO: EVP_sms4_256_xxx();
//TODO: EVP_sms4_ctr_avx2()
#endif

View File

@@ -74,7 +74,6 @@ static int ossl_EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek
#ifndef OPENSSL_NO_RSA
if (priv->type != EVP_PKEY_RSA) {
#endif
EVPerr(EVP_F_EVP_PKEY_DECRYPT_OLD, EVP_R_PUBLIC_KEY_NOT_RSA);
#ifndef OPENSSL_NO_RSA
goto err;
}

View File

@@ -92,12 +92,13 @@ hm_pmeth.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
hm_pmeth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
hm_pmeth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
hm_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
hm_pmeth.o: ../../include/openssl/hmac.h ../../include/openssl/lhash.h
hm_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
hm_pmeth.o: ../../include/openssl/opensslconf.h
hm_pmeth.o: ../../include/openssl/hmac.h ../../include/openssl/kdf.h
hm_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
hm_pmeth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
hm_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
hm_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
hm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
hm_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
hm_pmeth.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
hm_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
hm_pmeth.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
hm_pmeth.o: ../cryptlib.h ../evp/evp_locl.h hm_pmeth.c

86
crypto/kdf/Makefile Normal file
View File

@@ -0,0 +1,86 @@
#
# crypto/kdf/Makefile
#
DIR= kdf
TOP= ../..
CC= cc
INCLUDES= -I.. -I$(TOP) -I../../include
CFLAG=-g -Wall
MAKEFILE= Makefile
AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile
TEST=kdftest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= kdf_x9_63.c
LIBOBJ= kdf_x9_63.o
SRC= $(LIBSRC)
EXHEADER= kdf.h
HEADER= $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
@touch lib
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@headerlist="$(EXHEADER)"; for i in $$headerlist; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
update: depend
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
kdf_x9_63.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
kdf_x9_63.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
kdf_x9_63.o: ../../include/openssl/evp.h ../../include/openssl/obj_mac.h
kdf_x9_63.o: ../../include/openssl/objects.h
kdf_x9_63.o: ../../include/openssl/opensslconf.h
kdf_x9_63.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
kdf_x9_63.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
kdf_x9_63.o: ../../include/openssl/symhacks.h kdf.h kdf_x9_63.c

View File

@@ -1,4 +1,4 @@
/* crypto/ecies/kdf_x9_63.c */
/* crypto/kdf/kdf_x9_63.c */
/* ====================================================================
* Copyright (c) 2007 - 2015 The GmSSL Project. All rights reserved.
*
@@ -76,7 +76,6 @@ static void *x963_kdf(const EVP_MD *md, const void *in, size_t inlen,
EVP_MD_CTX_init(&ctx);
//FIXME: it might be wrong
while (rlen > 0) {
counter_be = cpu_to_be32(counter);
counter++;
@@ -138,32 +137,47 @@ static void *x963_sha512kdf(const void *in, size_t inlen,
return x963_kdf(EVP_sha512(), in, inlen, out, outlen);
}
static void *x963_whirlpoolkdf(const void *in, size_t inlen,
void *out, size_t *outlen)
{
return x963_kdf(EVP_whirlpool(), in, inlen, out, outlen);
}
static void *x963_sm3kdf(const void *in, size_t inlen,
void *out, size_t *outlen)
{
return x963_kdf(EVP_sm3(), in, inlen, out, outlen);
}
//FIXME: whirlpool
KDF_FUNC KDF_get_x9_63(const EVP_MD *md)
{
if (md == EVP_md5())
if (md == EVP_md5()) {
return x963_md5kdf;
else if (md == EVP_ripemd160())
} else if (md == EVP_ripemd160()) {
return x963_rmd160kdf;
else if (md == EVP_sha1())
} else if (md == EVP_sha1()) {
return x963_sha1kdf;
else if (md == EVP_sha224())
} else if (md == EVP_sha224()) {
return x963_sha224kdf;
else if (md == EVP_sha256())
} else if (md == EVP_sha256()) {
return x963_sha256kdf;
else if (md == EVP_sha384())
} else if (md == EVP_sha384()) {
return x963_sha384kdf;
else if (md == EVP_sha512())
} else if (md == EVP_sha512()) {
return x963_sha512kdf;
else if (md == EVP_sm3())
} else if (md == EVP_whirlpool()) {
return x963_whirlpoolkdf;
} else if (md == EVP_sm3()) {
return x963_sm3kdf;
}
return NULL;
}

View File

@@ -62,12 +62,12 @@
* [including the GNU Public Licence.]
*/
#define NUM_NID 1044
#define NUM_SN 1020
#define NUM_LN 1020
#define NUM_OBJ 958
#define NUM_NID 1045
#define NUM_SN 1021
#define NUM_LN 1021
#define NUM_OBJ 959
static const unsigned char lvalues[6753]={
static const unsigned char lvalues[6762]={
0x2A,0x86,0x48,0x86,0xF7,0x0D, /* [ 0] OBJ_rsadsi */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x01, /* [ 6] OBJ_pkcs */
0x2A,0x86,0x48,0x86,0xF7,0x0D,0x02,0x02, /* [ 13] OBJ_md2 */
@@ -1020,6 +1020,7 @@ static const unsigned char lvalues[6753]={
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x79, /* [6728] OBJ_sm2sign_with_sha224 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x7A, /* [6736] OBJ_sm2sign_with_sha384 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x83,0x7B, /* [6744] OBJ_sm2sign_with_rmd160 */
0x2A,0x81,0x1C,0xCF,0x55,0x01,0x82,0x2D,0x65,/* [6752] OBJ_wapip192v1 */
};
static const ASN1_OBJECT nid_objs[NUM_NID]={
@@ -2695,6 +2696,7 @@ static const ASN1_OBJECT nid_objs[NUM_NID]={
8,&(lvalues[6736]),0},
{"SM2Sign-with-RMD160","sm2sign-with-rmd160",NID_sm2sign_with_rmd160,
8,&(lvalues[6744]),0},
{"wapip192v1","wapip192v1",NID_wapip192v1,9,&(lvalues[6752]),0},
};
static const unsigned int sn_objs[NUM_SN]={
@@ -3711,6 +3713,7 @@ static const unsigned int sn_objs[NUM_SN]={
740, /* "wap-wsg-idm-ecid-wtls7" */
741, /* "wap-wsg-idm-ecid-wtls8" */
742, /* "wap-wsg-idm-ecid-wtls9" */
1044, /* "wapip192v1" */
804, /* "whirlpool" */
868, /* "x121Address" */
503, /* "x500UniqueIdentifier" */
@@ -4732,6 +4735,7 @@ static const unsigned int ln_objs[NUM_LN]={
740, /* "wap-wsg-idm-ecid-wtls7" */
741, /* "wap-wsg-idm-ecid-wtls8" */
742, /* "wap-wsg-idm-ecid-wtls9" */
1044, /* "wapip192v1" */
804, /* "whirlpool" */
868, /* "x121Address" */
503, /* "x500UniqueIdentifier" */
@@ -5394,6 +5398,7 @@ static const unsigned int obj_objs[NUM_OBJ]={
970, /* OBJ_sm2sign 1 2 156 10197 1 301 1 */
971, /* OBJ_sm2keyagreement 1 2 156 10197 1 301 2 */
972, /* OBJ_sm2encrypt 1 2 156 10197 1 301 3 */
1044, /* OBJ_wapip192v1 1 2 156 10197 1 301 101 */
1008, /* OBJ_sm9sign 1 2 156 10197 1 302 1 */
1009, /* OBJ_sm9keyagreement 1 2 156 10197 1 302 2 */
1010, /* OBJ_sm9encrypt 1 2 156 10197 1 302 3 */

View File

@@ -4493,6 +4493,10 @@
#define NID_sm2sign_with_rmd160 1043
#define OBJ_sm2sign_with_rmd160 OBJ_sm_scheme,507L
#define SN_wapip192v1 "wapip192v1"
#define NID_wapip192v1 1044
#define OBJ_wapip192v1 OBJ_sm_scheme,301L,101L
#define SN_zuc "ZUC"
#define LN_zuc "zuc"
#define NID_zuc 1000

View File

@@ -1041,3 +1041,4 @@ sm2sign_with_sha512 1040
sm2sign_with_sha224 1041
sm2sign_with_sha384 1042
sm2sign_with_rmd160 1043
wapip192v1 1044

View File

@@ -1444,6 +1444,8 @@ sm-scheme 505 : SM2Sign-with-SHA224 : sm2sign-with-sha224
sm-scheme 506 : SM2Sign-with-SHA384 : sm2sign-with-sha384
sm-scheme 507 : SM2Sign-with-RMD160 : sm2sign-with-rmd160
sm-scheme 301 101 : wapip192v1
# GmSSL ZUC OID
sm-scheme 800 : ZUC : zuc

View File

@@ -84,12 +84,14 @@ ocsp_asn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
ocsp_asn.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
ocsp_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ocsp_asn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ocsp_asn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ocsp_asn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ocsp_asn.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ocsp_asn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_asn.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_asn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ocsp_asn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ocsp_asn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ocsp_asn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ocsp_asn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_asn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_asn.o: ocsp_asn.c
@@ -99,27 +101,30 @@ ocsp_cl.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
ocsp_cl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ocsp_cl.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ocsp_cl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ocsp_cl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_cl.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_cl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ocsp_cl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
ocsp_cl.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
ocsp_cl.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
ocsp_cl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ocsp_cl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_cl.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_cl.o: ../cryptlib.h ocsp_cl.c
ocsp_cl.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ocsp_cl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_cl.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_cl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_cl.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
ocsp_cl.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ocsp_cl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ocsp_cl.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ocsp_cl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ocsp_cl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ocsp_cl.o: ../../include/openssl/x509v3.h ../cryptlib.h ocsp_cl.c
ocsp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
ocsp_err.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
ocsp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ocsp_err.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ocsp_err.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ocsp_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ocsp_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_err.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_err.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ocsp_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_err.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_err.o: ../../include/openssl/opensslconf.h
ocsp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ocsp_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ocsp_err.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ocsp_err.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ocsp_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_err.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_err.o: ocsp_err.c
@@ -129,12 +134,13 @@ ocsp_ext.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
ocsp_ext.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ocsp_ext.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ocsp_ext.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ocsp_ext.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_ext.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_ext.o: ../../include/openssl/opensslconf.h
ocsp_ext.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ocsp_ext.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_ext.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_ext.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_ext.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ocsp_ext.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ocsp_ext.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ocsp_ext.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ocsp_ext.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ocsp_ext.o: ../../include/openssl/x509v3.h ../cryptlib.h ocsp_ext.c
@@ -144,27 +150,31 @@ ocsp_ht.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
ocsp_ht.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ocsp_ht.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ocsp_ht.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ocsp_ht.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_ht.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_ht.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
ocsp_ht.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
ocsp_ht.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ocsp_ht.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ocsp_ht.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ocsp_ht.o: ../../include/openssl/x509v3.h ocsp_ht.c
ocsp_ht.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ocsp_ht.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_ht.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_ht.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_ht.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ocsp_ht.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ocsp_ht.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ocsp_ht.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_ht.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_ht.o: ocsp_ht.c
ocsp_lib.o: ../../e_os.h ../../include/openssl/asn1.h
ocsp_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
ocsp_lib.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
ocsp_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ocsp_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ocsp_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ocsp_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ocsp_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_lib.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ocsp_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_lib.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_lib.o: ../../include/openssl/opensslconf.h
ocsp_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_lib.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
ocsp_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ocsp_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ocsp_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ocsp_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ocsp_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ocsp_lib.o: ../../include/openssl/x509v3.h ../cryptlib.h ocsp_lib.c
@@ -173,13 +183,15 @@ ocsp_prn.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
ocsp_prn.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ocsp_prn.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ocsp_prn.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ocsp_prn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ocsp_prn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_prn.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_prn.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ocsp_prn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_prn.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_prn.o: ../../include/openssl/opensslconf.h
ocsp_prn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_prn.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
ocsp_prn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ocsp_prn.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ocsp_prn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ocsp_prn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ocsp_prn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_prn.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_prn.o: ocsp_prn.c
@@ -189,13 +201,14 @@ ocsp_srv.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
ocsp_srv.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
ocsp_srv.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
ocsp_srv.o: ../../include/openssl/err.h ../../include/openssl/evp.h
ocsp_srv.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_srv.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_srv.o: ../../include/openssl/opensslconf.h
ocsp_srv.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
ocsp_srv.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_srv.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_srv.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_srv.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
ocsp_srv.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
ocsp_srv.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
ocsp_srv.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
ocsp_srv.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
ocsp_srv.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
ocsp_srv.o: ../../include/openssl/x509v3.h ../cryptlib.h ocsp_srv.c
@@ -204,12 +217,14 @@ ocsp_vfy.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h
ocsp_vfy.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
ocsp_vfy.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
ocsp_vfy.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
ocsp_vfy.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
ocsp_vfy.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
ocsp_vfy.o: ../../include/openssl/ocsp.h ../../include/openssl/opensslconf.h
ocsp_vfy.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
ocsp_vfy.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
ocsp_vfy.o: ../../include/openssl/objects.h ../../include/openssl/ocsp.h
ocsp_vfy.o: ../../include/openssl/opensslconf.h
ocsp_vfy.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
ocsp_vfy.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
ocsp_vfy.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
ocsp_vfy.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
ocsp_vfy.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
ocsp_vfy.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
ocsp_vfy.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
ocsp_vfy.o: ocsp_vfy.c

View File

@@ -22,8 +22,8 @@ TEST=otptest.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=otp.c
LIBOBJ=otp.o
LIBSRC=otp.c otp_err.c
LIBOBJ=otp.o otp_err.o
SRC= $(LIBSRC)
@@ -79,3 +79,20 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
otp.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
otp.o: ../../include/openssl/cbcmac.h ../../include/openssl/crypto.h
otp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
otp.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
otp.o: ../../include/openssl/modes.h ../../include/openssl/obj_mac.h
otp.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
otp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
otp.o: ../../include/openssl/otp.h ../../include/openssl/safestack.h
otp.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
otp.o: ../modes/modes_lcl.h otp.c
otp_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
otp_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
otp_err.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
otp_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
otp_err.o: ../../include/openssl/otp.h ../../include/openssl/safestack.h
otp_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
otp_err.o: otp_err.c

Binary file not shown.

View File

@@ -5,6 +5,7 @@
#include <string.h>
#include <strings.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/crypto.h>
#include <openssl/cbcmac.h>
#include "../modes/modes_lcl.h"
@@ -51,7 +52,7 @@ int OTP_generate(const OTP_PARAMS *params, const void *event, size_t eventlen,
OPENSSL_assert(sizeof(time_t) == 8);
if (!check_params(params)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
OTPerr(OTP_F_OTP_GENERATE, OTP_R_INVALID_PARAMS);
return 0;
}
@@ -60,7 +61,7 @@ int OTP_generate(const OTP_PARAMS *params, const void *event, size_t eventlen,
idlen = 16;
}
if (!(id = OPENSSL_malloc(idlen))) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
OTPerr(OTP_F_OTP_GENERATE, OTP_R_MALLOC_FAILED);
goto end;
}
bzero(id, idlen);
@@ -77,32 +78,41 @@ int OTP_generate(const OTP_PARAMS *params, const void *event, size_t eventlen,
if (params->type == NID_sm3) {
md = EVP_get_digestbynid(params->type);
if (!(mdctx = EVP_MD_CTX_create())) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_DigestInit_ex(mdctx, md, NULL)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_DigestUpdate(mdctx, key, keylen)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_DigestUpdate(mdctx, id, idlen)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_DigestFinal_ex(mdctx, s, (unsigned int *)&slen)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_EVP_LIB);
goto end;
}
} else if (params->type == NID_sms4_ecb) {
cipher = EVP_get_cipherbynid(params->type);
if (!(cmctx = CBCMAC_CTX_new())) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_CBCMAC_LIB);
goto end;
}
if (!CBCMAC_Init(cmctx, key, keylen, cipher, NULL)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_CBCMAC_LIB);
goto end;
}
if (!CBCMAC_Update(cmctx, id, idlen)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_CBCMAC_LIB);
goto end;
}
if (!CBCMAC_Final(cmctx, s, &slen)) {
OTPerr(OTP_F_OTP_GENERATE, ERR_R_CBCMAC_LIB);
goto end;
}
} else {

View File

@@ -79,9 +79,23 @@ typedef struct OTP_PARAMS_st {
int OTP_generate(const OTP_PARAMS *params, const void *event, size_t eventlen,
unsigned int *otp, const unsigned char *key, size_t keylen);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_OTP_strings(void);
#ifdef __cplusplus
extern "C" {
/* Error codes for the OTP functions. */
/* Function codes. */
# define OTP_F_OTP_GENERATE 100
/* Reason codes. */
# define OTP_R_INVALID_PARAMS 101
# define OTP_R_MALLOC_FAILED 100
#ifdef __cplusplus
}
#endif
#endif

94
crypto/otp/otp_err.c Normal file
View File

@@ -0,0 +1,94 @@
/* crypto/otp/otp_err.c */
/* ====================================================================
* Copyright (c) 1999-2016 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/otp.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_OTP,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_OTP,0,reason)
static ERR_STRING_DATA OTP_str_functs[] = {
{ERR_FUNC(OTP_F_OTP_GENERATE), "OTP_generate"},
{0, NULL}
};
static ERR_STRING_DATA OTP_str_reasons[] = {
{ERR_REASON(OTP_R_INVALID_PARAMS), "invalid params"},
{ERR_REASON(OTP_R_MALLOC_FAILED), "malloc failed"},
{0, NULL}
};
#endif
void ERR_load_OTP_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(OTP_str_functs[0].error) == NULL) {
ERR_load_strings(0, OTP_str_functs);
ERR_load_strings(0, OTP_str_reasons);
}
#endif
}

View File

View File

@@ -26,8 +26,7 @@ int PAILLIER_generate_key(PAILLIER *key, int bits);
int PAILLIER_check_key(PAILLIER *key);
int PAILLIER_encrypt(BIGNUM *out, const BIGNUM *in, PAILLIER *pub_key);
int PAILLIER_decrypt(BIGNUM *out, const BIGNUM *in, PAILLIER *pri_key);
int PAILLIER_ciphertext_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
PAILLIER *pub_key);
int PAILLIER_ciphertext_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, PAILLIER *pub_key);
int PAILLIER_ciphertext_scalar_mul(BIGNUM *r, unsigned int k,
const BIGNUM *a, PAILLIER *pub_key)

View File

@@ -18,10 +18,10 @@ APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= pem_sign.c pem_seal.c pem_info.c pem_lib.c pem_all.c pem_err.c \
pem_x509.c pem_xaux.c pem_oth.c pem_pk8.c pem_pkey.c pvkfmt.c pem_sm2.c
pem_x509.c pem_xaux.c pem_oth.c pem_pk8.c pem_pkey.c pvkfmt.c
LIBOBJ= pem_sign.o pem_seal.o pem_info.o pem_lib.o pem_all.o pem_err.o \
pem_x509.o pem_xaux.o pem_oth.o pem_pk8.o pem_pkey.o pvkfmt.o pem_sm2.o
pem_x509.o pem_xaux.o pem_oth.o pem_pk8.o pem_pkey.o pvkfmt.o
SRC= $(LIBSRC)
@@ -85,40 +85,46 @@ pem_all.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h
pem_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pem_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pem_all.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
pem_all.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
pem_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_all.c
pem_all.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_all.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
pem_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_all.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_all.o: ../cryptlib.h pem_all.c
pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
pem_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pem_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pem_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_err.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pem_err.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_err.o: ../../include/openssl/x509_vfy.h pem_err.c
pem_err.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pem_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pem_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pem_err.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
pem_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_err.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_err.o: pem_err.c
pem_info.o: ../../e_os.h ../../include/openssl/asn1.h
pem_info.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_info.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
pem_info.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pem_info.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pem_info.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_info.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_info.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pem_info.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_info.o: ../../include/openssl/opensslconf.h
pem_info.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_info.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_info.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
pem_info.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_info.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_info.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_info.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_info.o: ../cryptlib.h pem_info.c
@@ -129,60 +135,65 @@ pem_lib.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h
pem_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pem_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_lib.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_lib.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
pem_lib.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
pem_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/ui.h
pem_lib.o: ../../include/openssl/ui_compat.h ../../include/openssl/x509.h
pem_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
pem_lib.o: pem_lib.c
pem_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pem_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pem_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pem_lib.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
pem_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pem_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_lib.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h
pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_lib.o: ../asn1/asn1_locl.h ../cryptlib.h pem_lib.c
pem_oth.o: ../../e_os.h ../../include/openssl/asn1.h
pem_oth.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_oth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_oth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_oth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_oth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_oth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_oth.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pem_oth.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pem_oth.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
pem_oth.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
pem_oth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_oth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_oth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_oth.c
pem_oth.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_oth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_oth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_oth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_oth.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_oth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pem_oth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_oth.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_oth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_oth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_oth.o: ../cryptlib.h pem_oth.c
pem_pk8.o: ../../e_os.h ../../include/openssl/asn1.h
pem_pk8.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_pk8.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_pk8.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_pk8.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_pk8.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_pk8.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_pk8.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pem_pk8.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pem_pk8.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h
pem_pk8.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pem_pk8.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_pk8.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_pk8.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_pk8.o: ../cryptlib.h pem_pk8.c
pem_pk8.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_pk8.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_pk8.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_pk8.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_pk8.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_pk8.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
pem_pk8.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
pem_pk8.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pem_pk8.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pem_pk8.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_pk8.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_pk8.c
pem_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
pem_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
pem_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pem_pkey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pem_pkey.o: ../../include/openssl/engine.h ../../include/openssl/err.h
pem_pkey.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_pkey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_pkey.o: ../../include/openssl/opensslconf.h
pem_pkey.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_pkey.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_pkey.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
pem_pkey.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
pem_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_pkey.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pem_pkey.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pem_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_pkey.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
pem_pkey.o: pem_pkey.c
@@ -191,14 +202,15 @@ pem_seal.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_seal.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_seal.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_seal.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_seal.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_seal.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_seal.o: ../../include/openssl/opensslconf.h
pem_seal.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_seal.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_seal.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_seal.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_seal.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_seal.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pem_seal.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_seal.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pem_seal.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pem_seal.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_seal.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.c
pem_sign.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -206,13 +218,14 @@ pem_sign.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_sign.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_sign.o: ../../include/openssl/opensslconf.h
pem_sign.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_sign.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pem_sign.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pem_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pem_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pem_sign.o: ../cryptlib.h pem_sign.c
@@ -221,13 +234,14 @@ pem_x509.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_x509.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_x509.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_x509.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_x509.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_x509.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_x509.o: ../../include/openssl/opensslconf.h
pem_x509.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_x509.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_x509.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_x509.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_x509.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_x509.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pem_x509.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_x509.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pem_x509.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pem_x509.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_x509.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_x509.c
pem_xaux.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -235,13 +249,14 @@ pem_xaux.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pem_xaux.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pem_xaux.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pem_xaux.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pem_xaux.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pem_xaux.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pem_xaux.o: ../../include/openssl/opensslconf.h
pem_xaux.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pem_xaux.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pem_xaux.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pem_xaux.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pem_xaux.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pem_xaux.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pem_xaux.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pem_xaux.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pem_xaux.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pem_xaux.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pem_xaux.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_xaux.c
pvkfmt.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -250,12 +265,14 @@ pvkfmt.o: ../../include/openssl/crypto.h ../../include/openssl/dsa.h
pvkfmt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pvkfmt.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pvkfmt.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pvkfmt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pvkfmt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pvkfmt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pvkfmt.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pvkfmt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pvkfmt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
pvkfmt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pvkfmt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pvkfmt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pvkfmt.c
pvkfmt.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pvkfmt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pvkfmt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pvkfmt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pem.h
pvkfmt.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h
pvkfmt.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
pvkfmt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pvkfmt.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pvkfmt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pvkfmt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pvkfmt.o: ../cryptlib.h pvkfmt.c

View File

@@ -1,270 +0,0 @@
/* crypto/pem/pem_sm2.c */
/* ====================================================================
* Copyright (c) 2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* 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 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 acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
/* ====================================================================
* Copyright (c) 1998-2002 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 <stdio.h>
#include "cryptlib.h"
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
#ifndef OPENSSL_NO_SM2
static EC_KEY *pkey_get_sm2key(EVP_PKEY *key, EC_KEY **eckey)
{
EC_KEY *dtmp;
if (!key)
return NULL;
dtmp = EVP_PKEY_get1_SM2(key);
EVP_PKEY_free(key);
if (!dtmp)
return NULL;
if (eckey) {
EC_KEY_free(*eckey);
*eckey = dtmp;
}
fprintf(stderr, "GMSSL %s %d\n", __FILE__, __LINE__);
return dtmp;
}
EC_KEY *PEM_read_bio_SM2PrivateKey(BIO *bp, EC_KEY **key, pem_password_cb *cb,
void *u)
{
EVP_PKEY *pktmp;
pktmp = PEM_read_bio_PrivateKey(bp, NULL, cb, u);
return pkey_get_sm2key(pktmp, key); /* will free pktmp */
}
IMPLEMENT_PEM_rw_const(SM2PKParameters, EC_GROUP, PEM_STRING_SM2PARAMETERS,
ECPKParameters)
# ifdef OPENSSL_FIPS
int PEM_write_bio_SM2PrivateKey(BIO *bp, EC_KEY *x, const EVP_CIPHER *enc,
unsigned char *kstr, int klen,
pem_password_cb *cb, void *u)
{
if (FIPS_mode()) {
EVP_PKEY *k;
int ret;
k = EVP_PKEY_new();
if (!k)
return 0;
EVP_PKEY_set1_EC_KEY(k, x);
ret = PEM_write_bio_PrivateKey(bp, k, enc, kstr, klen, cb, u);
EVP_PKEY_free(k);
return ret;
} else
return PEM_ASN1_write_bio((i2d_of_void *)i2d_ECPrivateKey,
PEM_STRING_SM2PRIVATEKEY,
bp, x, enc, kstr, klen, cb, u);
}
# ifndef OPENSSL_NO_FP_API
int PEM_write_SM2PrivateKey(FILE *fp, EC_KEY *x, const EVP_CIPHER *enc,
unsigned char *kstr, int klen,
pem_password_cb *cb, void *u)
{
if (FIPS_mode()) {
EVP_PKEY *k;
int ret;
k = EVP_PKEY_new();
if (!k)
return 0;
EVP_PKEY_set1_EC_KEY(k, x);
ret = PEM_write_PrivateKey(fp, k, enc, kstr, klen, cb, u);
EVP_PKEY_free(k);
return ret;
} else
return PEM_ASN1_write((i2d_of_void *)i2d_ECPrivateKey,
PEM_STRING_SM2PRIVATEKEY,
fp, x, enc, kstr, klen, cb, u);
}
# endif
# else
IMPLEMENT_PEM_write_cb(SM2PrivateKey, EC_KEY, PEM_STRING_SM2PRIVATEKEY,
ECPrivateKey)
# endif
IMPLEMENT_PEM_rw(SM2_PUBKEY, EC_KEY, PEM_STRING_PUBLIC, EC_PUBKEY)
# ifndef OPENSSL_NO_FP_API
EC_KEY *PEM_read_SM2PrivateKey(FILE *fp, EC_KEY **eckey, pem_password_cb *cb,
void *u)
{
EVP_PKEY *pktmp;
pktmp = PEM_read_PrivateKey(fp, NULL, cb, u);
printf("GMSSL %s %d\n", __FILE__, __LINE__);
BIO *out = BIO_new_fp(stderr, BIO_NOCLOSE);
EVP_PKEY_print_public(out, pktmp, 0, NULL);
EVP_PKEY_print_private(out, pktmp, 0, NULL);
EVP_PKEY_print_params(out, pktmp, 0, NULL);
return pkey_get_sm2key(pktmp, eckey); /* will free pktmp */
}
# endif
#endif

View File

@@ -87,39 +87,43 @@ p12_add.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_add.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_add.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_add.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_add.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_add.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_add.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_add.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_add.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_add.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_add.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_add.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_add.c
p12_add.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_add.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_add.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_add.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_add.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_add.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_add.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_add.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_add.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_add.o: ../cryptlib.h p12_add.c
p12_asn.o: ../../e_os.h ../../include/openssl/asn1.h
p12_asn.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h
p12_asn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p12_asn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p12_asn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p12_asn.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p12_asn.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_asn.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_asn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_asn.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_asn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_asn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_asn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_asn.o: ../cryptlib.h p12_asn.c
p12_asn.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p12_asn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_asn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_asn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_asn.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_asn.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p12_asn.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p12_asn.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_asn.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_asn.c
p12_attr.o: ../../e_os.h ../../include/openssl/asn1.h
p12_attr.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_attr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_attr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_attr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_attr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_attr.o: ../../include/openssl/opensslconf.h
p12_attr.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_attr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_attr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_attr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_attr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_attr.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_attr.o: ../cryptlib.h p12_attr.c
@@ -128,12 +132,13 @@ p12_crpt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_crpt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_crpt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_crpt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_crpt.o: ../../include/openssl/opensslconf.h
p12_crpt.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_crpt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_crpt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_crpt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_crpt.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_crpt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_crpt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_crpt.o: ../cryptlib.h p12_crpt.c
@@ -142,25 +147,28 @@ p12_crt.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_crt.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_crt.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_crt.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_crt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_crt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_crt.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_crt.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_crt.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_crt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_crt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_crt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_crt.c
p12_crt.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_crt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_crt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_crt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_crt.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_crt.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_crt.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_crt.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_crt.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_crt.o: ../cryptlib.h p12_crt.c
p12_decr.o: ../../e_os.h ../../include/openssl/asn1.h
p12_decr.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_decr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_decr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_decr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_decr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_decr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_decr.o: ../../include/openssl/opensslconf.h
p12_decr.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_decr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_decr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_decr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_decr.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_decr.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_decr.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_decr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_decr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_decr.o: ../cryptlib.h p12_decr.c
@@ -169,12 +177,13 @@ p12_init.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_init.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_init.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_init.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_init.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_init.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_init.o: ../../include/openssl/opensslconf.h
p12_init.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_init.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_init.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_init.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_init.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_init.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_init.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_init.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_init.o: ../cryptlib.h p12_init.c
@@ -184,25 +193,27 @@ p12_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p12_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p12_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p12_key.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p12_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_key.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_key.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_key.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_key.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_key.o: ../cryptlib.h p12_key.c
p12_key.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p12_key.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_key.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p12_key.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p12_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_key.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_key.c
p12_kiss.o: ../../e_os.h ../../include/openssl/asn1.h
p12_kiss.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_kiss.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_kiss.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_kiss.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_kiss.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_kiss.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_kiss.o: ../../include/openssl/opensslconf.h
p12_kiss.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_kiss.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_kiss.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_kiss.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_kiss.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_kiss.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_kiss.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_kiss.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_kiss.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_kiss.o: ../cryptlib.h p12_kiss.c
@@ -212,12 +223,14 @@ p12_mutl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_mutl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_mutl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_mutl.o: ../../include/openssl/evp.h ../../include/openssl/hmac.h
p12_mutl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_mutl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_mutl.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p12_mutl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_mutl.o: ../../include/openssl/opensslconf.h
p12_mutl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_mutl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_mutl.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_mutl.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
p12_mutl.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
p12_mutl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_mutl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_mutl.c
p12_npas.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
@@ -225,12 +238,14 @@ p12_npas.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
p12_npas.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
p12_npas.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
p12_npas.o: ../../include/openssl/err.h ../../include/openssl/evp.h
p12_npas.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_npas.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_npas.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
p12_npas.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_npas.o: ../../include/openssl/opensslconf.h
p12_npas.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_npas.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
p12_npas.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_npas.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_npas.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_npas.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_npas.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_npas.o: p12_npas.c
@@ -239,50 +254,57 @@ p12_p8d.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_p8d.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_p8d.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_p8d.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_p8d.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_p8d.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_p8d.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_p8d.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_p8d.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_p8d.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_p8d.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_p8d.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_p8d.c
p12_p8d.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_p8d.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_p8d.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_p8d.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_p8d.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_p8d.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_p8d.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_p8d.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_p8d.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_p8d.o: ../cryptlib.h p12_p8d.c
p12_p8e.o: ../../e_os.h ../../include/openssl/asn1.h
p12_p8e.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_p8e.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_p8e.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_p8e.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_p8e.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_p8e.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_p8e.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_p8e.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_p8e.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_p8e.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_p8e.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_p8e.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_p8e.c
p12_p8e.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_p8e.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_p8e.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_p8e.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_p8e.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_p8e.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_p8e.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_p8e.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_p8e.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_p8e.o: ../cryptlib.h p12_p8e.c
p12_utl.o: ../../e_os.h ../../include/openssl/asn1.h
p12_utl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
p12_utl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
p12_utl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
p12_utl.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
p12_utl.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
p12_utl.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
p12_utl.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
p12_utl.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
p12_utl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
p12_utl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
p12_utl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
p12_utl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h p12_utl.c
p12_utl.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
p12_utl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
p12_utl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
p12_utl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
p12_utl.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
p12_utl.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
p12_utl.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
p12_utl.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
p12_utl.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
p12_utl.o: ../cryptlib.h p12_utl.c
pk12err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
pk12err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
pk12err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pk12err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pk12err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pk12err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk12err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk12err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk12err.o: ../../include/openssl/pkcs12.h ../../include/openssl/pkcs7.h
pk12err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pk12err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pk12err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pk12err.o: pk12err.c
pk12err.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pk12err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk12err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pk12err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs12.h
pk12err.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pk12err.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pk12err.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pk12err.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pk12err.o: ../../include/openssl/x509_vfy.h pk12err.c

View File

@@ -95,11 +95,13 @@ pk7_asn1.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
pk7_asn1.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pk7_asn1.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pk7_asn1.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pk7_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_asn1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk7_asn1.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pk7_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_asn1.o: ../../include/openssl/opensslconf.h
pk7_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pk7_asn1.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pk7_asn1.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pk7_asn1.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pk7_asn1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pk7_asn1.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pk7_asn1.c
pk7_attr.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
@@ -107,13 +109,14 @@ pk7_attr.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pk7_attr.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pk7_attr.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pk7_attr.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pk7_attr.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pk7_attr.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_attr.o: ../../include/openssl/opensslconf.h
pk7_attr.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pk7_attr.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_attr.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk7_attr.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_attr.o: ../../include/openssl/pem.h ../../include/openssl/pem2.h
pk7_attr.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pk7_attr.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pk7_attr.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pk7_attr.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pk7_attr.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pk7_attr.o: ../../include/openssl/x509_vfy.h pk7_attr.c
pk7_doit.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -122,11 +125,13 @@ pk7_doit.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
pk7_doit.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pk7_doit.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pk7_doit.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pk7_doit.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_doit.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk7_doit.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pk7_doit.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_doit.o: ../../include/openssl/opensslconf.h
pk7_doit.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_doit.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pk7_doit.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pk7_doit.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pk7_doit.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pk7_doit.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pk7_doit.o: ../../include/openssl/x509v3.h ../cryptlib.h pk7_doit.c
@@ -135,25 +140,28 @@ pk7_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pk7_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pk7_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pk7_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pk7_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pk7_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
pk7_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
pk7_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pk7_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pk7_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pk7_lib.o: ../asn1/asn1_locl.h ../cryptlib.h pk7_lib.c
pk7_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pk7_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk7_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pk7_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pk7_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pk7_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pk7_lib.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h
pk7_lib.o: pk7_lib.c
pk7_mime.o: ../../e_os.h ../../include/openssl/asn1.h
pk7_mime.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
pk7_mime.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
pk7_mime.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
pk7_mime.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
pk7_mime.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
pk7_mime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_mime.o: ../../include/openssl/opensslconf.h
pk7_mime.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
pk7_mime.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_mime.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
pk7_mime.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_mime.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
pk7_mime.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
pk7_mime.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
pk7_mime.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
pk7_mime.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
pk7_mime.o: ../cryptlib.h pk7_mime.c
@@ -163,12 +171,13 @@ pk7_smime.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
pk7_smime.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
pk7_smime.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
pk7_smime.o: ../../include/openssl/err.h ../../include/openssl/evp.h
pk7_smime.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
pk7_smime.o: ../../include/openssl/objects.h
pk7_smime.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
pk7_smime.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
pk7_smime.o: ../../include/openssl/opensslconf.h
pk7_smime.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
pk7_smime.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
pk7_smime.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
pk7_smime.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
pk7_smime.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
pk7_smime.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
pk7_smime.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h
pk7_smime.o: ../cryptlib.h pk7_smime.c

View File

@@ -105,11 +105,13 @@ rand_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
rand_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
rand_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
rand_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
rand_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rand_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rand_lib.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
rand_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rand_lib.o: ../../include/openssl/opensslconf.h
rand_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rand_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
rand_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rand_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rand_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rand_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rand_lib.o: ../cryptlib.h rand_lib.c

View File

@@ -89,12 +89,13 @@ rsa_ameth.o: ../../include/openssl/cms.h ../../include/openssl/crypto.h
rsa_ameth.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_ameth.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_ameth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
rsa_ameth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_ameth.o: ../../include/openssl/objects.h
rsa_ameth.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
rsa_ameth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_ameth.o: ../../include/openssl/opensslconf.h
rsa_ameth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
rsa_ameth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_ameth.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rsa_ameth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_ameth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_ameth.o: ../asn1/asn1_locl.h ../cryptlib.h rsa_ameth.c
@@ -104,12 +105,13 @@ rsa_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
rsa_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
rsa_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
rsa_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
rsa_asn1.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
rsa_asn1.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_asn1.o: ../../include/openssl/opensslconf.h
rsa_asn1.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
rsa_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_asn1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rsa_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
rsa_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_asn1.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rsa_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_asn1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_asn1.o: ../cryptlib.h rsa_asn1.c
@@ -127,13 +129,14 @@ rsa_crpt.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rsa_crpt.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_crpt.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_crpt.o: ../../include/openssl/engine.h ../../include/openssl/err.h
rsa_crpt.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
rsa_crpt.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_crpt.o: ../../include/openssl/opensslconf.h
rsa_crpt.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
rsa_crpt.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_crpt.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rsa_crpt.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_crpt.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
rsa_crpt.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
rsa_crpt.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
rsa_crpt.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
rsa_crpt.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
rsa_crpt.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
rsa_crpt.o: ../../include/openssl/x509_vfy.h ../cryptlib.h rsa_crpt.c
rsa_depr.o: ../../e_os.h ../../include/openssl/asn1.h
@@ -176,15 +179,16 @@ rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
rsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
rsa_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
rsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_lib.o: ../cryptlib.h rsa_lib.c
rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
rsa_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rsa_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
rsa_lib.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
rsa_lib.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
rsa_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
rsa_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h rsa_lib.c
rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h
rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
rsa_none.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
@@ -232,12 +236,14 @@ rsa_pmeth.o: ../../include/openssl/cms.h ../../include/openssl/conf.h
rsa_pmeth.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
rsa_pmeth.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
rsa_pmeth.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
rsa_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
rsa_pmeth.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_pmeth.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
rsa_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_pmeth.o: ../../include/openssl/objects.h
rsa_pmeth.o: ../../include/openssl/opensslconf.h
rsa_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
rsa_pmeth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_pmeth.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rsa_pmeth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_pmeth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_pmeth.o: ../../include/openssl/x509v3.h ../cryptlib.h ../evp/evp_locl.h
@@ -269,11 +275,13 @@ rsa_saos.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rsa_saos.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_saos.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_saos.o: ../../include/openssl/err.h ../../include/openssl/evp.h
rsa_saos.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_saos.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rsa_saos.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
rsa_saos.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_saos.o: ../../include/openssl/opensslconf.h
rsa_saos.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_saos.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
rsa_saos.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_saos.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rsa_saos.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_saos.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_saos.o: ../cryptlib.h rsa_saos.c
@@ -283,11 +291,13 @@ rsa_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
rsa_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
rsa_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
rsa_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h
rsa_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
rsa_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
rsa_sign.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
rsa_sign.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
rsa_sign.o: ../../include/openssl/opensslconf.h
rsa_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
rsa_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
rsa_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
rsa_sign.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
rsa_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
rsa_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
rsa_sign.o: ../cryptlib.h rsa_locl.h rsa_sign.c

244
crypto/skf/Makefile Normal file
View File

@@ -0,0 +1,244 @@
#
# OpenSSL/crypto/skf/Makefile
#
DIR= skf
TOP= ../..
CC= cc
INCLUDES=
CFLAG=-g
MAKEFILE= Makefile
AR= ar r
CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile
TEST=
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC= skf_dev.c skf_token.c skf_dgst.c skf_ec.c skf_enc.c \
skf_err.c skf_errstr.c skf_handle.c skf_mac.c skf_rand.c \
skf_rsa.c skf_sesskey.c
LIBOBJ= skf_dev.o skf_token.o skf_dgst.o skf_ec.o skf_enc.o \
skf_err.o skf_errstr.o skf_handle.o skf_mac.o skf_rand.o \
skf_rsa.o skf_sesskey.o
SRC= $(LIBSRC)
EXHEADER= skf.h skf_ex.h
HEADER= skf_lcl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
@touch lib
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
skf_dev.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_dev.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_dev.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_dev.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_dev.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_dev.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_dev.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_dev.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_dev.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_dev.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_dev.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_dev.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_dev.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_dev.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
skf_dev.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
skf_dev.o: skf_dev.c skf_lcl.h
skf_dgst.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_dgst.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_dgst.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_dgst.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_dgst.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_dgst.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_dgst.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_dgst.o: ../../include/openssl/opensslconf.h
skf_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
skf_dgst.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
skf_dgst.o: ../../include/openssl/sha.h ../../include/openssl/skf.h
skf_dgst.o: ../../include/openssl/skf_ex.h ../../include/openssl/sm2.h
skf_dgst.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
skf_dgst.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_dgst.o: ../../include/openssl/x509_vfy.h skf_dgst.c skf_lcl.h
skf_ec.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_ec.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_ec.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_ec.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_ec.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_ec.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_ec.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_ec.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_ec.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_ec.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_ec.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_ec.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_ec.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_ec.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
skf_ec.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
skf_ec.o: skf_ec.c skf_lcl.h
skf_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_enc.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_enc.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_enc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_enc.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_enc.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_enc.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_enc.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_enc.o: ../../include/openssl/sms4.h ../../include/openssl/stack.h
skf_enc.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_enc.o: ../../include/openssl/x509_vfy.h skf_enc.c skf_lcl.h
skf_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_err.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_err.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_err.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_err.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_err.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
skf_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
skf_err.o: skf_err.c
skf_errstr.o: ../../include/openssl/skf.h skf_errstr.c
skf_handle.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_handle.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_handle.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_handle.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_handle.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_handle.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_handle.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_handle.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_handle.o: ../../include/openssl/opensslconf.h
skf_handle.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
skf_handle.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
skf_handle.o: ../../include/openssl/sha.h ../../include/openssl/skf.h
skf_handle.o: ../../include/openssl/skf_ex.h ../../include/openssl/sm2.h
skf_handle.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
skf_handle.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_handle.o: ../../include/openssl/x509_vfy.h skf_handle.c skf_lcl.h
skf_mac.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_mac.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_mac.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_mac.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_mac.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_mac.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_mac.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_mac.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_mac.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_mac.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_mac.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_mac.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_mac.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_mac.o: ../../include/openssl/sms4.h ../../include/openssl/stack.h
skf_mac.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_mac.o: ../../include/openssl/x509_vfy.h skf_lcl.h skf_mac.c
skf_rand.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_rand.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_rand.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_rand.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_rand.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_rand.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_rand.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_rand.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_rand.o: ../../include/openssl/opensslconf.h
skf_rand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
skf_rand.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
skf_rand.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_rand.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_rand.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
skf_rand.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
skf_rand.o: skf_lcl.h skf_rand.c
skf_rsa.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_rsa.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_rsa.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_rsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_rsa.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_rsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_rsa.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_rsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_rsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
skf_rsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_rsa.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
skf_rsa.o: ../../include/openssl/sha.h ../../include/openssl/skf.h
skf_rsa.o: ../../include/openssl/skf_ex.h ../../include/openssl/sm2.h
skf_rsa.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
skf_rsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_rsa.o: ../../include/openssl/x509_vfy.h skf_lcl.h skf_rsa.c
skf_sesskey.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
skf_sesskey.o: ../../include/openssl/buffer.h ../../include/openssl/cbcmac.h
skf_sesskey.o: ../../include/openssl/cmac.h ../../include/openssl/crypto.h
skf_sesskey.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
skf_sesskey.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
skf_sesskey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
skf_sesskey.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
skf_sesskey.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
skf_sesskey.o: ../../include/openssl/opensslconf.h
skf_sesskey.o: ../../include/openssl/opensslv.h
skf_sesskey.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
skf_sesskey.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
skf_sesskey.o: ../../include/openssl/skf.h ../../include/openssl/skf_ex.h
skf_sesskey.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
skf_sesskey.o: ../../include/openssl/sms4.h ../../include/openssl/stack.h
skf_sesskey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
skf_sesskey.o: ../../include/openssl/x509_vfy.h skf_lcl.h skf_sesskey.c
skf_token.o: ../../include/openssl/skf.h skf_token.c

View File

@@ -48,7 +48,9 @@
* ====================================================================
*
*/
/* This header file is from the official specification with minor
* modification.
*/
#ifndef HEADER_SKF_H
#define HEADER_SKF_H
@@ -150,7 +152,7 @@ typedef HANDLE HCONTAINER;
extern "C" {
#endif
typedef struct Struct_Version{
BYTE major;
BYTE minor;
@@ -247,12 +249,12 @@ typedef struct Struct_FILEATTRIBUTE {
ULONG WriteRights;
} FILEATTRIBUTE, *PFILEATTRIBUTE;
ULONG DEVAPI SKF_WaitForDevEvent(LPSTR szDevName,
ULONG *pulDevNameLen,
ULONG *pulEvent);
ULONG DEVAPI SKF_CancelWaitForDevEvent();
ULONG DEVAPI SKF_CancelWaitForDevEvent(void);
ULONG DEVAPI SKF_EnumDev(BOOL bPresent,
LPSTR szNameList,
@@ -305,39 +307,39 @@ ULONG DEVAPI SKF_ChangePIN(HAPPLICATION hApplication,
LONG DEVAPI SKF_GetPINInfo(HAPPLICATION hApplication,
ULONG ulPINType,
ULONG *pulMaxRetryCount,
ULONG *pulRemainRetryCount,
ULONG *pulMaxRetryCount,
ULONG *pulRemainRetryCount,
BOOL *pbDefaultPin);
ULONG DEVAPI SKF_VerifyPIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szPIN,
LPSTR szPIN,
ULONG *pulRetryCount);
ULONG DEVAPI SKF_UnblockPIN(HAPPLICATION hApplication,
LPSTR szAdminPIN,
LPSTR szNewUserPIN,
LPSTR szNewUserPIN,
ULONG *pulRetryCount);
ULONG DEVAPI SKF_ClearSecureState(HAPPLICATION hApplication);
ULONG DEVAPI SKF_CreateApplication(DEVHANDLE hDev,
LPSTR szAppName,
LPSTR szAdminPin,
LPSTR szAdminPin,
DWORD dwAdminPinRetryCount,
LPSTR szUserPin,
LPSTR szUserPin,
DWORD dwUserPinRetryCount,
DWORD dwCreateFileRights,
DWORD dwCreateFileRights,
HAPPLICATION *phApplication);
ULONG DEVAPI SKF_EnumApplication(DEVHANDLE hDev,
LPSTR szAppName,
ULONG *pulSize);
ULONG DEVAPI SKF_DeleteApplication(DEVHANDLE hDev,
ULONG DEVAPI SKF_DeleteApplication(DEVHANDLE hDev,
LPSTR szAppName);
ULONG DEVAPI SKF_OpenApplication(DEVHANDLE hDev,
ULONG DEVAPI SKF_OpenApplication(DEVHANDLE hDev,
LPSTR szAppName,
HAPPLICATION *phApplication);
@@ -345,14 +347,14 @@ ULONG DEVAPI SKF_CloseApplication(HAPPLICATION hApplication);
ULONG DEVAPI SKF_CreateFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulFileSize,
ULONG ulFileSize,
ULONG ulReadRights,
ULONG ulWriteRights);
ULONG DEVAPI SKF_DeleteFile(HAPPLICATION hApplication,
LPSTR szFileName);
ULONG DEVAPI SKF_EnumFiles(HAPPLICATION hApplication,
ULONG DEVAPI SKF_EnumFiles(HAPPLICATION hApplication,
LPSTR szFileList,
ULONG *pulSize);
@@ -362,14 +364,14 @@ ULONG DEVAPI SKF_GetFileInfo(HAPPLICATION hApplication,
ULONG DEVAPI SKF_ReadFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
ULONG ulSize,
BYTE *pbOutData,
ULONG ulOffset,
ULONG ulSize,
BYTE *pbOutData,
ULONG *pulOutLen);
ULONG DEVAPI SKF_WriteFile(HAPPLICATION hApplication,
ULONG DEVAPI SKF_WriteFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
ULONG ulOffset,
BYTE *pbData,
ULONG ulSize);
@@ -377,7 +379,7 @@ ULONG DEVAPI SKF_CreateContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer);
ULONG DEVAPI SKF_DeleteContainer(HAPPLICATION hApplication,
ULONG DEVAPI SKF_DeleteContainer(HAPPLICATION hApplication,
LPSTR szContainerName);
ULONG DEVAPI SKF_EnumContainer(HAPPLICATION hApplication,
@@ -399,7 +401,7 @@ ULONG DEVAPI SKF_CloseContainer(HCONTAINER hContainer);
ULONG DEVAPI SKF_GetContainerType(HCONTAINER hContainer,
ULONG *pulContainerType);
ULONG DEVAPI SKF_ImportCertificate(HCONTAINER hContainer,
ULONG DEVAPI SKF_ImportCertificate(HCONTAINER hContainer,
BOOL bExportSignKey,
BYTE *pbCert,
ULONG ulCertLen);
@@ -409,7 +411,7 @@ ULONG DEVAPI SKF_ExportCertificate(HCONTAINER hContainer,
BYTE *pbCert,
ULONG *pulCertLen);
ULONG DEVAPI SKF_ExportPublicKey(HCONTAINER hContainer,
ULONG DEVAPI SKF_ExportPublicKey(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE *pbBlob,
ULONG *pulBlobLen);
@@ -418,42 +420,42 @@ ULONG DEVAPI SKF_GenRandom(DEVHANDLE hDev,
BYTE *pbRandom,
ULONG ulRandomLen);
ULONG DEVAPI SKF_GenExtRSAKey(DEVHANDLE hDev,
ULONG DEVAPI SKF_GenExtRSAKey(DEVHANDLE hDev,
ULONG ulBitsLen,
RSAPRIVATEKEYBLOB *pBlob);
ULONG DEVAPI SKF_GenRSAKeyPair(HCONTAINER hContainer,
ULONG DEVAPI SKF_GenRSAKeyPair(HCONTAINER hContainer,
ULONG ulBitsLen,
RSAPUBLICKEYBLOB *pBlob);
ULONG DEVAPI SKF_ImportRSAKeyPair(HCONTAINER hContainer,
ULONG DEVAPI SKF_ImportRSAKeyPair(HCONTAINER hContainer,
ULONG ulSymAlgId,
BYTE *pbWrappedKey,
ULONG ulWrappedKeyLen,
BYTE *pbEncryptedData,
ULONG ulEncryptedDataLen);
ULONG DEVAPI SKF_RSASignData(HCONTAINER hContainer,
ULONG DEVAPI SKF_RSASignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG *pulSignLen);
ULONG DEVAPI SKF_RSAVerify(DEVHANDLE hDev,
ULONG DEVAPI SKF_RSAVerify(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
BYTE *pbSignature,
ULONG ulSignLen);
ULONG DEVAPI SKF_RSAExportSessionKey(HCONTAINER hContainer,
ULONG DEVAPI SKF_RSAExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
RSAPUBLICKEYBLOB *pPubKey,
BYTE *pbData,
ULONG *pulDataLen,
HANDLE *phSessionKey);
ULONG DEVAPI SKF_ExtRSAPubKeyOperation(DEVHANDLE hDev,
ULONG DEVAPI SKF_ExtRSAPubKeyOperation(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
@@ -482,7 +484,7 @@ ULONG DEVAPI SKF_ECCSignData(HCONTAINER hContainer,
ULONG DEVAPI SKF_ECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
ULONG ulDataLen,
ECCSIGNATUREBLOB *pSignature);
ULONG DEVAPI SKF_ECCExportSessionKey(HCONTAINER hContainer,
@@ -522,7 +524,7 @@ ULONG DEVAPI SKF_GenerateAgreementDataWithECC(HCONTAINER hContainer,
ULONG ulIDLen,
HANDLE *phAgreementHandle);
ULONG DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(HANDLE hContainer,
ULONG DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(HANDLE hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pSponsorECCPubKeyBlob,
ECCPUBLICKEYBLOB *pSponsorTempECCPubKeyBlob,
@@ -540,13 +542,13 @@ ULONG DEVAPI SKF_GenerateKeyWithECC(HANDLE hAgreementHandle,
ULONG ulIDLen,
HANDLE *phKeyHandle);
ULONG DEVAPI SKF_ImportSessionKey(HCONTAINER hContainer,
ULONG DEVAPI SKF_ImportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
BYTE *pbWrapedData,
ULONG ulWrapedLen,
HANDLE *phKey);
ULONG DEVAPI SKF_SetSymmKey(DEVHANDLE hDev,
ULONG DEVAPI SKF_SetSymmKey(DEVHANDLE hDev,
BYTE *pbKey,
ULONG ulAlgID,
HANDLE *phKey);
@@ -570,39 +572,39 @@ ULONG DEVAPI SKF_EncryptFinal(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG *pulEncryptedDataLen);
ULONG DEVAPI SKF_DecryptInit(HANDLE hKey,
ULONG DEVAPI SKF_DecryptInit(HANDLE hKey,
BLOCKCIPHERPARAM DecryptParam);
ULONG DEVAPI SKF_Decrypt(HANDLE hKey,
ULONG DEVAPI SKF_Decrypt(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen);
ULONG DEVAPI SKF_DecryptUpdate(HANDLE hKey,
ULONG DEVAPI SKF_DecryptUpdate(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen);
ULONG DEVAPI SKF_DecryptFinal(HANDLE hKey,
ULONG DEVAPI SKF_DecryptFinal(HANDLE hKey,
BYTE *pbDecryptedData,
ULONG *pulDecryptedDataLen);
ULONG DEVAPI SKF_DigestInit(DEVHANDLE hDev,
ULONG DEVAPI SKF_DigestInit(DEVHANDLE hDev,
ULONG ulAlgID,
ECCPUBLICKEYBLOB *pPubKey,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phHash);
ULONG DEVAPI SKF_Digest(HANDLE hHash,
ULONG DEVAPI SKF_Digest(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbHashData,
ULONG *pulHashLen);
ULONG DEVAPI SKF_DigestUpdate(HANDLE hHash,
ULONG DEVAPI SKF_DigestUpdate(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen);
@@ -631,7 +633,6 @@ ULONG DEVAPI SKF_MacFinal(HANDLE hMac,
ULONG DEVAPI SKF_CloseHandle(HANDLE hHandle);
#define SAR_OK 0x00000000
#define SAR_FAIL 0x0A000001
#define SAR_UNKNOWNERR 0x0A000002
@@ -660,7 +661,6 @@ ULONG DEVAPI SKF_CloseHandle(HANDLE hHandle);
#define SAR_RSADECERR 0x0A000019
#define SAR_HASHNOTEQUALERR 0x0A00001A
#define SAR_KEYNOTFOUNTERR 0x0A00001B
#define SAR_KEYNOTFOUNDERR 0x0A00001B
#define SAR_CERTNOTFOUNTERR 0x0A00001C
#define SAR_NOTEXPORTERR 0x0A00001D
#define SAR_DECRYPTPADERR 0x0A00001E

135
crypto/skf/skf_dev.c Normal file
View File

@@ -0,0 +1,135 @@
/* crypto/skf/skf_dev.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <string.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
#define DEV_NAME "pseudo_dev"
#define DEV_NAME_LIST DEV_NAME"\0"
ULONG DEVAPI SKF_EnumDev(BOOL bPresent,
LPSTR szNameList,
ULONG *pulSize)
{
if (!szNameList) {
*pulSize = sizeof(DEV_NAME_LIST);
return SAR_OK;
}
if (*pulSize < sizeof(DEV_NAME_LIST)) {
return SAR_FAIL;
}
memcpy(szNameList, DEV_NAME_LIST, sizeof(DEV_NAME_LIST));
return SAR_OK;
}
ULONG DEVAPI SKF_ConnectDev(LPSTR szName,
DEVHANDLE *phDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DisConnectDev(DEVHANDLE hDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevState(LPSTR szDevName,
ULONG *pulDevState)
{
if (!pulDevState) {
SKFerr(SKF_F_SKF_GETDEVSTATE, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
*pulDevState = DEV_PRESENT_STATE;
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevInfo(DEVHANDLE hDev,
DEVINFO *pDevInfo)
{
DEVINFO devInfo;
if (!pDevInfo) {
SKFerr(SKF_F_SKF_GETDEVINFO, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
bzero(&devInfo, sizeof(DEVINFO));
devInfo.Version.major = 1;
devInfo.Version.minor = 0;
strcpy((char *)&devInfo.Manufacturer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Issuer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Label, "SKF Softotken");
strcpy((char *)&devInfo.SerialNumber, "1");
devInfo.HWVersion.major = 1;
devInfo.HWVersion.minor = 0;
devInfo.FirmwareVersion.major = 1;
devInfo.FirmwareVersion.minor = 0;
devInfo.AlgSymCap = 0x0000041F;
devInfo.AlgAsymCap = 0x00030700;
devInfo.AlgHashCap = 0x00000007;
devInfo.DevAuthAlgId = SGD_SM4_CBC;
devInfo.TotalSpace = 0;
devInfo.FreeSpace = 0;
devInfo.MaxECCBufferSize = 0; /* FIXME: max inlen of ECC encrypt */
devInfo.MaxBufferSize = 0; /* FIXME: max inlen of SM4 encrypt */
memcpy(pDevInfo, &devInfo, sizeof(DEVINFO));
return SAR_OK;
}

235
crypto/skf/skf_dgst.c Normal file
View File

@@ -0,0 +1,235 @@
/* crypto/skf/skf_dgst.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/evp.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
ULONG DEVAPI SKF_DigestInit(DEVHANDLE hDev,
ULONG ulAlgID,
ECCPUBLICKEYBLOB *pPubKey,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phHash)
{
ULONG ret = SAR_FAIL;
const EVP_MD *md;
EVP_MD_CTX *mdctx = NULL;
EC_KEY *ec_key = NULL;
SKF_HANDLE *handle;
unsigned char dgst[EVP_MAX_MD_SIZE];
unsigned int dgstlen = 0;
switch (ulAlgID) {
case SGD_SM3:
md = EVP_sm3();
break;
case SGD_SHA1:
md = EVP_sha1();
break;
case SGD_SHA256:
md = EVP_sha256();
break;
default:
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_INVALID_ALGID);
return SAR_INVALIDPARAMERR;
}
if (!(mdctx = EVP_MD_CTX_create())) {
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_MALLOC_FAILED);
return SAR_FAIL;
}
if (!EVP_DigestInit_ex(mdctx, md, NULL)) {
SKFerr(SKF_F_SKF_DIGESTINIT, ERR_R_EVP_LIB);
goto end;
}
if (pPubKey) {
if (!(ec_key = EC_KEY_new_from_ECCPUBLICKEYBLOB(pPubKey))) {
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_INVALID_BLOB);
ret = SAR_INVALIDPARAMERR;
goto end;
}
if (pbID) {
if (ulIDLen <= 0 || ulIDLen > SM2_MAX_ID_LENGTH) {
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_INVALID_ID_LENGTH);
ret = SAR_INVALIDPARAMERR;
goto end;
}
OPENSSL_assert(strlen((char *)pbID) == ulIDLen);
if (!SM2_set_id(ec_key, (char *)pbID)) {
SKFerr(SKF_F_SKF_DIGESTINIT, ERR_R_SM2_LIB);
ret = SAR_FAIL;
goto end;
}
}
dgstlen = sizeof(dgst);
if (!SM2_compute_id_digest(md, dgst, &dgstlen, ec_key)) {
SKFerr(SKF_F_SKF_DIGESTINIT, ERR_R_SM2_LIB);
goto end;
}
if (!EVP_DigestUpdate(mdctx, dgst, dgstlen)) {
goto end;
}
} else {
if (pbID) {
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_NO_PUBLIC_KEY);
ret = SAR_INVALIDPARAMERR;
goto end;
}
}
if (!(handle = SKF_HANDLE_new(SKF_HASH_HANDLE))) {
SKFerr(SKF_F_SKF_DIGESTINIT, SKF_R_MALLOC_FAILED);
ret = SAR_MEMORYERR;
goto end;
}
handle->u.md_ctx = mdctx;
mdctx = NULL;
ret = SAR_OK;
end:
EVP_MD_CTX_destroy(mdctx);
EC_KEY_free(ec_key);
return ret;
}
ULONG DEVAPI SKF_DigestUpdate(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen)
{
EVP_MD_CTX *md_ctx;
if (!(md_ctx = SKF_HANDLE_get_md_ctx(hHash))) {
SKFerr(SKF_F_SKF_DIGESTUPDATE, SKF_R_INVALID_HASH_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (!pbData) {
SKFerr(SKF_F_SKF_DIGESTUPDATE, SKF_R_INVALID_ARGUMENTS);
return SAR_INVALIDPARAMERR;
}
if (ulDataLen == 0) {
return SAR_OK;
}
if (!EVP_DigestUpdate(md_ctx, pbData, ulDataLen)) {
SKFerr(SKF_F_SKF_DIGESTUPDATE, ERR_R_EVP_LIB);
return SAR_FAIL;
}
return SAR_OK;
}
ULONG DEVAPI SKF_DigestFinal(HANDLE hHash,
BYTE *pHashData,
ULONG *pulHashLen)
{
EVP_MD_CTX *mdctx;
if (!(mdctx = SKF_HANDLE_get_md_ctx(hHash))) {
SKFerr(SKF_F_SKF_DIGESTFINAL, SKF_R_INVALID_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (!pulHashLen) {
SKFerr(SKF_F_SKF_DIGESTFINAL, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (!EVP_DigestFinal_ex(mdctx, pHashData, pulHashLen)) {
SKFerr(SKF_F_SKF_DIGESTFINAL, ERR_R_EVP_LIB);
return SAR_FAIL;
}
if (!SKF_HANDLE_free(hHash)) {
SKFerr(SKF_F_SKF_DIGESTFINAL, SKF_R_FREE_HANDLE_FAILED);
return SAR_FAIL;
}
return SAR_OK;
}
ULONG DEVAPI SKF_Digest(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbHashData,
ULONG *pulHashLen)
{
ULONG rv;
if ((rv = SKF_DigestUpdate(hHash, pbData, ulDataLen)) != SAR_OK) {
SKFerr(SKF_F_SKF_DIGEST, ERR_R_SKF_LIB);
return rv;
}
if ((rv = SKF_DigestFinal(hHash, pbHashData, pulHashLen)) != SAR_OK) {
SKFerr(SKF_F_SKF_DIGEST, ERR_R_SKF_LIB);
return rv;
}
return SAR_OK;
}

View File

@@ -1,719 +0,0 @@
/* engines/skf/skf_dummy.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <string.h>
#include "skf.h"
#define DEV_NAME "skf-soft-token"
#define DEV_NAME_LIST DEV_NAME"\0"
#define APP_NAME "default-app"
#define APP_NAME_LIST APP_NAME"\0"
#define CONTAINER_NAME "container0"
#define CONTAINER_NAME_LIST CONTAINER_NAME"\0"
ULONG DEVAPI SKF_WaitForDevEvent(LPSTR szDevName,
ULONG *pulDevNameLen, ULONG *pulEvent)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CancelWaitForDevEvent()
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumDev(BOOL bPresent,
LPSTR szNameList,
ULONG *pulSize)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ConnectDev(LPSTR szName,
DEVHANDLE *phDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DisConnectDev(DEVHANDLE hDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevState(LPSTR szDevName,
ULONG *pulDevState)
{
if (!pulDevState) {
return SAR_INVALIDPARAMERR;
}
*pulDevState = DEV_PRESENT_STATE;
return SAR_OK;
}
ULONG DEVAPI SKF_SetLabel(DEVHANDLE hDev,
LPSTR szLabel)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevInfo(DEVHANDLE hDev,
DEVINFO *pDevInfo)
{
DEVINFO devInfo;
bzero(&devInfo, sizeof(DEVINFO));
devInfo.Version.major = 1;
devInfo.Version.minor = 0;
strcpy((char *)&devInfo.Manufacturer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Issuer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Label, "SKF Softotken");
strcpy((char *)&devInfo.SerialNumber, "000001");
devInfo.HWVersion.major = 1;
devInfo.HWVersion.minor = 0;
devInfo.FirmwareVersion.major = 1;
devInfo.FirmwareVersion.minor = 0;
devInfo.AlgSymCap = 0x0000041F;
devInfo.AlgAsymCap = 0x00030700;
devInfo.AlgHashCap = 0x00000007;
devInfo.DevAuthAlgId = SGD_SM4_CBC;
devInfo.TotalSpace = 0;
devInfo.FreeSpace = 0;
devInfo.MaxECCBufferSize = 0; /* FIXME: max inlen of ECC encrypt */
devInfo.MaxBufferSize = 0; /* FIXME: max inlen of SM4 encrypt */
memcpy(pDevInfo, &devInfo, sizeof(DEVINFO));
return SAR_OK;
}
ULONG DEVAPI SKF_LockDev(DEVHANDLE hDev,
ULONG ulTimeOut)
{
return SAR_OK;
}
ULONG DEVAPI SKF_UnlockDev(DEVHANDLE hDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Transmit(DEVHANDLE hDev,
BYTE *pbCommand,
ULONG ulCommandLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ChangeDevAuthKey(DEVHANDLE hDev,
BYTE *pbKeyValue,
ULONG ulKeyLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DevAuth(DEVHANDLE hDev,
BYTE *pbAuthData,
ULONG ulLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ChangePIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szOldPin,
LPSTR szNewPin,
ULONG *pulRetryCount)
{
return SAR_OK;
}
LONG DEVAPI SKF_GetPINInfo(HAPPLICATION hApplication,
ULONG ulPINType,
ULONG *pulMaxRetryCount,
ULONG *pulRemainRetryCount,
BOOL *pbDefaultPin)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_VerifyPIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szPIN,
ULONG *pulRetryCount)
{
return SAR_OK;
}
ULONG DEVAPI SKF_UnblockPIN(HAPPLICATION hApplication,
LPSTR szAdminPIN,
LPSTR szNewUserPIN,
ULONG *pulRetryCount)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ClearSecureState(HAPPLICATION hApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CreateApplication(DEVHANDLE hDev,
LPSTR szAppName,
LPSTR szAdminPin,
DWORD dwAdminPinRetryCount,
LPSTR szUserPin,
DWORD dwUserPinRetryCount,
DWORD dwCreateFileRights,
HAPPLICATION *phApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EnumApplication(DEVHANDLE hDev,
LPSTR szAppName,
ULONG *pulSize)
{
if (!szAppName) {
*pulSize = sizeof(APP_NAME_LIST);
return SAR_OK;
}
if (*pulSize < sizeof(APP_NAME_LIST)) {
return SAR_BUFFER_TOO_SMALL;
}
memcpy(szAppName, APP_NAME_LIST, sizeof(APP_NAME_LIST));
return SAR_OK;
}
ULONG DEVAPI SKF_DeleteApplication(DEVHANDLE hDev,
LPSTR szAppName)
{
return SAR_OK;
}
ULONG DEVAPI SKF_OpenApplication(DEVHANDLE hDev,
LPSTR szAppName,
HAPPLICATION *phApplication)
{
if (!phApplication) {
return SAR_INVALIDPARAMERR;
}
return SAR_OK;
}
ULONG DEVAPI SKF_CloseApplication(HAPPLICATION hApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CreateFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulFileSize,
ULONG ulReadRights,
ULONG ulWriteRights)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DeleteFile(HAPPLICATION hApplication,
LPSTR szFileName)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumFiles(HAPPLICATION hApplication,
LPSTR szFileList,
ULONG *pulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GetFileInfo(HAPPLICATION hApplication,
LPSTR szFileName,
FILEATTRIBUTE *pFileInfo)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ReadFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
ULONG ulSize,
BYTE * pbOutData,
ULONG *pulOutLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_WriteFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
BYTE *pbData,
ULONG ulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CreateContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DeleteContainer(HAPPLICATION hApplication,
LPSTR szContainerName)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EnumContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
ULONG *pulSize)
{
if (!pulSize) {
return SAR_INVALIDPARAMERR;
}
if (!szContainerName) {
*pulSize = sizeof(CONTAINER_NAME_LIST);
return SAR_OK;
}
if (*pulSize < sizeof(CONTAINER_NAME_LIST)) {
return SAR_BUFFER_TOO_SMALL;
}
memcpy(szContainerName, CONTAINER_NAME_LIST, sizeof(CONTAINER_NAME_LIST));
return SAR_OK;
}
ULONG DEVAPI SKF_OpenContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CloseContainer(HCONTAINER hContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetContainerType(HCONTAINER hContainer,
ULONG *pulContainerType)
{
if (!pulContainerType) {
return SAR_INVALIDPARAMERR;
}
*pulContainerType = CONTAINER_TYPE_ECC;
return SAR_OK;
}
ULONG DEVAPI SKF_ImportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE *pbCert,
ULONG ulCertLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ExportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE* pbCert,
ULONG *pulCertLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenRandom(DEVHANDLE hDev,
BYTE *pbRandom,
ULONG ulRandomLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GenExtRSAKey(DEVHANDLE hDev,
ULONG ulBitsLen,
RSAPRIVATEKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenRSAKeyPair(HCONTAINER hContainer,
ULONG ulBitsLen,
RSAPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportRSAKeyPair(HCONTAINER hContainer,
ULONG ulSymAlgId,
BYTE *pbWrappedKey,
ULONG ulWrappedKeyLen,
BYTE *pbEncryptedData,
ULONG ulEncryptedDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSASignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG *pulSignLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSAVerify(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG ulSignLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSAExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
RSAPUBLICKEYBLOB *pPubKey,
BYTE *pbData,
ULONG *pulDataLen,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtRSAPubKeyOperation(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtRSAPriKeyOperation(DEVHANDLE hDev,
RSAPRIVATEKEYBLOB *pRSAPriKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenECCKeyPair(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportECCKeyPair(HCONTAINER hContainer,
PENVELOPEDKEYBLOB pEnvelopedKeyBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCSignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pPubKey,
PECCCIPHERBLOB pData,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCEncrypt(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbPlainText,
ULONG ulPlainTextLen,
PECCCIPHERBLOB pCipherText)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCDecrypt(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
PECCCIPHERBLOB pCipherText,
BYTE *pbPlainText,
ULONG *pulPlainTextLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCSign(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataWithECC(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phAgreementHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(HANDLE hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pSponsorECCPubKeyBlob,
ECCPUBLICKEYBLOB *pSponsorTempECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
BYTE *pbSponsorID,
ULONG ulSponsorIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateKeyWithECC(HANDLE hAgreementHandle,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExportPublicKey(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE* pbBlob,
ULONG* pulBlobLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
BYTE *pbWrapedData,
ULONG ulWrapedLen,
HANDLE *phKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_SetSymmKey(DEVHANDLE hDev,
BYTE *pbKey,
ULONG ulAlgID,
HANDLE *phKey)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptInit(HANDLE hKey,
BLOCKCIPHERPARAM EncryptParam)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Encrypt(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptUpdate(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptFinal(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG *pulEncryptedDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptInit(HANDLE hKey,
BLOCKCIPHERPARAM DecryptParam)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Decrypt(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptUpdate(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptFinal(HANDLE hKey,
BYTE *pbDecryptedData,
ULONG *pulDecryptedDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestInit(DEVHANDLE hDev,
ULONG ulAlgID,
ECCPUBLICKEYBLOB *pPubKey,
BYTE *pucID,
ULONG ulIDLen,
HANDLE *phHash)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Digest(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbHashData,
ULONG *pulHashLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestUpdate(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestFinal(HANDLE hHash,
BYTE *pHashData,
ULONG *pulHashLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_MacInit(HANDLE hKey,
BLOCKCIPHERPARAM *pMacParam,
HANDLE *phMac)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_Mac(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbMacData,
ULONG *pulMacLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_MacUpdate(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_MacFinal(HANDLE hMac,
BYTE *pbMacData,
ULONG *pulMacDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CloseHandle(HANDLE hHandle)
{
return SAR_NOTSUPPORTYETERR;
}

690
crypto/skf/skf_ec.c Normal file
View File

@@ -0,0 +1,690 @@
/* crypto/skf/skf_ec.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/ec.h>
#include <openssl/ecdsa.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
ULONG DEVAPI SKF_ExtECCSign(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
ECCSIGNATUREBLOB *pSignature)
{
ULONG ret = SAR_FAIL;
EC_KEY *ec_key = NULL;
ECDSA_SIG *sig = NULL;
if (!pECCPriKeyBlob || !pbData || !pSignature) {
SKFerr(SKF_F_SKF_EXTECCSIGN, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (ulDataLen != SM3_DIGEST_LENGTH) {
SKFerr(SKF_F_SKF_EXTECCSIGN, SKF_R_INVALID_DIGEST_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!(ec_key = EC_KEY_new_from_ECCPRIVATEKEYBLOB(pECCPriKeyBlob))) {
SKFerr(SKF_F_SKF_EXTECCSIGN, SKF_R_INVALID_ECC_PRIVATE_KEY);
goto end;
}
if (!(sig = SM2_do_sign(pbData, (int)ulDataLen, ec_key))) {
SKFerr(SKF_F_SKF_EXTECCSIGN, SKF_R_SIGN_FAILED);
goto end;
}
if (!ECDSA_SIG_get_ECCSIGNATUREBLOB(sig, pSignature)) {
SKFerr(SKF_F_SKF_EXTECCSIGN, SKF_R_ENCODE_SIGNATURE_FAILED);
goto end;
}
ret = SAR_OK;
end:
EC_KEY_free(ec_key);
ECDSA_SIG_free(sig);
return ret;
}
ULONG DEVAPI SKF_ExtECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
ECCSIGNATUREBLOB *pSignature)
{
ULONG ret = SAR_FAIL;
EC_KEY *ec_key = NULL;
ECDSA_SIG *sig = NULL;
if (!pECCPubKeyBlob || !pbData || pSignature) {
SKFerr(SKF_F_SKF_EXTECCVERIFY, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (ulDataLen != SM3_DIGEST_LENGTH) {
SKFerr(SKF_F_SKF_EXTECCVERIFY, SKF_R_INVALID_DIGEST_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!(ec_key = EC_KEY_new_from_ECCPUBLICKEYBLOB(pECCPubKeyBlob))) {
SKFerr(SKF_F_SKF_EXTECCVERIFY, SKF_R_INVALID_ECC_PUBLIC_KEY);
goto end;
}
if (!(sig = ECDSA_SIG_new_from_ECCSIGNATUREBLOB(pSignature))) {
SKFerr(SKF_F_SKF_EXTECCVERIFY, SKF_R_INVALID_SIGNATURE);
goto end;
}
if (1 != SM2_do_verify(pbData, (int)ulDataLen, sig, ec_key)) {
SKFerr(SKF_F_SKF_EXTECCVERIFY, SKF_R_VERIFY_NOT_PASS);
goto end;
}
ret = SAR_OK;
end:
EC_KEY_free(ec_key);
ECDSA_SIG_free(sig);
return ret;
}
ULONG DEVAPI SKF_ECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
ECCSIGNATUREBLOB *pSignature)
{
return SKF_ExtECCVerify(hDev, pECCPubKeyBlob, pbData, ulDataLen, pSignature);
}
ULONG DEVAPI SKF_ExtECCEncrypt(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbPlainText,
ULONG ulPlainTextLen,
ECCCIPHERBLOB *pCipherText)
{
ULONG ret = SAR_FAIL;
EC_KEY *ec_key = NULL;
SM2_CIPHERTEXT_VALUE *cv = NULL;
SM2_ENC_PARAMS params;
if (!pECCPubKeyBlob || !pbPlainText || !pCipherText) {
SKFerr(SKF_F_SKF_EXTECCENCRYPT, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (ulPlainTextLen <= 0) {
SKFerr(SKF_F_SKF_EXTECCENCRYPT, SKF_R_INVALID_PLAINTEXT_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!(ec_key = EC_KEY_new_from_ECCPUBLICKEYBLOB(pECCPubKeyBlob))) {
SKFerr(SKF_F_SKF_EXTECCENCRYPT, SKF_R_INVALID_EC_PUBLIC_KEY);
goto end;
}
SM2_ENC_PARAMS_init_with_recommended(&params);
if (!(cv = SM2_do_encrypt(&params, pbPlainText, ulPlainTextLen, ec_key))) {
SKFerr(SKF_F_SKF_EXTECCENCRYPT, SKF_R_ENCRYPT_FAILED);
goto end;
}
if (!SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(cv, pCipherText)) {
SKFerr(SKF_F_SKF_EXTECCENCRYPT, SKF_R_ENCODE_CIPHERTEXT_FAILED);
goto end;
}
ret = SAR_OK;
end:
EC_KEY_free(ec_key);
SM2_CIPHERTEXT_VALUE_free(cv);
return ret;
}
ULONG DEVAPI SKF_ExtECCDecrypt(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
ECCCIPHERBLOB *pCipherText,
BYTE *pbPlainText,
ULONG *pulPlainTextLen)
{
ULONG ret = SAR_FAIL;
EC_KEY *ec_key = NULL;
SM2_CIPHERTEXT_VALUE *cv = NULL;
SM2_ENC_PARAMS params;
size_t len;
if (!pECCPriKeyBlob || !pCipherText || !pulPlainTextLen) {
SKFerr(SKF_F_SKF_EXTECCDECRYPT, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (pCipherText->CipherLen <= 0) {
SKFerr(SKF_F_SKF_EXTECCDECRYPT, SKF_R_INVALID_CIPHERTEXT_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!pbPlainText) {
*pulPlainTextLen = pCipherText->CipherLen;
return SAR_OK;
}
if (!(ec_key = EC_KEY_new_from_ECCPRIVATEKEYBLOB(pECCPriKeyBlob))) {
SKFerr(SKF_F_SKF_EXTECCDECRYPT, SKF_R_INVALID_EC_PRIVATE_KEY);
goto end;
}
if (!(cv = SM2_CIPHERTEXT_VALUE_new_from_ECCCIPHERBLOB(pCipherText))) {
SKFerr(SKF_F_SKF_EXTECCDECRYPT, SKF_R_INVALID_CIPHERTEXT);
goto end;
}
SM2_ENC_PARAMS_init_with_recommended(&params);
len = *pulPlainTextLen; //FIXME: check length?
if (!SM2_do_decrypt(&params, cv, pbPlainText, &len, ec_key)) {
SKFerr(SKF_F_SKF_EXTECCDECRYPT, SKF_R_DECRYPT_FAILED);
goto end;
}
*pulPlainTextLen = (ULONG)len;
ret = SAR_OK;
end:
EC_KEY_free(ec_key);
SM2_CIPHERTEXT_VALUE_free(cv);
return ret;
}
/* Wrapper Functions */
EC_KEY *EC_KEY_new_from_ECCPUBLICKEYBLOB(const ECCPUBLICKEYBLOB *blob)
{
EC_KEY *ret;
if (!(ret = EC_KEY_new_by_curve_name(NID_sm2p256v1))) {
SKFerr(SKF_F_EC_KEY_NEW_FROM_ECCPUBLICKEYBLOB, ERR_R_EC_LIB);
return NULL;
}
if (!EC_KEY_set_ECCPUBLICKEYBLOB(ret, blob)) {
SKFerr(SKF_F_EC_KEY_NEW_FROM_ECCPUBLICKEYBLOB,
SKF_R_DECODE_EC_PUBLIC_KEY_FAILED);
EC_KEY_free(ret);
return NULL;
}
return ret;
}
EC_KEY *EC_KEY_new_from_ECCPRIVATEKEYBLOB(const ECCPRIVATEKEYBLOB *blob)
{
EC_KEY *ret;
if (!(ret = EC_KEY_new_by_curve_name(NID_sm2p256v1))) {
SKFerr(SKF_F_EC_KEY_NEW_FROM_ECCPRIVATEKEYBLOB, ERR_R_EC_LIB);
return NULL;
}
if (!EC_KEY_set_ECCPRIVATEKEYBLOB(ret, blob)) {
SKFerr(SKF_F_EC_KEY_NEW_FROM_ECCPRIVATEKEYBLOB,
SKF_R_DECODE_EC_PRIVATE_KEY_FAILED);
EC_KEY_free(ret);
return NULL;
}
return ret;
}
int EC_KEY_set_ECCPUBLICKEYBLOB(EC_KEY *ec_key, const ECCPUBLICKEYBLOB *blob)
{
int ret = 0;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
int nbytes;
if (blob->BitLen != EC_GROUP_get_degree(EC_KEY_get0_group(ec_key))) {
SKFerr(SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB, SKF_R_INVALID_KEY_LENGTH);
return 0;
}
nbytes = (blob->BitLen + 7)/8;
if (!(x = BN_bin2bn(blob->XCoordinate, nbytes, NULL))) {
SKFerr(SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB, ERR_R_BN_LIB);
goto end;
}
if (!(y = BN_bin2bn(blob->YCoordinate, nbytes, NULL))) {
SKFerr(SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB, ERR_R_BN_LIB);
goto end;
}
if (!EC_KEY_set_public_key_affine_coordinates(ec_key, x, y)) {
SKFerr(SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB, SKF_R_INVALID_PUBLIC_KEY);
goto end;
}
ret = 1;
end:
BN_free(x);
BN_free(y);
return ret;
}
int EC_KEY_get_ECCPUBLICKEYBLOB(EC_KEY *ec_key, ECCPUBLICKEYBLOB *blob)
{
int ret = 0;
int nbytes;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
BN_CTX *bn_ctx = NULL;
const EC_GROUP *group = EC_KEY_get0_group(ec_key);
const EC_POINT *point = EC_KEY_get0_public_key(ec_key);
nbytes = (EC_GROUP_get_degree(group) + 7)/8;
if (nbytes > ECC_MAX_MODULUS_BITS_LEN/8) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, SKF_R_INVALID_KEY_LENGTH);
goto end;
}
x = BN_new();
y = BN_new();
bn_ctx = BN_CTX_new();
if (!x || !y || !bn_ctx) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, ERR_R_BN_LIB);
goto end;
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, bn_ctx)) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, ERR_R_EC_LIB);
goto end;
}
} else {
if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x, y, bn_ctx)) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, ERR_R_EC_LIB);
goto end;
}
}
bzero(blob, sizeof(*blob));
blob->BitLen = EC_GROUP_get_degree(group);
if (!BN_bn2bin(x, blob->XCoordinate + nbytes - BN_num_bytes(x))) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, ERR_R_BN_LIB);
goto end;
}
if (!BN_bn2bin(y, blob->YCoordinate + nbytes - BN_num_bytes(y))) {
SKFerr(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB, ERR_R_BN_LIB);
goto end;
}
ret = 1;
end:
BN_free(x);
BN_free(y);
BN_CTX_free(bn_ctx);
return ret;
}
int EC_KEY_set_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, const ECCPRIVATEKEYBLOB *blob)
{
int ret = 0;
BIGNUM *d = NULL;
int nbytes;
//FIXME: is this right?
if (blob->BitLen != EC_GROUP_get_degree(EC_KEY_get0_group(ec_key))) {
SKFerr(SKF_F_EC_KEY_SET_ECCPRIVATEKEYBLOB, SKF_R_INVALID_KEY_LENGTH);
goto end;
}
nbytes = (blob->BitLen + 7)/8;
if (!(d = BN_bin2bn(blob->PrivateKey, nbytes, NULL))) {
SKFerr(SKF_F_EC_KEY_SET_ECCPRIVATEKEYBLOB, ERR_R_BN_LIB);
goto end;
}
if (!EC_KEY_set_private_key(ec_key, d)) {
SKFerr(SKF_F_EC_KEY_SET_ECCPRIVATEKEYBLOB, SKF_R_INVALID_PRIVATE_KEY);
goto end;
}
ret = 1;
end:
BN_clear_free(d);
return ret;
}
int EC_KEY_get_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, ECCPRIVATEKEYBLOB *blob)
{
int ret = 0;
BIGNUM *order = NULL;
const BIGNUM *d;
int nbytes;
if (!(order = BN_new())) {
SKFerr(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB, SKF_R_MALLOC_FAILED);
goto end;
}
if (!EC_GROUP_get_order(EC_KEY_get0_group(ec_key), order, NULL)) {
SKFerr(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB, ERR_R_EC_LIB);
goto end;
}
nbytes = BN_num_bytes(order);
if (nbytes > ECC_MAX_MODULUS_BITS_LEN/8) {
SKFerr(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB, SKF_R_INVALID_KEY_LENGTH);
goto end;
}
if (!(d = EC_KEY_get0_private_key(ec_key))) {
SKFerr(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB, SKF_R_INVALID_EC_KEY);
goto end;
}
if (!BN_bn2bin(d, blob->PrivateKey + nbytes - BN_num_bytes(d))) {
SKFerr(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB, ERR_R_BN_LIB);
goto end;
}
ret = 1;
end:
BN_free(order);
return ret;
}
SM2_CIPHERTEXT_VALUE *SM2_CIPHERTEXT_VALUE_new_from_ECCCIPHERBLOB(
const ECCCIPHERBLOB *blob)
{
int ok = 0;
SM2_CIPHERTEXT_VALUE *ret = NULL;
EC_GROUP *group = NULL;
if (!(group = EC_GROUP_new_by_curve_name(NID_sm2p256v1))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB,
ERR_R_EC_LIB);
goto end;
}
if (!(ret = SM2_CIPHERTEXT_VALUE_new(group))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB,
SKF_R_MALLOC_FAILED);
goto end;
}
if (!SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB(ret, blob)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB,
SKF_R_INVALID_EC_PUBLIC_KEY);
goto end;
}
ok = 1;
end:
if (!ok) {
SM2_CIPHERTEXT_VALUE_free(ret);
ret = NULL;
}
EC_GROUP_free(group);
return ret;
}
int SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB(SM2_CIPHERTEXT_VALUE *cv,
const ECCCIPHERBLOB *blob)
{
int ret = 0;
EC_GROUP *group = NULL;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
BN_CTX *bn_ctx = NULL;
int nbytes;
if (!(group = EC_GROUP_new_by_curve_name(NID_sm2p256v1))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB,
ERR_R_EC_LIB);
return 0;
}
nbytes = (EC_GROUP_get_degree(group) + 7)/8;
if (nbytes > ECC_MAX_XCOORDINATE_BITS_LEN/8) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB,
SKF_R_INVALID_KEY_LENGTH);
goto end;
}
if (!(x = BN_bin2bn(blob->XCoordinate, nbytes, NULL))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (!(y = BN_bin2bn(blob->YCoordinate, nbytes, NULL))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (!(bn_ctx = BN_CTX_new())) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (!cv->ephem_point) {
if (!(cv->ephem_point = EC_POINT_new(group))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_EC_LIB);
goto end;
}
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) {
if (!EC_POINT_set_affine_coordinates_GFp(group, cv->ephem_point, x, y, bn_ctx)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_EC_LIB);
goto end;
}
} else {
if (!EC_POINT_get_affine_coordinates_GF2m(group, cv->ephem_point, x, y, bn_ctx)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB, ERR_R_EC_LIB);
goto end;
}
}
memcpy(cv->mactag, blob->HASH, 32);
cv->mactag_size = 32;
if ((cv->ciphertext_size = blob->CipherLen) <= 0) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB,
SKF_R_INVALID_CIPHERTEXT_LENGTH);
goto end;
}
if (!(cv->ciphertext = OPENSSL_realloc(cv->ciphertext, blob->CipherLen))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB,
SKF_R_MALLOC_FAILED);
goto end;
}
memcpy(cv->ciphertext, blob->Cipher, blob->CipherLen);
ret = 0;
end:
EC_GROUP_free(group);
BN_free(x);
BN_free(y);
BN_CTX_free(bn_ctx);
return ret;
}
int SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(const SM2_CIPHERTEXT_VALUE *cv,
ECCCIPHERBLOB *blob)
{
int ret = 0;
EC_GROUP *group = NULL;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
BN_CTX *bn_ctx = NULL;
if (!(group = EC_GROUP_new_by_curve_name(NID_sm2p256v1))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_EC_LIB);
return 0;
}
x = BN_new();
y = BN_new();
bn_ctx = BN_CTX_new();
if (!x || !y || !bn_ctx) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(group, cv->ephem_point, x, y, bn_ctx)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_EC_LIB);
goto end;
}
} else {
if (!EC_POINT_get_affine_coordinates_GF2m(group, cv->ephem_point, x, y, bn_ctx)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_EC_LIB);
goto end;
}
}
if ((BN_num_bytes(x) > 256/8) || (BN_num_bytes(y) > 256/8)) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB,
SKF_R_INVALID_CIPHERTEXT_POINT);
goto end;
}
if (!BN_bn2bin(x, blob->XCoordinate + 256/8 - BN_num_bytes(x))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (!BN_bn2bin(y, blob->YCoordinate + 256/8 - BN_num_bytes(y))) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB, ERR_R_BN_LIB);
goto end;
}
if (cv->mactag_size != 32) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB,
SKF_R_INVALID_CIPHERTEXT_MAC);
goto end;
}
memcpy(blob->HASH, cv->mactag, cv->mactag_size);
if (cv->ciphertext_size <= 0) {
SKFerr(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB,
SKF_R_INVALID_CIPHERTEXT_LENGTH);
goto end;
}
memcpy(blob->Cipher, cv->ciphertext, cv->ciphertext_size);
ret = 1;
end:
EC_GROUP_free(group);
BN_free(x);
BN_free(y);
BN_CTX_free(bn_ctx);
return ret;
}
ECDSA_SIG *ECDSA_SIG_new_from_ECCSIGNATUREBLOB(const ECCSIGNATUREBLOB *blob)
{
ECDSA_SIG *ret = NULL;
if (!(ret = ECDSA_SIG_new())) {
SKFerr(SKF_F_ECDSA_SIG_NEW_FROM_ECCSIGNATUREBLOB,
SKF_R_MALLOC_FAILED);
return NULL;
}
if (!ECDSA_SIG_set_ECCSIGNATUREBLOB(ret, blob)) {
SKFerr(SKF_F_ECDSA_SIG_NEW_FROM_ECCSIGNATUREBLOB,
SKF_R_INVALID_SIGNATURE);
ECDSA_SIG_free(ret);
return NULL;
}
return ret;
}
int ECDSA_SIG_get_ECCSIGNATUREBLOB(const ECDSA_SIG *sig, ECCSIGNATUREBLOB *blob)
{
if ((BN_num_bytes(sig->r) > 256/8) || (BN_num_bytes(sig->s) > 256/8)) {
SKFerr(SKF_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB, SKF_R_INVALID_BIGNUM_LENGTH);
return SAR_FAIL;
}
if (!BN_bn2bin(sig->r, blob->r + 256/8 - BN_num_bytes(sig->r))) {
SKFerr(SKF_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB, ERR_R_BN_LIB);
return SAR_FAIL;
}
if (!BN_bn2bin(sig->s, blob->s + 256/8 - BN_num_bytes(sig->s))) {
SKFerr(SKF_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB, ERR_R_BN_LIB);
return SAR_FAIL;
}
return SAR_OK;
}
int ECDSA_SIG_set_ECCSIGNATUREBLOB(ECDSA_SIG *sig, const ECCSIGNATUREBLOB *blob)
{
if (!(sig->r = BN_bin2bn(blob->r, 256/8, sig->r))) {
SKFerr(SKF_F_ECDSA_SIG_SET_ECCSIGNATUREBLOB, ERR_R_BN_LIB);
return SAR_FAIL;
}
if (!(sig->s = BN_bin2bn(blob->s, 256/8, sig->s))) {
SKFerr(SKF_F_ECDSA_SIG_SET_ECCSIGNATUREBLOB, ERR_R_BN_LIB);
return SAR_FAIL;
}
return SAR_OK;
}

310
crypto/skf/skf_enc.c Normal file
View File

@@ -0,0 +1,310 @@
/* crypto/skf/skf_enc.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/evp.h>
#include <openssl/sms4.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
#define PADDING_TYPE_NO_PADDING 0
#define PADDING_TYPE_PKCS5 1
ULONG DEVAPI SKF_EncryptInit(HANDLE hKey,
BLOCKCIPHERPARAM encryptParam)
{
ULONG ret = SAR_FAIL;
BLOCKCIPHERPARAM *encparam = &encryptParam;
EVP_CIPHER_CTX *ctx = NULL;
const EVP_CIPHER *cipher;
unsigned char *key;
unsigned char *iv;
//FIXME: CFB bits!
if (!(key = SKF_HANDLE_get_key(hKey))) {
SKFerr(SKF_F_SKF_ENCRYPTINIT, SKF_R_INVALID_KEY_HANDLE);
ret = SAR_INVALIDPARAMERR;
goto end;
}
if (encparam->IVLen != SMS4_IV_LENGTH) {
SKFerr(SKF_F_SKF_ENCRYPTINIT, SKF_R_INVALID_IV_LENGTH);
ret = SAR_INVALIDPARAMERR;
goto end;
}
iv = encparam->IV;
if (!(ctx = EVP_CIPHER_CTX_new())) {
SKFerr(SKF_F_SKF_ENCRYPTINIT, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_EncryptInit_ex(ctx, cipher, NULL, key, iv)) {
SKFerr(SKF_F_SKF_ENCRYPTINIT, ERR_R_EVP_LIB);
goto end;
}
if (!SKF_HANDLE_set1_cipher_ctx(hKey, ctx)) {
SKFerr(SKF_F_SKF_ENCRYPTINIT, SKF_R_SET_CIPHER_CTX_FAILED);
goto end;
}
ctx = NULL;
ret = SAR_OK;
end:
EVP_CIPHER_CTX_free(ctx);
return ret;
}
ULONG DEVAPI SKF_EncryptUpdate(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
EVP_CIPHER_CTX *ctx;
int inlen, outlen;
if (!(ctx = SKF_HANDLE_get_cipher_ctx(hKey))) {
SKFerr(SKF_F_SKF_ENCRYPTUPDATE, SKF_R_INVALID_CIPHER_CTX_HANDLE);
return SAR_INVALIDPARAMERR;
}
//FIXME: check INT_MAX
inlen = ulDataLen;
outlen = *pulEncryptedLen;
if (!EVP_EncryptUpdate(ctx, pbEncryptedData, &outlen, pbData, inlen)) {
SKFerr(SKF_F_SKF_ENCRYPTUPDATE, ERR_R_EVP_LIB);
return SAR_FAIL;
}
*pulEncryptedLen = outlen;
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptFinal(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG *pulEncryptedDataLen)
{
EVP_CIPHER_CTX *ctx;
int outlen;
if (!(ctx = SKF_HANDLE_get_cipher_ctx(hKey))) {
SKFerr(SKF_F_SKF_ENCRYPTFINAL, SKF_R_INVALID_CIPHER_CTX_HANDLE);
return SAR_INVALIDPARAMERR;
}
outlen = *pulEncryptedDataLen;
if (!EVP_EncryptFinal(ctx, pbEncryptedData, &outlen)) {
SKFerr(SKF_F_SKF_ENCRYPTFINAL, ERR_R_EVP_LIB);
return SAR_FAIL;
}
*pulEncryptedDataLen = outlen;
SKF_HANDLE_free_cipher_ctx(hKey);
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptInit(HANDLE hKey,
BLOCKCIPHERPARAM DecryptParam)
{
ULONG ret = SAR_FAIL;
BLOCKCIPHERPARAM *param = &DecryptParam;
EVP_CIPHER_CTX *ctx = NULL;
const EVP_CIPHER *cipher;
unsigned char *key;
unsigned char *iv;
if (!(key = SKF_HANDLE_get_key(hKey))) {
SKFerr(SKF_F_SKF_DECRYPTINIT, SKF_R_INVALID_KEY_HANDLE);
ret = SAR_INVALIDPARAMERR;
goto end;
}
if (param->IVLen != SMS4_IV_LENGTH) {
SKFerr(SKF_F_SKF_DECRYPTINIT, SKF_R_INVALID_IV_LENGTH);
ret = SAR_INVALIDPARAMERR;
goto end;
}
iv = param->IV;
if (!(ctx = EVP_CIPHER_CTX_new())) {
SKFerr(SKF_F_SKF_DECRYPTINIT, ERR_R_EVP_LIB);
goto end;
}
if (!EVP_DecryptInit_ex(ctx, cipher, NULL, key, iv)) {
SKFerr(SKF_F_SKF_DECRYPTINIT, ERR_R_EVP_LIB);
goto end;
}
if (!SKF_HANDLE_set1_cipher_ctx(hKey, ctx)) {
SKFerr(SKF_F_SKF_DECRYPTINIT, SKF_R_SET_CIPHER_CTX_FAILED);
goto end;
}
ctx = NULL;
ret = SAR_OK;
end:
EVP_CIPHER_CTX_free(ctx);
return ret;
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptUpdate(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
EVP_CIPHER_CTX *ctx;
int inlen, outlen;
if (!(ctx = SKF_HANDLE_get_cipher_ctx(hKey))) {
SKFerr(SKF_F_SKF_DECRYPTUPDATE, SKF_R_INVALID_CIPHER_CTX_HANDLE);
return SAR_INVALIDPARAMERR;
}
//FIXME: check INT_MAX
inlen = ulEncryptedLen;
outlen = *pulDataLen;
if (!EVP_DecryptUpdate(ctx, pbData, &outlen, pbEncryptedData, inlen)) {
SKFerr(SKF_F_SKF_DECRYPTUPDATE, ERR_R_EVP_LIB);
return SAR_FAIL;
}
*pulDataLen = outlen;
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptFinal(HANDLE hKey,
BYTE *pbDecryptedData,
ULONG *pulDecryptedDataLen)
{
EVP_CIPHER_CTX *ctx;
int len;
if (!(ctx = SKF_HANDLE_get_cipher_ctx(hKey))) {
SKFerr(SKF_F_SKF_DECRYPTFINAL, SKF_R_INVALID_KEY_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (!EVP_DecryptFinal(ctx, pbDecryptedData, &len)) {
return SAR_FAIL;
}
*pulDecryptedDataLen = len;
SKF_HANDLE_free_cipher_ctx(hKey);
return SAR_OK;
}
ULONG DEVAPI SKF_Encrypt(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
ULONG rv;
BYTE *p;
ULONG len;
p = pbEncryptedData;
len = *pulEncryptedLen;
if ((rv = SKF_EncryptUpdate(hKey, pbData, ulDataLen, p, &len)) != SAR_OK) {
SKFerr(SKF_F_SKF_ENCRYPT, ERR_R_SKF_LIB);
return rv;
}
p += len;
len = *pulEncryptedLen - len;
if ((rv = SKF_EncryptFinal(hKey, p, &len)) != SAR_OK) {
SKFerr(SKF_F_SKF_ENCRYPT, ERR_R_SKF_LIB);
return rv;
}
*pulEncryptedLen = p + len - pbEncryptedData;
return SAR_OK;
}
ULONG DEVAPI SKF_Decrypt(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
ULONG rv;
BYTE *p;
ULONG len;
p = pbData;
len = *pulDataLen;
if ((rv = SKF_DecryptUpdate(hKey, pbEncryptedData, ulEncryptedLen, p, &len)) != SAR_OK) {
SKFerr(SKF_F_SKF_DECRYPT, ERR_R_SKF_LIB);
return rv;
}
p += len;
len = *pulDataLen - len;
if ((rv = SKF_DecryptFinal(hKey, p, &len)) != SAR_OK) {
SKFerr(SKF_F_SKF_DECRYPT, ERR_R_SKF_LIB);
return rv;
}
*pulDataLen = p + len - pbData;
return SAR_OK;
}

238
crypto/skf/skf_err.c Normal file
View File

@@ -0,0 +1,238 @@
/* crypto/skf/skf_err.c */
/* ====================================================================
* Copyright (c) 1999-2016 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/skf_ex.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_SKF,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_SKF,0,reason)
static ERR_STRING_DATA SKF_str_functs[] = {
{ERR_FUNC(SKF_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB),
"ECDSA_SIG_get_ECCSIGNATUREBLOB"},
{ERR_FUNC(SKF_F_ECDSA_SIG_NEW_FROM_ECCSIGNATUREBLOB),
"ECDSA_SIG_new_from_ECCSIGNATUREBLOB"},
{ERR_FUNC(SKF_F_ECDSA_SIG_SET_ECCSIGNATUREBLOB),
"ECDSA_SIG_set_ECCSIGNATUREBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB),
"EC_KEY_get_ECCPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB),
"EC_KEY_get_ECCPUBLICKEYBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_NEW_FROM_ECCPRIVATEKEYBLOB),
"EC_KEY_new_from_ECCPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_NEW_FROM_ECCPUBLICKEYBLOB),
"EC_KEY_new_from_ECCPUBLICKEYBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_SET_ECCPRIVATEKEYBLOB),
"EC_KEY_set_ECCPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB),
"EC_KEY_set_ECCPUBLICKEYBLOB"},
{ERR_FUNC(SKF_F_RSA_GET_RSAPRIVATEKEYBLOB), "RSA_get_RSAPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_RSA_NEW_FROM_RSAPRIVATEKEYBLOB),
"RSA_new_from_RSAPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_RSA_NEW_FROM_RSAPUBLICKEYBLOB),
"RSA_new_from_RSAPUBLICKEYBLOB"},
{ERR_FUNC(SKF_F_RSA_SET_RSAPRIVATEKEYBLOB), "RSA_set_RSAPRIVATEKEYBLOB"},
{ERR_FUNC(SKF_F_RSA_SET_RSAPUBLICKEYBLOB), "RSA_set_RSAPUBLICKEYBLOB"},
{ERR_FUNC(SKF_F_SKF_CHANGEDEVAUTHKEY), "SKF_CHANGEDEVAUTHKEY"},
{ERR_FUNC(SKF_F_SKF_CHANGEPIN), "SKF_CHANGEPIN"},
{ERR_FUNC(SKF_F_SKF_CLEARSECURESTATE), "SKF_CLEARSECURESTATE"},
{ERR_FUNC(SKF_F_SKF_CLOSEHANDLE), "SKF_CLOSEHANDLE"},
{ERR_FUNC(SKF_F_SKF_CONNECTDEV), "SKF_CONNECTDEV"},
{ERR_FUNC(SKF_F_SKF_CREATEAPPLICATION), "SKF_CREATEAPPLICATION"},
{ERR_FUNC(SKF_F_SKF_CREATEFILE), "SKF_CREATEFILE"},
{ERR_FUNC(SKF_F_SKF_DECRYPT), "SKF_DECRYPT"},
{ERR_FUNC(SKF_F_SKF_DECRYPTFINAL), "SKF_DECRYPTFINAL"},
{ERR_FUNC(SKF_F_SKF_DECRYPTINIT), "SKF_DECRYPTINIT"},
{ERR_FUNC(SKF_F_SKF_DECRYPTUPDATE), "SKF_DECRYPTUPDATE"},
{ERR_FUNC(SKF_F_SKF_DELETEAPPLICATION), "SKF_DELETEAPPLICATION"},
{ERR_FUNC(SKF_F_SKF_DELETEFILE), "SKF_DELETEFILE"},
{ERR_FUNC(SKF_F_SKF_DEVAUTH), "SKF_DEVAUTH"},
{ERR_FUNC(SKF_F_SKF_DIGEST), "SKF_DIGEST"},
{ERR_FUNC(SKF_F_SKF_DIGESTFINAL), "SKF_DIGESTFINAL"},
{ERR_FUNC(SKF_F_SKF_DIGESTINIT), "SKF_DIGESTINIT"},
{ERR_FUNC(SKF_F_SKF_DIGESTUPDATE), "SKF_DIGESTUPDATE"},
{ERR_FUNC(SKF_F_SKF_DISCONNECTDEV), "SKF_DISCONNECTDEV"},
{ERR_FUNC(SKF_F_SKF_ENCRYPT), "SKF_ENCRYPT"},
{ERR_FUNC(SKF_F_SKF_ENCRYPTFINAL), "SKF_ENCRYPTFINAL"},
{ERR_FUNC(SKF_F_SKF_ENCRYPTINIT), "SKF_ENCRYPTINIT"},
{ERR_FUNC(SKF_F_SKF_ENCRYPTUPDATE), "SKF_ENCRYPTUPDATE"},
{ERR_FUNC(SKF_F_SKF_ENUMAPPLICATION), "SKF_ENUMAPPLICATION"},
{ERR_FUNC(SKF_F_SKF_ENUMDEV), "SKF_ENUMDEV"},
{ERR_FUNC(SKF_F_SKF_ENUMFILES), "SKF_ENUMFILES"},
{ERR_FUNC(SKF_F_SKF_EXTECCDECRYPT), "SKF_EXTECCDECRYPT"},
{ERR_FUNC(SKF_F_SKF_EXTECCENCRYPT), "SKF_EXTECCENCRYPT"},
{ERR_FUNC(SKF_F_SKF_EXTECCSIGN), "SKF_EXTECCSIGN"},
{ERR_FUNC(SKF_F_SKF_EXTECCVERIFY), "SKF_EXTECCVERIFY"},
{ERR_FUNC(SKF_F_SKF_EXTRSAPRIKEYOPERATION), "SKF_EXTRSAPRIKEYOPERATION"},
{ERR_FUNC(SKF_F_SKF_EXTRSAPUBKEYOPERATION), "SKF_EXTRSAPUBKEYOPERATION"},
{ERR_FUNC(SKF_F_SKF_GENEXTRSAKEY), "SKF_GENEXTRSAKEY"},
{ERR_FUNC(SKF_F_SKF_GENRANDOM), "SKF_GENRANDOM"},
{ERR_FUNC(SKF_F_SKF_GETDEVINFO), "SKF_GETDEVINFO"},
{ERR_FUNC(SKF_F_SKF_GETDEVSTATE), "SKF_GETDEVSTATE"},
{ERR_FUNC(SKF_F_SKF_GETFILEINFO), "SKF_GETFILEINFO"},
{ERR_FUNC(SKF_F_SKF_GETPININFO), "SKF_GETPININFO"},
{ERR_FUNC(SKF_F_SKF_HANDLE_GET_CBCMAC_CTX), "SKF_HANDLE_GET_CBCMAC_CTX"},
{ERR_FUNC(SKF_F_SKF_HANDLE_GET_CIPHER_CTX), "SKF_HANDLE_GET_CIPHER_CTX"},
{ERR_FUNC(SKF_F_SKF_HANDLE_GET_MD_CTX), "SKF_HANDLE_GET_MD_CTX"},
{ERR_FUNC(SKF_F_SKF_LOCKDEV), "SKF_LOCKDEV"},
{ERR_FUNC(SKF_F_SKF_MAC), "SKF_MAC"},
{ERR_FUNC(SKF_F_SKF_MACFINAL), "SKF_MACFINAL"},
{ERR_FUNC(SKF_F_SKF_MACINIT), "SKF_MACINIT"},
{ERR_FUNC(SKF_F_SKF_MACUPDATE), "SKF_MACUPDATE"},
{ERR_FUNC(SKF_F_SKF_READFILE), "SKF_READFILE"},
{ERR_FUNC(SKF_F_SKF_SETLABEL), "SKF_SETLABEL"},
{ERR_FUNC(SKF_F_SKF_SETSYMMKEY), "SKF_SETSYMMKEY"},
{ERR_FUNC(SKF_F_SKF_TRANSMIT), "SKF_TRANSMIT"},
{ERR_FUNC(SKF_F_SKF_UNBLOCKPIN), "SKF_UNBLOCKPIN"},
{ERR_FUNC(SKF_F_SKF_UNLOCKDEV), "SKF_UNLOCKDEV"},
{ERR_FUNC(SKF_F_SKF_VERIFYPIN), "SKF_VERIFYPIN"},
{ERR_FUNC(SKF_F_SKF_WRITEFILE), "SKF_WRITEFILE"},
{ERR_FUNC(SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB),
"SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB"},
{ERR_FUNC(SKF_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB),
"SM2_CIPHERTEXT_VALUE_new_from_ECCCIPHERBLOB"},
{ERR_FUNC(SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB),
"SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB"},
{0, NULL}
};
static ERR_STRING_DATA SKF_str_reasons[] = {
{ERR_REASON(SKF_R_ALGOR_NOT_SUPPORTED), "algor not supported"},
{ERR_REASON(SKF_R_BAD_ARGUMENT), "bad argument"},
{ERR_REASON(SKF_R_BUFFER_TOO_SMALL), "buffer too small"},
{ERR_REASON(SKF_R_CMAC_LIB), "cmac lib"},
{ERR_REASON(SKF_R_CTX_NOT_CREATED), "ctx not created"},
{ERR_REASON(SKF_R_DECODE_EC_PRIVATE_KEY_FAILED),
"decode ec private key failed"},
{ERR_REASON(SKF_R_DECODE_EC_PUBLIC_KEY_FAILED),
"decode ec public key failed"},
{ERR_REASON(SKF_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(SKF_R_ENCODE_CIPHERTEXT_FAILED), "encode ciphertext failed"},
{ERR_REASON(SKF_R_ENCODE_FAILED), "encode failed"},
{ERR_REASON(SKF_R_ENCODE_SIGNATURE_FAILED), "encode signature failed"},
{ERR_REASON(SKF_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(SKF_R_FAIL), "fail"},
{ERR_REASON(SKF_R_FREE_HANDLE_FAILED), "free handle failed"},
{ERR_REASON(SKF_R_GEN_RSA_FAILED), "gen rsa failed"},
{ERR_REASON(SKF_R_INVALID_ALGID), "invalid algid"},
{ERR_REASON(SKF_R_INVALID_ALGOR), "invalid algor"},
{ERR_REASON(SKF_R_INVALID_APP_HANDLE), "invalid app handle"},
{ERR_REASON(SKF_R_INVALID_ARGUMENTS), "invalid arguments"},
{ERR_REASON(SKF_R_INVALID_BIGNUM_LENGTH), "invalid bignum length"},
{ERR_REASON(SKF_R_INVALID_BLOB), "invalid blob"},
{ERR_REASON(SKF_R_INVALID_CIPHERTEXT), "invalid ciphertext"},
{ERR_REASON(SKF_R_INVALID_CIPHERTEXT_LENGTH), "invalid ciphertext length"},
{ERR_REASON(SKF_R_INVALID_CIPHERTEXT_MAC), "invalid ciphertext mac"},
{ERR_REASON(SKF_R_INVALID_CIPHERTEXT_POINT), "invalid ciphertext point"},
{ERR_REASON(SKF_R_INVALID_CIPHER_CTX_HANDLE), "invalid cipher ctx handle"},
{ERR_REASON(SKF_R_INVALID_DEV_HANDLE), "invalid dev handle"},
{ERR_REASON(SKF_R_INVALID_DIGEST_LENGTH), "invalid digest length"},
{ERR_REASON(SKF_R_INVALID_ECC_PRIVATE_KEY), "invalid ecc private key"},
{ERR_REASON(SKF_R_INVALID_ECC_PUBLIC_KEY), "invalid ecc public key"},
{ERR_REASON(SKF_R_INVALID_EC_KEY), "invalid ec key"},
{ERR_REASON(SKF_R_INVALID_EC_PRIVATE_KEY), "invalid ec private key"},
{ERR_REASON(SKF_R_INVALID_EC_PUBLIC_KEY), "invalid ec public key"},
{ERR_REASON(SKF_R_INVALID_HANDLE), "invalid handle"},
{ERR_REASON(SKF_R_INVALID_HANDLE_MAGIC), "invalid handle magic"},
{ERR_REASON(SKF_R_INVALID_HANDLE_TYPE), "invalid handle type"},
{ERR_REASON(SKF_R_INVALID_HASH_HANDLE), "invalid hash handle"},
{ERR_REASON(SKF_R_INVALID_ID_LENGTH), "invalid id length"},
{ERR_REASON(SKF_R_INVALID_INPUT_LENGTH), "invalid input length"},
{ERR_REASON(SKF_R_INVALID_IV_LENGTH), "invalid iv length"},
{ERR_REASON(SKF_R_INVALID_KEY_HANDLE), "invalid key handle"},
{ERR_REASON(SKF_R_INVALID_KEY_LENGTH), "invalid key length"},
{ERR_REASON(SKF_R_INVALID_MAC_HANDLE), "invalid mac handle"},
{ERR_REASON(SKF_R_INVALID_PLAINTEXT_LENGTH), "invalid plaintext length"},
{ERR_REASON(SKF_R_INVALID_PRIVATE_KEY), "invalid private key"},
{ERR_REASON(SKF_R_INVALID_PUBLIC_KEY), "invalid public key"},
{ERR_REASON(SKF_R_INVALID_RANDOM_LENGTH), "invalid random length"},
{ERR_REASON(SKF_R_INVALID_RSA_PRIVATE_KEY), "invalid rsa private key"},
{ERR_REASON(SKF_R_INVALID_RSA_PUBLIC_KEY), "invalid rsa public key"},
{ERR_REASON(SKF_R_INVALID_SIGNATURE), "invalid signature"},
{ERR_REASON(SKF_R_MALLOC_FAILED), "malloc failed"},
{ERR_REASON(SKF_R_NO_PUBLIC_KEY), "no public key"},
{ERR_REASON(SKF_R_NULL_ARGUMENT), "null argument"},
{ERR_REASON(SKF_R_SAR_FAIL), "sar fail"},
{ERR_REASON(SKF_R_SAR_OK), "sar ok"},
{ERR_REASON(SKF_R_SET_CIPHER_CTX_FAILED), "set cipher ctx failed"},
{ERR_REASON(SKF_R_SIGN_FAILED), "sign failed"},
{ERR_REASON(SKF_R_UNKNOWN_ALGOR), "unknown algor"},
{ERR_REASON(SKF_R_UNKNOWN_APP), "unknown app"},
{ERR_REASON(SKF_R_VERIFY_NOT_PASS), "verify not pass"},
{0, NULL}
};
#endif
void ERR_load_SKF_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SKF_str_functs[0].error) == NULL) {
ERR_load_strings(0, SKF_str_functs);
ERR_load_strings(0, SKF_str_reasons);
}
#endif
}

View File

@@ -1,133 +0,0 @@
#include "skf/skf.h"
/*
* about the filename err2: this is manually written err file
*/
int skf_err2openssl(int err)
{
switch (err) {
case SAR_OK: return SKF_R_SAR_OK;
case SAR_FAIL: return SKF_R_SAR_FAIL;
case SAR_UNKNOWNERR: return SKF_R_
case SAR_NOTSUPPORTYETERR: return SKF_R_
case SAR_FILEERR: return SKF_R_
case SAR_INVALIDHANDLEERR: return SKF_R_
case SAR_INVALIDPARAMERR: return SKF_R_
case SAR_READFILEERR: return SKF_R_
case SAR_WRITEFILEERR: return SKF_R_
case SAR_NAMELENERR: return SKF_R_
case SAR_KEYUSAGEERR: return SKF_R_
case SAR_MODULUSLENERR: return SKF_R_
case SAR_NOTINITIALIZEERR: return SKF_R_
case SAR_OBJERR: return SKF_R_
case SAR_MEMORYERR: return SKF_R_
case SAR_TIMEOUTERR: return SKF_R_
case SAR_INDATALENERR: return SKF_R_
case SAR_INDATAERR: return SKF_R_
case SAR_GENRANDERR: return SKF_R_
case SAR_HASHOBJERR: return SKF_R_
case SAR_HASHERR: return SKF_R_
case SAR_GENRSAKEYERR: return SKF_R_
case SAR_RSAMODULUSLENERR: return SKF_R_
case SAR_CSPIMPRTPUBKEYERR: return SKF_R_
case SAR_RSAENCERR: return SKF_R_
case SAR_RSADECERR: return SKF_R_
case SAR_HASHNOTEQUALERR: return SKF_R_
case SAR_KEYNOTFOUNTERR: return SKF_R_
case SAR_CERTNOTFOUNTERR: return SKF_R_
case SAR_NOTEXPORTERR: return SKF_R_
case SAR_DECRYPTPADERR: return SKF_R_
case SAR_MACLENERR: return SKF_R_
case SAR_BUFFER_TOO_SMALL: return SKF_R_
case SAR_KEYINFOTYPEERR: return SKF_R_
case SAR_NOT_EVENTERR: return SKF_R_
case SAR_DEVICE_REMOVED: return SKF_R_
case SAR_PIN_INCORRECT: return SKF_R_
case SAR_PIN_LOCKED: return SKF_R_
case SAR_PIN_INVALID: return SKF_R_
case SAR_PIN_LEN_RANGE: return SKF_R_
case SAR_USER_ALREADY_LOGGED_IN: return SKF_R_
case SAR_USER_PIN_NOT_INITIALIZED: return SKF_R_
case SAR_USER_TYPE_INVALID: return SKF_R_
case SAR_APPLICATION_NAME_INVALID: return SKF_R_
case SAR_APPLICATION_EXISTS: return SKF_R_
case SAR_USER_NOT_LOGGED_IN: return SKF_R_
case SAR_APPLICATION_NOT_EXISTS: return SKF_R_
case SAR_FILE_ALREADY_EXIST: return SKF_R_
case SAR_NO_ROOM: return SKF_R_
case SAR_FILE_NOT_EXIST: return SKF_R_
}
return 0;
}
typedef struct {
int err_no;
char *err_str;
} skf_errstr[] = {
{ SAR_OK, "Success" },
{ SAR_FAIL, "Failure" },
{ SAR_UNKNOWNERR, "Unknown error" },
{ SAR_NOTSUPPORTYETERR, "Not supported" },
{ SAR_FILEERR, "File error" },
{ SAR_INVALIDHANDLEERR, "Invalid handler" },
{ SAR_INVALIDPARAMERR, "Invalid parameter" },
{ SAR_READFILEERR, "Read file error" },
{ SAR_WRITEFILEERR "Write file error" },
{ SAR_NAMELENERR, "Name length error" },
{ SAR_KEYUSAGEERR, "Key usage error" },
{ SAR_MODULUSLENERR, "Modulus length error" },
{ SAR_NOTINITIALIZEERR, "Not initialized" },
{ SAR_OBJERR, "Object error" },
{ SAR_MEMORYERR, "Memory error" },
{ SAR_TIMEOUTERR, "Time out" },
{ SAR_INDATALENERR, "Input data length error" },
{ SAR_INDATAERR, "Input data error" },
{ SAR_GENRANDERR, "Generate randomness error" },
{ SAR_HASHOBJERR, "Hash object error" },
{ SAR_HASHERR, "Hash error" },
{ SAR_GENRSAKEYERR, "Genenerate RSA key error" },
{ SAR_RSAMODULUSLENERR, "RSA modulus length error" },
{ SAR_CSPIMPRTPUBKEYERR, "CSP import public key error" },
{ SAR_RSAENCERR, "RSA encryption error" },
{ SAR_RSADECERR, "RSA decryption error" },
{ SAR_HASHNOTEQUALERR, "Hash not equal" },
{ SAR_KEYNOTFOUNTERR, "Key not found" },
{ SAR_CERTNOTFOUNTERR, "Certificate not found" },
{ SAR_NOTEXPORTERR, "Not exported" },
{ SAR_DECRYPTPADERR, "Decrypt pad error" },
{ SAR_MACLENERR, "MAC length error" },
{ SAR_BUFFER_TOO_SMALL, "Buffer too small" },
{ SAR_KEYINFOTYPEERR, "Key info type error" },
{ SAR_NOT_EVENTERR, "No event error" },
{ SAR_DEVICE_REMOVED "Device removed" },
{ SAR_PIN_INCORRECT, "PIN incorrect" },
{ SAR_PIN_LOCKED, "PIN locked" },
{ SAR_PIN_INVALID, "PIN invalid" },
{ SAR_PIN_LEN_RANGE, "PIN length error" },
{ SAR_USER_ALREADY_LOGGED_IN, "User already logged in" },
{ SAR_USER_PIN_NOT_INITIALIZED, "User PIN not initialized" },
{ SAR_USER_TYPE_INVALID, "User type invalid" },
{ SAR_APPLICATION_NAME_INVALID, "Application name invalid" },
{ SAR_APPLICATION_EXISTS, "Application already exist" },
{ SAR_USER_NOT_LOGGED_IN, "User not logged in" },
{ SAR_APPLICATION_NOT_EXISTS, "Application not exist" },
{ SAR_FILE_ALREADY_EXIST, "File already exist" },
{ SAR_NO_ROOM, "No file space" },
{ SAR_FILE_NOT_EXIST, "File not exist" }
};
LPSTR DEVAPI SKF_GetErrorString(ULONG ulError)
{
return NULL;
}

123
crypto/skf/skf_errstr.c Normal file
View File

@@ -0,0 +1,123 @@
/* crypto/skf/skf_errstr.c */
/* ====================================================================
* Copyright (c) 2014 - 2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <openssl/skf.h>
typedef struct {
int err_no;
char *err_str;
} skf_errinfo;
skf_errinfo skf_errstr[] = {
{ SAR_OK, "Success" },
{ SAR_FAIL, "Failure" },
{ SAR_UNKNOWNERR, "Unknown error" },
{ SAR_NOTSUPPORTYETERR, "Not supported" },
{ SAR_FILEERR, "File error" },
{ SAR_INVALIDHANDLEERR, "Invalid handle" },
{ SAR_INVALIDPARAMERR, "Invalid parameter" },
{ SAR_READFILEERR, "Read file error" },
{ SAR_WRITEFILEERR, "Write file error" },
{ SAR_NAMELENERR, "Name length error" },
{ SAR_KEYUSAGEERR, "Key usage error" },
{ SAR_MODULUSLENERR, "Modulus length error" },
{ SAR_NOTINITIALIZEERR, "Not initialized" },
{ SAR_OBJERR, "Object error" },
{ SAR_MEMORYERR, "Memory error" },
{ SAR_TIMEOUTERR, "Time out" },
{ SAR_INDATALENERR, "Input data length error" },
{ SAR_INDATAERR, "Input data error" },
{ SAR_GENRANDERR, "Generate randomness error" },
{ SAR_HASHOBJERR, "Hash object error" },
{ SAR_HASHERR, "Hash error" },
{ SAR_GENRSAKEYERR, "Genenerate RSA key error" },
{ SAR_RSAMODULUSLENERR, "RSA modulus length error" },
{ SAR_CSPIMPRTPUBKEYERR, "CSP import public key error" },
{ SAR_RSAENCERR, "RSA encryption error" },
{ SAR_RSADECERR, "RSA decryption error" },
{ SAR_HASHNOTEQUALERR, "Hash not equal" },
{ SAR_KEYNOTFOUNTERR, "Key not found" },
{ SAR_CERTNOTFOUNTERR, "Certificate not found" },
{ SAR_NOTEXPORTERR, "Not exported" },
{ SAR_DECRYPTPADERR, "Decrypt pad error" },
{ SAR_MACLENERR, "MAC length error" },
{ SAR_BUFFER_TOO_SMALL, "Buffer too small" },
{ SAR_KEYINFOTYPEERR, "Key info type error" },
{ SAR_NOT_EVENTERR, "No event error" },
{ SAR_DEVICE_REMOVED, "Device removed" },
{ SAR_PIN_INCORRECT, "PIN incorrect" },
{ SAR_PIN_LOCKED, "PIN locked" },
{ SAR_PIN_INVALID, "PIN invalid" },
{ SAR_PIN_LEN_RANGE, "PIN length error" },
{ SAR_USER_ALREADY_LOGGED_IN, "User already logged in" },
{ SAR_USER_PIN_NOT_INITIALIZED, "User PIN not initialized" },
{ SAR_USER_TYPE_INVALID, "User type invalid" },
{ SAR_APPLICATION_NAME_INVALID, "Application name invalid" },
{ SAR_APPLICATION_EXISTS, "Application already exist" },
{ SAR_USER_NOT_LOGGED_IN, "User not logged in" },
{ SAR_APPLICATION_NOT_EXISTS, "Application not exist" },
{ SAR_FILE_ALREADY_EXIST, "File already exist" },
{ SAR_NO_ROOM, "No file space" },
{ SAR_FILE_NOT_EXIST, "File not exist" }
};
LPSTR DEVAPI SKF_GetErrorString(ULONG ulError)
{
int i;
for (i = 0; i < sizeof(skf_errstr)/sizeof(skf_errstr[0]); i++) {
if (ulError == skf_errstr[i].err_no) {
return (LPSTR)skf_errstr[i].err_str;
}
}
return (LPSTR)"(undef)";
}

237
crypto/skf/skf_ex.h Normal file
View File

@@ -0,0 +1,237 @@
/* crypto/skf/skf_ex.h */
/* ====================================================================
* Copyright (c) 2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#ifndef HEADER_SKF_EX_H
#define HEADER_SKF_EX_H
#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/sm2.h>
#include <openssl/cmac.h>
#include <openssl/cbcmac.h>
#include <openssl/ecdsa.h>
#include <openssl/skf.h>
#ifdef __cplusplus
extern "C" {
#endif
RSA *RSA_new_from_RSAPUBLICKEYBLOB(const RSAPUBLICKEYBLOB *blob);
RSA *RSA_new_from_RSAPRIVATEKEYBLOB(const RSAPRIVATEKEYBLOB *blob);
int RSA_set_RSAPUBLICKEYBLOB(RSA *rsa, const RSAPUBLICKEYBLOB *blob);
int RSA_get_RSAPUBLICKEYBLOB(RSA *rsa, RSAPUBLICKEYBLOB *blob);
int RSA_set_RSAPRIVATEKEYBLOB(RSA *rsa, const RSAPRIVATEKEYBLOB *blob);
int RSA_get_RSAPRIVATEKEYBLOB(RSA *rsa, RSAPRIVATEKEYBLOB *blob);
EC_KEY *EC_KEY_new_from_ECCPUBLICKEYBLOB(const ECCPUBLICKEYBLOB *blob);
EC_KEY *EC_KEY_new_from_ECCPRIVATEKEYBLOB(const ECCPRIVATEKEYBLOB *blob);
int EC_KEY_set_ECCPUBLICKEYBLOB(EC_KEY *ec_key, const ECCPUBLICKEYBLOB *blob);
int EC_KEY_get_ECCPUBLICKEYBLOB(EC_KEY *ec_key, ECCPUBLICKEYBLOB *blob);
int EC_KEY_set_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, const ECCPRIVATEKEYBLOB *blob);
int EC_KEY_get_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, ECCPRIVATEKEYBLOB *blob);
SM2_CIPHERTEXT_VALUE *SM2_CIPHERTEXT_VALUE_new_from_ECCCIPHERBLOB(const ECCCIPHERBLOB *blob);
int SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB(SM2_CIPHERTEXT_VALUE *cv, const ECCCIPHERBLOB *blob);
int SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(const SM2_CIPHERTEXT_VALUE *cv, ECCCIPHERBLOB *blob);
ECDSA_SIG *ECDSA_SIG_new_from_ECCSIGNATUREBLOB(const ECCSIGNATUREBLOB *blob);
int ECDSA_SIG_get_ECCSIGNATUREBLOB(const ECDSA_SIG *sig, ECCSIGNATUREBLOB *blob);
int ECDSA_SIG_set_ECCSIGNATUREBLOB(ECDSA_SIG *sig, const ECCSIGNATUREBLOB *blob);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_SKF_strings(void);
/* Error codes for the SKF functions. */
/* Function codes. */
# define SKF_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB 143
# define SKF_F_ECDSA_SIG_NEW_FROM_ECCSIGNATUREBLOB 144
# define SKF_F_ECDSA_SIG_SET_ECCSIGNATUREBLOB 145
# define SKF_F_EC_KEY_GET_ECCPRIVATEKEYBLOB 155
# define SKF_F_EC_KEY_GET_ECCPUBLICKEYBLOB 156
# define SKF_F_EC_KEY_NEW_FROM_ECCPRIVATEKEYBLOB 146
# define SKF_F_EC_KEY_NEW_FROM_ECCPUBLICKEYBLOB 147
# define SKF_F_EC_KEY_SET_ECCPRIVATEKEYBLOB 157
# define SKF_F_EC_KEY_SET_ECCPUBLICKEYBLOB 158
# define SKF_F_RSA_GET_RSAPRIVATEKEYBLOB 169
# define SKF_F_RSA_NEW_FROM_RSAPRIVATEKEYBLOB 163
# define SKF_F_RSA_NEW_FROM_RSAPUBLICKEYBLOB 164
# define SKF_F_RSA_SET_RSAPRIVATEKEYBLOB 170
# define SKF_F_RSA_SET_RSAPUBLICKEYBLOB 165
# define SKF_F_SKF_CHANGEDEVAUTHKEY 100
# define SKF_F_SKF_CHANGEPIN 101
# define SKF_F_SKF_CLEARSECURESTATE 102
# define SKF_F_SKF_CLOSEHANDLE 136
# define SKF_F_SKF_CONNECTDEV 103
# define SKF_F_SKF_CREATEAPPLICATION 104
# define SKF_F_SKF_CREATEFILE 105
# define SKF_F_SKF_DECRYPT 159
# define SKF_F_SKF_DECRYPTFINAL 130
# define SKF_F_SKF_DECRYPTINIT 160
# define SKF_F_SKF_DECRYPTUPDATE 161
# define SKF_F_SKF_DELETEAPPLICATION 106
# define SKF_F_SKF_DELETEFILE 107
# define SKF_F_SKF_DEVAUTH 108
# define SKF_F_SKF_DIGEST 137
# define SKF_F_SKF_DIGESTFINAL 109
# define SKF_F_SKF_DIGESTINIT 138
# define SKF_F_SKF_DIGESTUPDATE 139
# define SKF_F_SKF_DISCONNECTDEV 110
# define SKF_F_SKF_ENCRYPT 162
# define SKF_F_SKF_ENCRYPTFINAL 131
# define SKF_F_SKF_ENCRYPTINIT 111
# define SKF_F_SKF_ENCRYPTUPDATE 112
# define SKF_F_SKF_ENUMAPPLICATION 113
# define SKF_F_SKF_ENUMDEV 114
# define SKF_F_SKF_ENUMFILES 115
# define SKF_F_SKF_EXTECCDECRYPT 148
# define SKF_F_SKF_EXTECCENCRYPT 149
# define SKF_F_SKF_EXTECCSIGN 150
# define SKF_F_SKF_EXTECCVERIFY 151
# define SKF_F_SKF_EXTRSAPRIKEYOPERATION 166
# define SKF_F_SKF_EXTRSAPUBKEYOPERATION 167
# define SKF_F_SKF_GENEXTRSAKEY 132
# define SKF_F_SKF_GENRANDOM 133
# define SKF_F_SKF_GETDEVINFO 116
# define SKF_F_SKF_GETDEVSTATE 117
# define SKF_F_SKF_GETFILEINFO 118
# define SKF_F_SKF_GETPININFO 119
# define SKF_F_SKF_HANDLE_GET_CBCMAC_CTX 140
# define SKF_F_SKF_HANDLE_GET_CIPHER_CTX 141
# define SKF_F_SKF_HANDLE_GET_MD_CTX 142
# define SKF_F_SKF_LOCKDEV 120
# define SKF_F_SKF_MAC 168
# define SKF_F_SKF_MACFINAL 134
# define SKF_F_SKF_MACINIT 121
# define SKF_F_SKF_MACUPDATE 135
# define SKF_F_SKF_READFILE 122
# define SKF_F_SKF_SETLABEL 123
# define SKF_F_SKF_SETSYMMKEY 124
# define SKF_F_SKF_TRANSMIT 125
# define SKF_F_SKF_UNBLOCKPIN 126
# define SKF_F_SKF_UNLOCKDEV 127
# define SKF_F_SKF_VERIFYPIN 128
# define SKF_F_SKF_WRITEFILE 129
# define SKF_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB 152
# define SKF_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB 153
# define SKF_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB 154
/* Reason codes. */
# define SKF_R_ALGOR_NOT_SUPPORTED 100
# define SKF_R_BAD_ARGUMENT 101
# define SKF_R_BUFFER_TOO_SMALL 102
# define SKF_R_CMAC_LIB 103
# define SKF_R_CTX_NOT_CREATED 121
# define SKF_R_DECODE_EC_PRIVATE_KEY_FAILED 131
# define SKF_R_DECODE_EC_PUBLIC_KEY_FAILED 132
# define SKF_R_DECRYPT_FAILED 133
# define SKF_R_ENCODE_CIPHERTEXT_FAILED 134
# define SKF_R_ENCODE_FAILED 114
# define SKF_R_ENCODE_SIGNATURE_FAILED 135
# define SKF_R_ENCRYPT_FAILED 136
# define SKF_R_FAIL 104
# define SKF_R_FREE_HANDLE_FAILED 128
# define SKF_R_GEN_RSA_FAILED 115
# define SKF_R_INVALID_ALGID 122
# define SKF_R_INVALID_ALGOR 156
# define SKF_R_INVALID_APP_HANDLE 105
# define SKF_R_INVALID_ARGUMENTS 123
# define SKF_R_INVALID_BIGNUM_LENGTH 137
# define SKF_R_INVALID_BLOB 124
# define SKF_R_INVALID_CIPHERTEXT 138
# define SKF_R_INVALID_CIPHERTEXT_LENGTH 139
# define SKF_R_INVALID_CIPHERTEXT_MAC 140
# define SKF_R_INVALID_CIPHERTEXT_POINT 141
# define SKF_R_INVALID_CIPHER_CTX_HANDLE 154
# define SKF_R_INVALID_DEV_HANDLE 106
# define SKF_R_INVALID_DIGEST_LENGTH 142
# define SKF_R_INVALID_ECC_PRIVATE_KEY 143
# define SKF_R_INVALID_ECC_PUBLIC_KEY 144
# define SKF_R_INVALID_EC_KEY 151
# define SKF_R_INVALID_EC_PRIVATE_KEY 145
# define SKF_R_INVALID_EC_PUBLIC_KEY 146
# define SKF_R_INVALID_HANDLE 107
# define SKF_R_INVALID_HANDLE_MAGIC 125
# define SKF_R_INVALID_HANDLE_TYPE 126
# define SKF_R_INVALID_HASH_HANDLE 127
# define SKF_R_INVALID_ID_LENGTH 129
# define SKF_R_INVALID_INPUT_LENGTH 157
# define SKF_R_INVALID_IV_LENGTH 108
# define SKF_R_INVALID_KEY_HANDLE 116
# define SKF_R_INVALID_KEY_LENGTH 117
# define SKF_R_INVALID_MAC_HANDLE 118
# define SKF_R_INVALID_PLAINTEXT_LENGTH 147
# define SKF_R_INVALID_PRIVATE_KEY 152
# define SKF_R_INVALID_PUBLIC_KEY 153
# define SKF_R_INVALID_RANDOM_LENGTH 119
# define SKF_R_INVALID_RSA_PRIVATE_KEY 158
# define SKF_R_INVALID_RSA_PUBLIC_KEY 159
# define SKF_R_INVALID_SIGNATURE 148
# define SKF_R_MALLOC_FAILED 120
# define SKF_R_NO_PUBLIC_KEY 130
# define SKF_R_NULL_ARGUMENT 109
# define SKF_R_SAR_FAIL 110
# define SKF_R_SAR_OK 111
# define SKF_R_SET_CIPHER_CTX_FAILED 155
# define SKF_R_SIGN_FAILED 149
# define SKF_R_UNKNOWN_ALGOR 112
# define SKF_R_UNKNOWN_APP 113
# define SKF_R_VERIFY_NOT_PASS 150
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,722 +0,0 @@
/* engines/skf/skf_gmssl.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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 should be the SKF soft-token based on GmSSL libcrypto.
*/
#include <stdio.h>
#include <string.h>
#include "skf.h"
#define DEV_NAME "skf-soft-token"
#define DEV_NAME_LIST DEV_NAME"\0"
#define APP_NAME "default-app"
#define APP_NAME_LIST APP_NAME"\0"
#define CONTAINER_NAME "container0"
#define CONTAINER_NAME_LIST CONTAINER_NAME"\0"
ULONG DEVAPI SKF_WaitForDevEvent(LPSTR szDevName,
ULONG *pulDevNameLen, ULONG *pulEvent)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CancelWaitForDevEvent()
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumDev(BOOL bPresent,
LPSTR szNameList,
ULONG *pulSize)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ConnectDev(LPSTR szName,
DEVHANDLE *phDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DisConnectDev(DEVHANDLE hDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevState(LPSTR szDevName,
ULONG *pulDevState)
{
if (!pulDevState) {
return SAR_INVALIDPARAMERR;
}
*pulDevState = DEV_PRESENT_STATE;
return SAR_OK;
}
ULONG DEVAPI SKF_SetLabel(DEVHANDLE hDev,
LPSTR szLabel)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetDevInfo(DEVHANDLE hDev,
DEVINFO *pDevInfo)
{
DEVINFO devInfo;
bzero(&devInfo, sizeof(DEVINFO));
devInfo.Version.major = 1;
devInfo.Version.minor = 0;
strcpy((char *)&devInfo.Manufacturer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Issuer, "GmSSL Project (http://gmssl.org)");
strcpy((char *)&devInfo.Label, "SKF Softotken");
strcpy((char *)&devInfo.SerialNumber, "000001");
devInfo.HWVersion.major = 1;
devInfo.HWVersion.minor = 0;
devInfo.FirmwareVersion.major = 1;
devInfo.FirmwareVersion.minor = 0;
devInfo.AlgSymCap = 0x0000041F;
devInfo.AlgAsymCap = 0x00030700;
devInfo.AlgHashCap = 0x00000007;
devInfo.DevAuthAlgId = SGD_SM4_CBC;
devInfo.TotalSpace = 0;
devInfo.FreeSpace = 0;
devInfo.MaxECCBufferSize = 0; /* FIXME: max inlen of ECC encrypt */
devInfo.MaxBufferSize = 0; /* FIXME: max inlen of SM4 encrypt */
memcpy(pDevInfo, &devInfo, sizeof(DEVINFO));
return SAR_OK;
}
ULONG DEVAPI SKF_LockDev(DEVHANDLE hDev,
ULONG ulTimeOut)
{
return SAR_OK;
}
ULONG DEVAPI SKF_UnlockDev(DEVHANDLE hDev)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Transmit(DEVHANDLE hDev,
BYTE *pbCommand,
ULONG ulCommandLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ChangeDevAuthKey(DEVHANDLE hDev,
BYTE *pbKeyValue,
ULONG ulKeyLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DevAuth(DEVHANDLE hDev,
BYTE *pbAuthData,
ULONG ulLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ChangePIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szOldPin,
LPSTR szNewPin,
ULONG *pulRetryCount)
{
return SAR_OK;
}
LONG DEVAPI SKF_GetPINInfo(HAPPLICATION hApplication,
ULONG ulPINType,
ULONG *pulMaxRetryCount,
ULONG *pulRemainRetryCount,
BOOL *pbDefaultPin)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_VerifyPIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szPIN,
ULONG *pulRetryCount)
{
return SAR_OK;
}
ULONG DEVAPI SKF_UnblockPIN(HAPPLICATION hApplication,
LPSTR szAdminPIN,
LPSTR szNewUserPIN,
ULONG *pulRetryCount)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ClearSecureState(HAPPLICATION hApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CreateApplication(DEVHANDLE hDev,
LPSTR szAppName,
LPSTR szAdminPin,
DWORD dwAdminPinRetryCount,
LPSTR szUserPin,
DWORD dwUserPinRetryCount,
DWORD dwCreateFileRights,
HAPPLICATION *phApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EnumApplication(DEVHANDLE hDev,
LPSTR szAppName,
ULONG *pulSize)
{
if (!szAppName) {
*pulSize = sizeof(APP_NAME_LIST);
return SAR_OK;
}
if (*pulSize < sizeof(APP_NAME_LIST)) {
return SAR_BUFFER_TOO_SMALL;
}
memcpy(szAppName, APP_NAME_LIST, sizeof(APP_NAME_LIST));
return SAR_OK;
}
ULONG DEVAPI SKF_DeleteApplication(DEVHANDLE hDev,
LPSTR szAppName)
{
return SAR_OK;
}
ULONG DEVAPI SKF_OpenApplication(DEVHANDLE hDev,
LPSTR szAppName,
HAPPLICATION *phApplication)
{
if (!phApplication) {
return SAR_INVALIDPARAMERR;
}
return SAR_OK;
}
ULONG DEVAPI SKF_CloseApplication(HAPPLICATION hApplication)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CreateFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulFileSize,
ULONG ulReadRights,
ULONG ulWriteRights)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DeleteFile(HAPPLICATION hApplication,
LPSTR szFileName)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumFiles(HAPPLICATION hApplication,
LPSTR szFileList,
ULONG *pulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GetFileInfo(HAPPLICATION hApplication,
LPSTR szFileName,
FILEATTRIBUTE *pFileInfo)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ReadFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
ULONG ulSize,
BYTE * pbOutData,
ULONG *pulOutLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_WriteFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
BYTE *pbData,
ULONG ulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CreateContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DeleteContainer(HAPPLICATION hApplication,
LPSTR szContainerName)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EnumContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
ULONG *pulSize)
{
if (!pulSize) {
return SAR_INVALIDPARAMERR;
}
if (!szContainerName) {
*pulSize = sizeof(CONTAINER_NAME_LIST);
return SAR_OK;
}
if (*pulSize < sizeof(CONTAINER_NAME_LIST)) {
return SAR_BUFFER_TOO_SMALL;
}
memcpy(szContainerName, CONTAINER_NAME_LIST, sizeof(CONTAINER_NAME_LIST));
return SAR_OK;
}
ULONG DEVAPI SKF_OpenContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CloseContainer(HCONTAINER hContainer)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GetContainerType(HCONTAINER hContainer,
ULONG *pulContainerType)
{
if (!pulContainerType) {
return SAR_INVALIDPARAMERR;
}
*pulContainerType = CONTAINER_TYPE_ECC;
return SAR_OK;
}
ULONG DEVAPI SKF_ImportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE *pbCert,
ULONG ulCertLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_ExportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE* pbCert,
ULONG *pulCertLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenRandom(DEVHANDLE hDev,
BYTE *pbRandom,
ULONG ulRandomLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_GenExtRSAKey(DEVHANDLE hDev,
ULONG ulBitsLen,
RSAPRIVATEKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenRSAKeyPair(HCONTAINER hContainer,
ULONG ulBitsLen,
RSAPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportRSAKeyPair(HCONTAINER hContainer,
ULONG ulSymAlgId,
BYTE *pbWrappedKey,
ULONG ulWrappedKeyLen,
BYTE *pbEncryptedData,
ULONG ulEncryptedDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSASignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG *pulSignLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSAVerify(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG ulSignLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSAExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
RSAPUBLICKEYBLOB *pPubKey,
BYTE *pbData,
ULONG *pulDataLen,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtRSAPubKeyOperation(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtRSAPriKeyOperation(DEVHANDLE hDev,
RSAPRIVATEKEYBLOB *pRSAPriKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenECCKeyPair(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportECCKeyPair(HCONTAINER hContainer,
PENVELOPEDKEYBLOB pEnvelopedKeyBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCSignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pPubKey,
PECCCIPHERBLOB pData,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCEncrypt(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbPlainText,
ULONG ulPlainTextLen,
PECCCIPHERBLOB pCipherText)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCDecrypt(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
PECCCIPHERBLOB pCipherText,
BYTE *pbPlainText,
ULONG *pulPlainTextLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCSign(DEVHANDLE hDev,
ECCPRIVATEKEYBLOB *pECCPriKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExtECCVerify(DEVHANDLE hDev,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
PECCSIGNATUREBLOB pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataWithECC(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phAgreementHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(HANDLE hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pSponsorECCPubKeyBlob,
ECCPUBLICKEYBLOB *pSponsorTempECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
BYTE *pbSponsorID,
ULONG ulSponsorIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateKeyWithECC(HANDLE hAgreementHandle,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExportPublicKey(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE* pbBlob,
ULONG* pulBlobLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
BYTE *pbWrapedData,
ULONG ulWrapedLen,
HANDLE *phKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_SetSymmKey(DEVHANDLE hDev,
BYTE *pbKey,
ULONG ulAlgID,
HANDLE *phKey)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptInit(HANDLE hKey,
BLOCKCIPHERPARAM EncryptParam)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Encrypt(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptUpdate(HANDLE hKey,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbEncryptedData,
ULONG *pulEncryptedLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_EncryptFinal(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG *pulEncryptedDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptInit(HANDLE hKey,
BLOCKCIPHERPARAM DecryptParam)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Decrypt(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptUpdate(HANDLE hKey,
BYTE *pbEncryptedData,
ULONG ulEncryptedLen,
BYTE *pbData,
ULONG *pulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DecryptFinal(HANDLE hKey,
BYTE *pbDecryptedData,
ULONG *pulDecryptedDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestInit(DEVHANDLE hDev,
ULONG ulAlgID,
ECCPUBLICKEYBLOB *pPubKey,
BYTE *pucID,
ULONG ulIDLen,
HANDLE *phHash)
{
return SAR_OK;
}
ULONG DEVAPI SKF_Digest(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbHashData,
ULONG *pulHashLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestUpdate(HANDLE hHash,
BYTE *pbData,
ULONG ulDataLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_DigestFinal(HANDLE hHash,
BYTE *pHashData,
ULONG *pulHashLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_MacInit(HANDLE hKey,
BLOCKCIPHERPARAM *pMacParam,
HANDLE *phMac)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_Mac(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbMacData,
ULONG *pulMacLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_MacUpdate(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_MacFinal(HANDLE hMac,
BYTE *pbMacData,
ULONG *pulMacDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CloseHandle(HANDLE hHandle)
{
return SAR_NOTSUPPORTYETERR;
}

206
crypto/skf/skf_handle.c Normal file
View File

@@ -0,0 +1,206 @@
/* crypto/skf/skf_handle.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
EVP_MD_CTX *SKF_HANDLE_get_md_ctx(SKF_HANDLE *handle)
{
EVP_MD_CTX *ret;
if (!handle) {
SKFerr(SKF_F_SKF_HANDLE_GET_MD_CTX, SKF_R_NULL_ARGUMENT);
return NULL;
}
if (handle->magic != SKF_HANDLE_MAGIC) {
SKFerr(SKF_F_SKF_HANDLE_GET_MD_CTX, SKF_R_INVALID_HANDLE_MAGIC);
return NULL;
}
if (handle->type != SKF_HASH_HANDLE) {
SKFerr(SKF_F_SKF_HANDLE_GET_MD_CTX, SKF_R_INVALID_HANDLE_TYPE);
return NULL;
}
if (!(ret = handle->u.md_ctx)) {
SKFerr(SKF_F_SKF_HANDLE_GET_MD_CTX, SKF_R_CTX_NOT_CREATED);
return NULL;
}
return ret;
}
CBCMAC_CTX *SKF_HANDLE_get_cbcmac_ctx(SKF_HANDLE *handle)
{
CBCMAC_CTX *ret;
if (!handle) {
SKFerr(SKF_F_SKF_HANDLE_GET_CBCMAC_CTX, SKF_R_NULL_ARGUMENT);
return NULL;
}
if (handle->magic != SKF_HANDLE_MAGIC) {
SKFerr(SKF_F_SKF_HANDLE_GET_CBCMAC_CTX, SKF_R_INVALID_HANDLE_MAGIC);
return NULL;
}
if (handle->type != SKF_MAC_HANDLE) {
SKFerr(SKF_F_SKF_HANDLE_GET_CBCMAC_CTX, SKF_R_INVALID_HANDLE_TYPE);
return NULL;
}
if (!(ret = handle->u.cbcmac_ctx)) {
SKFerr(SKF_F_SKF_HANDLE_GET_CBCMAC_CTX, SKF_R_CTX_NOT_CREATED);
return NULL;
}
return ret;
}
EVP_CIPHER_CTX *SKF_HANDLE_get_cipher_ctx(SKF_HANDLE *handle)
{
EVP_CIPHER_CTX *ret;
if (!handle) {
SKFerr(SKF_F_SKF_HANDLE_GET_CIPHER_CTX, SKF_R_NULL_ARGUMENT);
return NULL;
}
if (handle->magic != SKF_HANDLE_MAGIC) {
SKFerr(SKF_F_SKF_HANDLE_GET_CIPHER_CTX, SKF_R_INVALID_HANDLE_MAGIC);
return NULL;
}
if (handle->type != SKF_CIPHER_HANDLE) {
SKFerr(SKF_F_SKF_HANDLE_GET_CIPHER_CTX, SKF_R_INVALID_HANDLE_TYPE);
return NULL;
}
if (!(ret = handle->u.cipher_ctx)) {
SKFerr(SKF_F_SKF_HANDLE_GET_CIPHER_CTX, SKF_R_CTX_NOT_CREATED);
return NULL;
}
return ret;
}
int SKF_HANDLE_free_cipher_ctx(SKF_HANDLE *handle)
{
return 0;
}
int SKF_HANDLE_free(SKF_HANDLE *handle)
{
return 0;
}
unsigned char *SKF_HANDLE_get_key(SKF_HANDLE *handle)
{
return NULL;
}
SKF_HANDLE *SKF_HANDLE_new(int type)
{
return NULL;
}
int SKF_HANDLE_set1_cipher_ctx(SKF_HANDLE *handle, EVP_CIPHER_CTX *ctx)
{
return 0;
}
ULONG DEVAPI SKF_CloseHandle(HANDLE hHandle)
{
SKF_HANDLE *handle;
if (!(handle = (SKF_HANDLE *)hHandle)) {
SKFerr(SKF_F_SKF_CLOSEHANDLE, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (handle->magic != SKF_HANDLE_MAGIC) {
SKFerr(SKF_F_SKF_CLOSEHANDLE, SKF_R_INVALID_HANDLE_MAGIC);
return SAR_INVALIDPARAMERR;
}
switch (handle->type) {
case SKF_KEY_HANDLE:
OPENSSL_cleanse(handle->key, EVP_MAX_KEY_LENGTH);
// FIXME: we need to make sure there are no pending operation
if (handle->u.cipher_ctx) {
EVP_CIPHER_CTX_cleanup(handle->u.cipher_ctx);
}
break;
case SKF_MAC_HANDLE:
CBCMAC_CTX_cleanup(handle->u.cbcmac_ctx);
break;
case SKF_HASH_HANDLE:
EVP_MD_CTX_cleanup(handle->u.md_ctx);
break;
default:
SKFerr(SKF_F_SKF_CLOSEHANDLE, SKF_R_INVALID_HANDLE_TYPE);
return SAR_INVALIDPARAMERR;
}
/* now we remove this handle from list */
return SAR_OK;
}

View File

@@ -1,4 +1,4 @@
/* crypto/skf/skf.h */
/* crypto/skf/skf_lcl.h */
/* ====================================================================
* Copyright (c) 2016 The GmSSL Project. All rights reserved.
*
@@ -49,87 +49,52 @@
*
*/
#ifndef HEADER_SKF_H
#define HEADER_SKF_H
#ifndef HEADER_SKF_LCL_H
#define HEADER_SKF_LCL_H
#include <openssl/evp.h>
#include <openssl/cmac.h>
#include <openssl/cbcmac.h>
#ifdef __cplusplus
extern "C" {
#endif
#define SKF_HANDLE_MAGIC 0x31323334
#define SKF_HASH_HANDLE 1
#define SKF_MAC_HANDLE 2
#define SKF_KEY_HANDLE 10
#define SKF_CIPHER_HANDLE 11
int EC_KEY_set_ECCPUBLICKEYBLOB(EC_KEY *ec_key, const ECCPUBLICKEYBLOB *blob);
int EC_KEY_get_ECCPUBLICKEYBLOB(EC_KEY *ec_key, ECCPUBLICKEYBLOB *blob);
int EC_KEY_set_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, const ECCPRIVATEKEYBLOB *blob)
int EC_KEY_get_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, ECCPRIVATEKEYBLOB *blob);
struct SKF_HANDLE {
unsigned int magic;
int type;
int algid;
unsigned int keylen;
unsigned char key[EVP_MAX_KEY_LENGTH];
union {
EVP_MD_CTX *md_ctx;
CBCMAC_CTX *cbcmac_ctx;
EVP_CIPHER_CTX *cipher_ctx;
} u;
struct SKF_HANDLE *next;
struct SKF_HANDLE *prev;
};
int SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB(SM2_CIPHERTEXT_VALUE *cv,
const ECCCIPHERBLOB *blob);
int SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(const SM2_CIPHERTEXT_VALUE *a,
void *out, size_t *outlen);
int ECDSA_SIG_to_SKF_ECCSIGNATUREBLOB(const ECDSA_SIG *sig,
const EC_GROUP *group, void *out, size_t *outlen);
typedef struct SKF_HANDLE SKF_HANDLE;
int RSA_set_RSAPUBLICKEYBLOB(RSA *rsa, const RSAPUBLICKEYBLOB *blob);
int RSA_get_RSAPUBLICKEYBLOB(RSA *rsa, RSAPUBLICKEYBLOB *blob);
int RSA_set_RSAPRIVATEKEYBLOB(RSA *rsa, const RSAPRIVATEKEYBLOB *blob);
int RSA_to_RSAPRIVATEKEYBLOB(RSA *rsa, RSAPRIVATEKEYBLOB *blob);
SKF_HANDLE *SKF_HANDLE_new(int type);
EVP_MD_CTX *SKF_HANDLE_get_md_ctx(SKF_HANDLE *hHash);
CBCMAC_CTX *SKF_HANDLE_get_cbcmac_ctx(SKF_HANDLE *hMac);
EVP_CIPHER_CTX *SKF_HANDLE_get_cipher_ctx(SKF_HANDLE *hKey);
unsigned char *SKF_HANDLE_get_key(SKF_HANDLE *hKey);
int SKF_HANDLE_set1_md_ctx(SKF_HANDLE *hHash, EVP_MD_CTX *ctx);
int SKF_HANDLE_set1_cbcmac_ctx(SKF_HANDLE *hMac, CBCMAC_CTX *ctx);
int SKF_HANDLE_set1_cipher_ctx(SKF_HANDLE *hKey, EVP_CIPHER_CTX *ctx);
int SKF_HANDLE_free(SKF_HANDLE *handle);
#define SAR_OK 0x00000000
#define SAR_FAIL 0x0A000001
#define SAR_UNKNOWNERR 0x0A000002
#define SAR_NOTSUPPORTYETERR 0x0A000003
#define SAR_FILEERR 0x0A000004
#define SAR_INVALIDHANDLEERR 0x0A000005
#define SAR_INVALIDPARAMERR 0x0A000006
#define SAR_READFILEERR 0x0A000007
#define SAR_WRITEFILEERR 0x0A000008
#define SAR_NAMELENERR 0x0A000009
#define SAR_KEYUSAGEERR 0x0A00000A
#define SAR_MODULUSLENERR 0x0A00000B
#define SAR_NOTINITIALIZEERR 0x0A00000C
#define SAR_OBJERR 0x0A00000D
#define SAR_MEMORYERR 0x0A00000E
#define SAR_TIMEOUTERR 0x0A00000F
#define SAR_INDATALENERR 0x0A000010
#define SAR_INDATAERR 0x0A000011
#define SAR_GENRANDERR 0x0A000012
#define SAR_HASHOBJERR 0x0A000013
#define SAR_HASHERR 0x0A000014
#define SAR_GENRSAKEYERR 0x0A000015
#define SAR_RSAMODULUSLENERR 0x0A000016
#define SAR_CSPIMPRTPUBKEYERR 0x0A000017
#define SAR_RSAENCERR 0x0A000018
#define SAR_RSADECERR 0x0A000019
#define SAR_HASHNOTEQUALERR 0x0A00001A
#define SAR_KEYNOTFOUNTERR 0x0A00001B
#define SAR_KEYNOTFOUNDERR 0x0A00001B
#define SAR_CERTNOTFOUNTERR 0x0A00001C
#define SAR_NOTEXPORTERR 0x0A00001D
#define SAR_DECRYPTPADERR 0x0A00001E
#define SAR_MACLENERR 0x0A00001F
#define SAR_BUFFER_TOO_SMALL 0x0A000020
#define SAR_KEYINFOTYPEERR 0x0A000021
#define SAR_NOT_EVENTERR 0x0A000022
#define SAR_DEVICE_REMOVED 0x0A000023
#define SAR_PIN_INCORRECT 0x0A000024
#define SAR_PIN_LOCKED 0x0A000025
#define SAR_PIN_INVALID 0x0A000026
#define SAR_PIN_LEN_RANGE 0x0A000027
#define SAR_USER_ALREADY_LOGGED_IN 0x0A000028
#define SAR_USER_PIN_NOT_INITIALIZED 0x0A000029
#define SAR_USER_TYPE_INVALID 0x0A00002A
#define SAR_APPLICATION_NAME_INVALID 0x0A00002B
#define SAR_APPLICATION_EXISTS 0x0A00002C
#define SAR_USER_NOT_LOGGED_IN 0x0A00002D
#define SAR_APPLICATION_NOT_EXISTS 0x0A00002E
#define SAR_FILE_ALREADY_EXIST 0x0A00002F
#define SAR_NO_ROOM 0x0A000030
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif
#endif

179
crypto/skf/skf_mac.c Normal file
View File

@@ -0,0 +1,179 @@
/* crypto/skf/skf_mac.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/sms4.h>
#include <openssl/cbcmac.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
ULONG DEVAPI SKF_MacInit(HANDLE hKey,
BLOCKCIPHERPARAM *pMacParam,
HANDLE *phMac)
{
int ok = 0;
SKF_HANDLE *key;
SKF_HANDLE *hMac = NULL;
const EVP_CIPHER *cipher;
if (!(key = (SKF_HANDLE *)hKey)) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
OPENSSL_assert(!pMacParam);
if (key->magic != SKF_HANDLE_MAGIC) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_INVALID_HANDLE_MAGIC);
return SAR_INVALIDPARAMERR;
}
if (key->type <= SKF_KEY_HANDLE) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_INVALID_KEY_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (key->algid != SGD_SM4_MAC) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_INVALID_ALGOR);
return SAR_INVALIDPARAMERR;
}
cipher = EVP_sms4_ecb();
if (key->keylen < SMS4_KEY_LENGTH) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_INVALID_KEY_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!(hMac = OPENSSL_malloc(sizeof(*hMac)))) {
SKFerr(SKF_F_SKF_MACINIT, SKF_R_FAIL);
return SAR_FAIL;
}
hMac->magic = SKF_HANDLE_MAGIC;
hMac->type = SKF_MAC_HANDLE;
hMac->algid = key->algid;
if (!(hMac->u.cbcmac_ctx = CBCMAC_CTX_new())) {
SKFerr(SKF_F_SKF_MACINIT, ERR_R_CBCMAC_LIB);
goto end;
}
if (!CBCMAC_Init(hMac->u.cbcmac_ctx, key->key, key->keylen, cipher, NULL)) {
SKFerr(SKF_F_SKF_MACINIT, ERR_R_CBCMAC_LIB);
return SAR_FAIL;
}
*phMac = hMac;
end:
return SAR_OK;
}
ULONG DEVAPI SKF_MacUpdate(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen)
{
CBCMAC_CTX *ctx;
if (!(ctx = SKF_HANDLE_get_cbcmac_ctx(hMac))) {
SKFerr(SKF_F_SKF_MACUPDATE, SKF_R_INVALID_MAC_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (!CBCMAC_Update(ctx, pbData, ulDataLen)) {
SKFerr(SKF_F_SKF_MACUPDATE, ERR_R_CBCMAC_LIB);
return SAR_FAIL;
}
return SAR_OK;
}
ULONG DEVAPI SKF_MacFinal(HANDLE hMac,
BYTE *pbMacData,
ULONG *pulMacDataLen)
{
CBCMAC_CTX *ctx;
if (!(ctx = SKF_HANDLE_get_cbcmac_ctx(hMac))) {
SKFerr(SKF_F_SKF_MACFINAL, SKF_R_INVALID_MAC_HANDLE);
return SAR_INVALIDPARAMERR;
}
if (!CBCMAC_Final(ctx, pbMacData, pulMacDataLen)) {
SKFerr(SKF_F_SKF_MACFINAL, ERR_R_CBCMAC_LIB);
return SAR_FAIL;
}
return SAR_OK;
}
ULONG DEVAPI SKF_Mac(HANDLE hMac,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbMacData,
ULONG *pulMacLen)
{
ULONG rv;
if ((rv = SKF_MacUpdate(hMac, pbData, ulDataLen)) != SAR_OK) {
SKFerr(SKF_F_SKF_MAC, ERR_R_SKF_LIB);
return rv;
}
if ((rv = SKF_MacFinal(hMac, pbMacData, pulMacLen)) != SAR_OK) {
SKFerr(SKF_F_SKF_MAC, ERR_R_SKF_LIB);
return rv;
}
return SAR_OK;
}

83
crypto/skf/skf_rand.c Normal file
View File

@@ -0,0 +1,83 @@
/* crypto/skf/skf_rand.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/rand.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
#define SKF_DEV_AUTH_RANDOM_LENGTH 16
#define SKF_MAX_RANDOM_LENGTH (1024*1024*1024)
//FIXME: INT_MAX
ULONG DEVAPI SKF_GenRandom(DEVHANDLE hDev,
BYTE *pbRandom,
ULONG ulRandomLen)
{
if (!pbRandom) {
SKFerr(SKF_F_SKF_GENRANDOM, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (ulRandomLen > SKF_MAX_RANDOM_LENGTH) {
SKFerr(SKF_F_SKF_GENRANDOM, SKF_R_INVALID_RANDOM_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!RAND_bytes(pbRandom, ulRandomLen)) {
SKFerr(SKF_F_SKF_GENRANDOM, ERR_R_RAND_LIB);
return SAR_GENRANDERR;
}
return SAR_OK;
}

377
crypto/skf/skf_rsa.c Normal file
View File

@@ -0,0 +1,377 @@
/* crypto/skf/skf_rsa.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/rsa.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
#if 0
ULONG DEVAPI SKF_GenExtRSAKey(DEVHANDLE hDev,
ULONG ulBitsLen,
RSAPRIVATEKEYBLOB *pBlob)
{
ULONG ret = SAR_FAIL;
RSA *rsa = NULL;
if ((ulBitsLen > MAX_RSA_MODULUS_LEN * 8) || (ulBitsLen < 1024) ||
(ulBitsLen % 8 != 0)) {
SKFerr(SKF_F_SKF_GENEXTRSAKEY, SKF_R_INVALID_KEY_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!pBlob) {
SKFerr(SKF_F_SKF_GENEXTRSAKEY, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (!(rsa = RSA_new())) {
SKFerr(SKF_F_SKF_GENEXTRSAKEY, SKF_R_MALLOC_FAILED);
return SAR_FAIL;
}
if (!RSA_generate_key_ex(rsa, ulBitsLen, NULL, NULL)) {
SKFerr(SKF_F_SKF_GENEXTRSAKEY, SKF_R_GEN_RSA_FAILED);
goto end;
}
if (!RSA_get_RSAPRIVATEKEYBLOB(rsa, pBlob)) {
SKFerr(SKF_F_SKF_GENEXTRSAKEY, SKF_R_ENCODE_FAILED);
goto end;
}
ret = SAR_OK;
end:
RSA_free(rsa);
return ret;
}
ULONG DEVAPI SKF_ExtRSAPubKeyOperation(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
ULONG ret = SAR_FAIL;
RSA *rsa = NULL;
int inlen, outlen;
if (!pRSAPubKeyBlob || !pbInput || !pulOutputLen) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (pRSAPubKeyBlob->AlgID != SGD_RSA) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_INVALID_ALGOR);
return SAR_INVALIDPARAMERR;
}
if (pRSAPubKeyBlob->BitLen % 8) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_INVALID_KEY_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (ulInputLen * 8 != pRSAPubKeyBlob->BitLen) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_INVALID_INPUT_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!pbOutput) {
*pulOutputLen = pRSAPubKeyBlob->BitLen / 8;
return SAR_OK;
}
if (*pulOutputLen < pRSAPubKeyBlob->BitLen / 8) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_BUFFER_TOO_SMALL);
return SAR_BUFFER_TOO_SMALL;
}
if (!(rsa = RSA_new_from_RSAPUBLICKEYBLOB(pRSAPubKeyBlob))) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, SKF_R_INVALID_RSA_PUBLIC_KEY);
goto end;
}
inlen = (int)ulInputLen;
if ((outlen = RSA_public_encrypt(inlen, pbInput, pbOutput, rsa, RSA_NO_PADDING)) < 0) {
SKFerr(SKF_F_SKF_EXTRSAPUBKEYOPERATION, ERR_R_RSA_LIB);
goto end;
}
*pulOutputLen = outlen;
ret = SAR_OK;
end:
RSA_free(rsa);
return ret;
}
ULONG DEVAPI SKF_ExtRSAPriKeyOperation(DEVHANDLE hDev,
RSAPRIVATEKEYBLOB *pRSAPriKeyBlob,
BYTE *pbInput,
ULONG ulInputLen,
BYTE *pbOutput,
ULONG *pulOutputLen)
{
ULONG ret = SAR_FAIL;
RSA *rsa = NULL;
int inlen, outlen;
if (!pRSAPriKeyBlob || !pbInput || !pulOutputLen) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (pRSAPriKeyBlob->AlgID != SGD_RSA) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_INVALID_ALGOR);
return SAR_INVALIDPARAMERR;
}
if (pRSAPriKeyBlob->BitLen % 8) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_INVALID_KEY_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (ulInputLen * 8 != pRSAPriKeyBlob->BitLen) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_INVALID_INPUT_LENGTH);
return SAR_INVALIDPARAMERR;
}
if (!pbOutput) {
*pulOutputLen = pRSAPriKeyBlob->BitLen / 8;
return SAR_OK;
}
if (*pulOutputLen < pRSAPriKeyBlob->BitLen / 8) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_BUFFER_TOO_SMALL);
return SAR_BUFFER_TOO_SMALL;
}
if (!(rsa = RSA_new_from_RSAPRIVATEKEYBLOB(pRSAPriKeyBlob))) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, SKF_R_INVALID_RSA_PUBLIC_KEY);
goto end;
}
inlen = (int)ulInputLen;
if ((outlen = RSA_private_decrypt(inlen, pbInput, pbOutput, rsa, RSA_NO_PADDING)) < 0) {
SKFerr(SKF_F_SKF_EXTRSAPRIKEYOPERATION, ERR_R_RSA_LIB);
goto end;
}
*pulOutputLen = outlen;
ret = SAR_OK;
end:
RSA_free(rsa);
return ret;
}
ULONG DEVAPI SKF_RSAVerify(DEVHANDLE hDev,
RSAPUBLICKEYBLOB *pRSAPubKeyBlob,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG ulSignLen)
{
return SAR_FAIL;
}
/* Wrapper functions */
RSA *RSA_new_from_RSAPUBLICKEYBLOB(const RSAPUBLICKEYBLOB *blob)
{
RSA *ret;
if (!(ret = RSA_new())) {
SKFerr(SKF_F_RSA_NEW_FROM_RSAPUBLICKEYBLOB, ERR_R_RSA_LIB);
return NULL;
}
if (!RSA_set_RSAPUBLICKEYBLOB(ret, blob)) {
SKFerr(SKF_F_RSA_NEW_FROM_RSAPUBLICKEYBLOB, SKF_R_INVALID_RSA_PUBLIC_KEY);
RSA_free(ret);
return NULL;
}
return ret;
}
RSA *RSA_new_from_RSAPRIVATEKEYBLOB(const RSAPRIVATEKEYBLOB *blob)
{
RSA *ret;
if (!(ret = RSA_new())) {
SKFerr(SKF_F_RSA_NEW_FROM_RSAPRIVATEKEYBLOB, ERR_R_RSA_LIB);
return NULL;
}
if (!RSA_set_RSAPRIVATEKEYBLOB(ret, blob)) {
SKFerr(SKF_F_RSA_NEW_FROM_RSAPRIVATEKEYBLOB, SKF_R_INVALID_RSA_PRIVATE_KEY);
RSA_free(ret);
return NULL;
}
return ret;
}
int RSA_set_RSAPUBLICKEYBLOB(RSA *rsa, const RSAPUBLICKEYBLOB *blob)
{
int ret = 0;
if (!rsa || !blob) {
SKFerr(SKF_F_RSA_SET_RSAPUBLICKEYBLOB, SKF_R_NULL_ARGUMENT);
return 0;
}
if (!(rsa->n = BN_bin2bn(blob->Modulus, blob->BitLen/8, rsa->n))) {
goto end;
}
if (!(rsa->e = BN_bin2bn(blob->PublicExponent, blob->BitLen/8, rsa->e))) {
goto end;
}
if (!RSA_check_key(rsa)) {
goto end;
}
end:
return ret;
}
int RSA_get_RSAPUBLICKEYBLOB(RSA *rsa, RSAPUBLICKEYBLOB *blob)
{
int ret = 0;
int nbytes;
if (!rsa->n || !rsa->e) {
goto end;
}
nbytes = BN_num_bytes(rsa->n);
if (!BN_bn2bin(rsa->n, blob->Modulus + bnlen - BN_num_bytes(rsa->n)) ||
!BN_bn2bin(rsa->e, blob->PublicExponent + bnlen - BN_num_bytes(rsa->e))) {
}
return ret;
}
int RSA_set_RSAPRIVATEKEYBLOB(RSA *rsa, const RSAPRIVATEKEYBLOB *blob)
{
int ret = 0;
int nbytes;
if (!rsa || !blob) {
SKFerr(SKF_F_RSA_SET_RSAPRIVATEKEYBLOB, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (blob->AlgID != SGD_RSA) {
SKFerr(SKF_F_RSA_SET_RSAPRIVATEKEYBLOB, SKR_R_INVALID_ALGOR);
return SAR_INVALIDPARAMERR;
}
if ((blob->BitLen < 1024) || (blob->BitLen > MAX_RSA_MODULUS_LEN*8) ||
(blob->BitLen % 8 != 0) || (blob->BitLen % 16 != 0)) {
SKFerr(SKF_F_RSA_SET_RSAPRIVATEKEYBLOB, SKR_R_INVALID_KEY_LENGTH);
return SAR_INVALIDPARAMERR;
}
nbytes = blob->BitLen/8;
if (!(rsa->n = BN_bin2bn(blob->Modulus, nbytes, rsa->n)) ||
!(rsa->e = BN_bin2bn(blob->PublicExponent, MAX_RSA_EXPONENT_LEN, rsa->e)) ||
!(rsa->d = BN_bin2bn(blob->PrivateExponent, nbytes, rsa->d)) ||
!(rsa->p = BN_bin2bn(blob->Prime1, nbytes/2, rsa->p)) ||
!(rsa->q = BN_bin2bn(blob->Prime2, nbytes/2, rsa->q)) ||
!(rsa->dmp1 = BN_bin2bn(blob->Prime1Exponent, nbytes/2, rsa->dmp1)) ||
!(rsa->dmq1 = BN_bin2bn(blob->Prime2Exponent, nbytes/2, rsa->dmq1)) ||
!(rsa->iqmp = BN_bin2bn(blob->Coefficient, nbytes/2, rsa->iqmp))) {
SKFerr(SKF_F_RSA_SET_RSAPRIVATEKEYBLOB, SKR_R_INVALID_RSA_PRIVATE_KEY);
return SAR_INVALIDPARAMERR;
}
return SAR_OK;
}
int RSA_get_RSAPRIVATEKEYBLOB(RSA *rsa, RSAPRIVATEKEYBLOB *blob)
{
int nbytes;
if (!rsa || !blob) {
SKFerr(SKF_F_RSA_GET_RSAPRIVATEKEYBLOB, SKF_R_NULL_ARGUMENT);
return SAR_INVALIDPARAMERR;
}
if (!rsa->n || !rsa->e || !rsa->d || !rsa->p || !rsa->q ||
!rsa->dmp1 || !rsa->dmq1 || !rsa->iqmp)
SKFerr(SKF_F_RSA_GET_RSAPRIVATEKEYBLOB, SKF_R_INVALID_RSA_PRIVATE_KEY);
return SAR_INVALIDPARAMERR;
}
bzero(blob, sizeof(*blob));
blob->AlgID = SGD_RSA;
blob->BitLen = BN_num_bits(rsa->n);
nbytes = BN_num_bytes(rsa->n);
if (!BN_bn2bin(rsa->n, blob->Modulus) ||
!BN_bn2bin(rsa->e, blob->PublicExponent + MAX_RSA_EXPONENT_LEN - BN_num_bytes(rsa->e)) ||
!BN_bn2bin(rsa->d, blob->PrivateExponent + nbytes - BN_num_bytes(rsa->d)) ||
!BN_bn2bin(rsa->p, blob->Prime1 + nbytes/2 - BN_num_bytes(rsa->p)) ||
!BN_bn2bin(rsa->q, blob->Prime2 + nbytes/2 - BN_num_bytes(rsa->q)) ||
!BN_bn2bin(rsa->dmp1, blob->Prime1Exponent + nbytes/2 - BN_num_bytes(rsa->dmp1)) ||
!BN_bn2bin(rsa->dmq1, blob->Prime2Exponent + nbytes/2 - BN_num_bytes(rsa->dmq1)) ||
!BN_bn2bin(rsa->iqmp, blob->Coefficient + nbytes/2 - BN_num_bytes(rsa->iqmp))) {
SKFerr(SKF_F_RSA_GET_RSAPRIVATEKEYBLOB, SKF_R_INVALID_RSA_PRIVATE_KEY);
return SAR_INVALIDPARAMERR;
}
return SAR_OK;
}
#endif

98
crypto/skf/skf_sesskey.c Normal file
View File

@@ -0,0 +1,98 @@
/* crypto/skf/skf_sesskey.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <strings.h>
#include <openssl/sms4.h>
#include <openssl/evp.h>
#include <openssl/skf.h>
#include <openssl/skf_ex.h>
#include "skf_lcl.h"
#define PADDING_TYPE_NO_PADDING 0
#define PADDING_TYPE_PKCS5 1
ULONG DEVAPI SKF_SetSymmKey(DEVHANDLE hDev,
BYTE *pbKey,
ULONG ulAlgID,
HANDLE *phKey)
{
SKF_HANDLE *hKey = NULL;
if (!(hKey = OPENSSL_malloc(sizeof(*hKey)))) {
SKFerr(SKF_F_SKF_SETSYMMKEY, SKF_R_MALLOC_FAILED);
return SAR_FAIL;
}
bzero(hKey, sizeof(*hKey));
hKey->magic = SKF_HANDLE_MAGIC;
hKey->type = SKF_KEY_HANDLE;
switch (ulAlgID) {
case SGD_SM4_ECB:
case SGD_SM4_CBC:
case SGD_SM4_CFB:
case SGD_SM4_OFB:
case SGD_SM4_MAC:
hKey->algid = ulAlgID;
hKey->keylen = SMS4_KEY_LENGTH;
break;
default:
SKFerr(SKF_F_SKF_SETSYMMKEY, SKF_R_INVALID_ALGOR);
return SAR_INVALIDPARAMERR;
}
memcpy(hKey->key, pbKey, hKey->keylen);
*phKey = hKey;
return SAR_OK;
}

394
crypto/skf/skf_token.c Normal file
View File

@@ -0,0 +1,394 @@
/* crypto/skf/skf_app.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/skf.h>
ULONG DEVAPI SKF_WaitForDevEvent(LPSTR szDevName,
ULONG *pulDevNameLen,
ULONG *pulEvent)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CancelWaitForDevEvent(void)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_SetLabel(DEVHANDLE hDev,
LPSTR szLabel)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_LockDev(DEVHANDLE hDev,
ULONG ulTimeOut)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_UnlockDev(DEVHANDLE hDev)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_Transmit(DEVHANDLE hDev,
BYTE* pbCommand,
ULONG ulCommandLen,
BYTE* pbData,
ULONG* pulDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ChangeDevAuthKey(DEVHANDLE hDev,
BYTE *pbKeyValue,
ULONG ulKeyLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DevAuth(DEVHANDLE hDev,
BYTE *pbAuthData,
ULONG ulLen)
{
return SAR_OK;
}
ULONG DEVAPI SKF_CreateApplication(DEVHANDLE hDev,
LPSTR szAppName,
LPSTR szAdminPin,
DWORD dwAdminPinRetryCount,
LPSTR szUserPin,
DWORD dwUserPinRetryCount,
DWORD dwCreateFileRights,
HAPPLICATION *phApplication)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumApplication(DEVHANDLE hDev,
LPSTR szAppName,
ULONG *pulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DeleteApplication(DEVHANDLE hDev,
LPSTR szAppName)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_OpenApplication(DEVHANDLE hDev,
LPSTR szAppName,
HAPPLICATION *phApplication)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CloseApplication(HAPPLICATION hApplication)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ChangePIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szOldPin,
LPSTR szNewPin,
ULONG *pulRetryCount)
{
return SAR_NOTSUPPORTYETERR;
}
LONG DEVAPI SKF_GetPINInfo(HAPPLICATION hApplication,
ULONG ulPINType,
ULONG *pulMaxRetryCount,
ULONG *pulRemainRetryCount,
BOOL *pbDefaultPin)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_VerifyPIN(HAPPLICATION hApplication,
ULONG ulPINType,
LPSTR szPIN,
ULONG *pulRetryCount)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_UnblockPIN(HAPPLICATION hApplication,
LPSTR szAdminPIN,
LPSTR szNewUserPIN,
ULONG *pulRetryCount)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ClearSecureState(HAPPLICATION hApplication)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CreateContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DeleteContainer(HAPPLICATION hApplication,
LPSTR szContainerName)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
ULONG *pulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_OpenContainer(HAPPLICATION hApplication,
LPSTR szContainerName,
HCONTAINER *phContainer)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CloseContainer(HCONTAINER hContainer)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GetContainerType(HCONTAINER hContainer,
ULONG *pulContainerType)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE *pbCert,
ULONG ulCertLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ExportCertificate(HCONTAINER hContainer,
BOOL bSignFlag,
BYTE *pbCert,
ULONG *pulCertLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_CreateFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulFileSize,
ULONG ulReadRights,
ULONG ulWriteRights)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_EnumFiles(HAPPLICATION hApplication,
LPSTR szFileList,
ULONG *pulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GetFileInfo(HAPPLICATION hApplication,
LPSTR szFileName,
FILEATTRIBUTE *pFileInfo)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ReadFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
ULONG ulSize,
BYTE *pbOutData,
ULONG *pulOutLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_WriteFile(HAPPLICATION hApplication,
LPSTR szFileName,
ULONG ulOffset,
BYTE *pbData,
ULONG ulSize)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_DeleteFile(HAPPLICATION hApplication,
LPSTR szFileName)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenECCKeyPair(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportECCKeyPair(HCONTAINER hContainer,
ENVELOPEDKEYBLOB *pEnvelopedKeyBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCSignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
ECCSIGNATUREBLOB *pSignature)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataWithECC(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phAgreementHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateAgreementDataAndKeyWithECC(HANDLE hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pSponsorECCPubKeyBlob,
ECCPUBLICKEYBLOB *pSponsorTempECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
BYTE *pbSponsorID,
ULONG ulSponsorIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenerateKeyWithECC(HANDLE hAgreementHandle,
ECCPUBLICKEYBLOB *pECCPubKeyBlob,
ECCPUBLICKEYBLOB *pTempECCPubKeyBlob,
BYTE *pbID,
ULONG ulIDLen,
HANDLE *phKeyHandle)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_GenRSAKeyPair(HCONTAINER hContainer,
ULONG ulBitsLen,
RSAPUBLICKEYBLOB *pBlob)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportRSAKeyPair(HCONTAINER hContainer,
ULONG ulSymAlgId,
BYTE *pbWrappedKey,
ULONG ulWrappedKeyLen,
BYTE *pbEncryptedData,
ULONG ulEncryptedDataLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSASignData(HCONTAINER hContainer,
BYTE *pbData,
ULONG ulDataLen,
BYTE *pbSignature,
ULONG *pulSignLen)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ImportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
BYTE *pbWrapedData,
ULONG ulWrapedLen,
HANDLE *phKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_RSAExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
RSAPUBLICKEYBLOB *pPubKey,
BYTE *pbData,
ULONG *pulDataLen,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}
ULONG DEVAPI SKF_ECCExportSessionKey(HCONTAINER hContainer,
ULONG ulAlgId,
ECCPUBLICKEYBLOB *pPubKey,
ECCCIPHERBLOB *pData,
HANDLE *phSessionKey)
{
return SAR_NOTSUPPORTYETERR;
}

View File

@@ -1,285 +0,0 @@
#include <stdio.h>
#include <strings.h>
#include <openssl/sm2.h>
#include <openssl/rsa.h>
#include "skf.h"
int EC_KEY_set_ECCPUBLICKEYBLOB(EC_KEY *ec_key, const ECCPUBLICKEYBLOB *blob)
{
int ret = 0;
int nbytes;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
if (blob->BitLen != EC_GROUP_get_degree(EC_KEY_get0_group(ec_key))) {
return 0;
}
nbytes = (blob->BitLen + 7)/8;
if (!(x = BN_bin2bn(blob->XCoordinate, nbytes, NULL))) {
goto end;
}
if (!(y = BN_bin2bn(blob->YCoordinate, nbytes, NULL))) {
goto end;
}
if (!EC_KEY_set_public_key_affine_coordinates(ec_key, x, y)) {
goto end;
}
ret = 1;
end:
BN_free(x);
BN_free(y);
return ret;
}
int EC_KEY_get_ECCPUBLICKEYBLOB(EC_KEY *ec_key, ECCPUBLICKEYBLOB *blob)
{
int ret = 0;
int nbytes;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
BN_CTX *bn_ctx = NULL;
const EC_GROUP *group = EC_KEY_get0_group(ec_key);
const EC_POINT *point = EC_KEY_get0_public_key(ec_key);
nbytes = (EC_GROUP_get_degree(group) + 7)/8;
if (nbyte > ECC_MAX_MODULUS_BITS_LEN/8) {
goto end;
}
x = BN_new();
y = BN_new();
bn_ctx = BN_CTX_new();
if (!x || !y || !bn_ctx) {
goto end;
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, bn_ctx)) {
goto end;
}
} else {
if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x, y, bn_ctx)) {
goto end;
}
}
bzero(blob, sizeof(*blob));
blob->BitLen = EC_GROUP_get_degree(group);
if (!BN_bn2bin(x, blob->XCoordinate + nbytes - BN_num_bytes(x))) {
goto end;
}
if (!BN_bn2bin(y, blob->YCoordinate + nbytes - BN_num_bytes(y))) {
goto end;
}
ret = 1;
end:
BN_free(x);
BN_free(y);
BN_CTX_free(bn_ctx);
return ret;
}
int EC_KEY_set_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, const ECCPRIVATEKEYBLOB *blob)
{
int ret = 0;
int nbytes;
BIGNUM *d = NULL;
/* is this corrent ?
* because the key length sometimes will be less than field length
*/
if (blob->BitLen != EC_GROUP_get_degree(EC_KEY_get0_group(ec_key))) {
goto end;
}
nbytes = (blob->BitLen + 7)/8;
if (!(d = BN_bin2bn(data->PrivateKey, nbytes, NULL))) {
goto end;
}
if (!EC_KEY_set_private_key(ec_key, d)) {
goto end;
}
ret = 1;
end:
BN_clear_free(d);
return ret;
}
int EC_KEY_get_ECCPRIVATEKEYBLOB(EC_KEY *ec_key, ECCPRIVATEKEYBLOB *blob)
{
int ret = 0;
int nbytes;
BIGNUM *order = BN_new();
BIGNUM *d = EC_KEY_get0_private_key(ec_key);
if (!order) {
goto end;
}
if (!d) {
goto end;
}
if (!EC_GROUP_get_order(EC_KEY_get0_group(ec_key), order, NULL)) {
goto end;
}
nbytes = BN_num_bytes(order);
if (nbytes > ECC_MAX_MODULUS_BITS_LEN/8) {
goto end;
}
BN_bn2bin(d, blob->PrivateKey + nbytes - BN_num_bytes(d));
ret = 1;
end:
BN_free(order);
return ret;
}
int SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB(SM2_CIPHERTEXT_VALUE *cv,
const ECCCIPHERBLOB *blob)
{
SM2_CIPHERTEXT_VALUE *ret = NULL;
const ECCCIPHERBLOB *data = (const ECCCIPHERBLOB *)blob;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
if (bloblen < sizeof(ECCCIPHERBLOB)) {
goto end;
}
if (!(ret = OPENSSL_malloc(sizeof(SM2_CIPHERTEXT_VALUE)))) {
goto end;
}
}
int SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB(const SM2_CIPHERTEXT_VALUE *a,
void *out, size_t *outlen)
{
int ret = 0;
BIGNUM *x = NULL;
BIGNUM *y = NULL;
return 0;
}
ECDSA_SIG *ECDSA_SIG_new_from_SKF_ECCSIGNATUREBLOB(
const EC_GROUP *group, const void *blob, size_t bloblen)
{
ECDSA_SIG *ret = NULL;
int bnlen;
const ECCSIGNATUREBLOB *data = blob;
if (bloblen != sizeof(ECCSIGNATUREBLOB)) {
return NULL;
}
bnlen = (EC_GROUP_get_degree(group) + 7)/8;
if (!(ret = ECDSA_SIG_new())) {
return NULL;
}
ret->r = BN_bin2bn(data->r, bnlen, NULL);
ret->s = BN_bin2bn(data->s, bnlen, NULL);
return ret;
}
int ECDSA_SIG_to_SKF_ECCSIGNATUREBLOB(const ECDSA_SIG *sig,
const EC_GROUP *group, void *out, size_t *outlen)
{
int bnlen;
ECCSIGNATUREBLOB *data = out;
if (!out) {
if (!outlen) {
return 0;
}
*outlen = sizeof(ECCSIGNATUREBLOB);
return 1;
}
bnlen = (EC_GROUP_get_degree(group) + 7)/8;
*outlen = sizeof(ECCSIGNATUREBLOB);
BN_bn2bin(sig->r, data->r + bnlen - BN_num_bytes(sig->r));
BN_bn2bin(sig->s, data->s + bnlen - BN_num_bytes(sig->s));
return 1;
}
int RSA_set_RSAPUBLICKEYBLOB(RSA *rsa, const RSAPUBLICKEYBLOB *blob)
{
int ret = 0;
if (!(rsa->n = BN_bin2bn(blob->Modulus, blob->BitLen/8, NULL))) {
goto end;
}
if (!(rsa->e = BN_bin2bn(blob->PublicExponent, blob->BitLen/8, NULL))) {
goto end;
}
if (!RSA_check_key(rsa)) {
goto end;
}
end:
return ret;
}
int RSA_get_RSAPUBLICKEYBLOB(RSA *rsa, RSAPUBLICKEYBLOB *blob)
{
int ret = 0;
int nbytes;
if (!rsa->n || !rsa->e) {
goto end;
}
nbytes = BN_num_bytes(rsa->n);
BN_bn2bin(rsa->n, blob->Modulus + bnlen - BN_num_bytes(rsa->n));
BN_bn2bin(rsa->e, blob->PublicExponent + bnlen - BN_num_bytes(rsa->e));
return ret;
}
int RSA_set_RSAPRIVATEKEYBLOB(RSA *rsa, const RSAPRIVATEKEYBLOB *blob)
{
int ret = 0;
if (!blob->AlgID) {
goto end;
}
if (!blob->BitLen) {
goto end;
}
rsa->n = BN_bin2bn(blob->Modulus, MAX_RSA_MODULUS_LEN, NULL);
rsa->e = BN_bin2bn(blob->PublicExponent, MAX_RSA_EXPONENT_LEN, NULL);
rsa->d = BN_bin2bn(blob->Prime1, bnlen, NULL);
rsa->p = BN_bin2bn(blob->Prime2, bnlen, NULL);
rsa->dmp1 = BN_bin2bn(blob->Prime1Exponent, bnlen, NULL);
rsa->dmq1 = BN_bin2bn(blob->Prime2Exponent, bnlen, NULL);
rsa->iqmp = BN_bin2bn(blob->Coefficient, bnlen, NULL);
}
int RSA_get_RSAPRIVATEKEYBLOB(RSA *rsa, RSAPRIVATEKEYBLOB *blob)
{
int ret = 0;
RSAPRIVATEKEYBLOB *blob = out;
return ret;
}

View File

@@ -1,260 +0,0 @@
/* engines/skf/skftest.c */
/* ====================================================================
* Copyright (c) 2015-2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "skf.h"
#define AUTH_RAND_LEN 16
#define AUTH_DATA_LEN 16
#define AUTH_KEY_LEN 16
int main(int argc, char **argv)
{
ULONG rv;
BYTE buf[2048];
ULONG len;
BOOL bPresent = TRUE;
CHAR devNameList[256];
LPSTR devName;
DEVHANDLE hDev = NULL;
ULONG devState;
char *devStateStr;
DEVINFO devInfo;
BYTE authRand[AUTH_RAND_LEN];
BYTE authData[AUTH_DATA_LEN];
BYTE authKey[AUTH_KEY_LEN];
BLOCKCIPHERPARAM authParam;
HANDLE hAuthKey = NULL;
CHAR appNameList[256];
LPSTR appName;
HAPPLICATION hApp = NULL;
CHAR containerNameList[256];
LPSTR containerName;
HCONTAINER hContainer = NULL;
ULONG containerType;
char *containerTypeStr;
BYTE dgst[32];
ULONG dgstLen = sizeof(dgst);
ECCSIGNATUREBLOB sigblob;
len = sizeof(devNameList);
if ((rv = SKF_EnumDev(bPresent, devNameList, &len)) != SAR_OK) {
goto end;
}
devName = devNameList;
printf("Device Name : %s\n", devName);
if ((rv = SKF_GetDevState(devName, &devState)) != SAR_OK) {
goto end;
}
switch (devState) {
case DEV_ABSENT_STATE:
devStateStr = "DEV_ABSENT_STATE";
break;
case DEV_PRESENT_STATE:
devStateStr = "DEV_PRESENT_STATE";
break;
case DEV_UNKNOW_STATE:
devStateStr = "DEV_UNKNOW_STATE";
break;
default:
devStateStr = "(undefined)";
}
printf("Device State: %s\n", devStateStr);
if ((rv = SKF_ConnectDev(devName, &hDev)) != SAR_OK) {
goto end;
}
if ((rv = SKF_GetDevInfo(hDev, &devInfo)) != SAR_OK) {
goto end;
}
printf("Device Info:\n");
printf(" Device Version : %d.%d\n", devInfo.Version.major, devInfo.Version.minor);
printf(" Manufacturer : %s\n", devInfo.Manufacturer);
printf(" Issuer : %s\n", devInfo.Issuer);
printf(" Label : %s\n", devInfo.Label);
printf(" Serial Number : %s\n", devInfo.SerialNumber);
printf(" Hardware Version : %d.%d\n", devInfo.HWVersion.major, devInfo.HWVersion.minor);
printf(" Firmware Version : %d.%d\n", devInfo.FirmwareVersion.major, devInfo.FirmwareVersion.minor);
printf(" AlgSymCap : 0x%08x\n", devInfo.AlgSymCap);
printf(" AlgAsymCap : 0x%08x\n", devInfo.AlgAsymCap);
printf(" AlgHashCap : 0x%08x\n", devInfo.AlgHashCap);
printf(" AlgHashCap : 0x%08x\n", devInfo.DevAuthAlgId);
printf(" Total Space : %u\n", devInfo.TotalSpace);
printf(" Free Space : %u\n", devInfo.FreeSpace);
printf(" MaxECCBuffer : %u\n", devInfo.MaxECCBufferSize);
printf(" MaxBuffer : %u\n", devInfo.MaxBufferSize);
/* Device Authentication */
if ((rv = SKF_GenRandom(hDev, authRand, sizeof(authRand))) != SAR_OK) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
if ((rv = SKF_SetSymmKey(hDev, authKey, devInfo.DevAuthAlgId, &hAuthKey)) != SAR_OK) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
bzero(&authParam, sizeof(authParam));
if ((rv = SKF_EncryptInit(hAuthKey, authParam)) != SAR_OK) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
if ((rv = SKF_Encrypt(hAuthKey, authRand, sizeof(authRand), authData, &len)) != SAR_OK) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
if ((rv = SKF_DevAuth(hDev, authData, len)) != SAR_OK) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
printf("Device Authentication Passed.\n");
/* Open Application */
len = sizeof(appNameList);
if ((rv = SKF_EnumApplication(hDev, appNameList, &len)) != SAR_OK) {
goto end;
}
appName = appNameList;
printf("Application Name : %s\n", appName);
if ((rv = SKF_OpenApplication(hDev, appName, &hApp)) != SAR_OK) {
goto end;
}
/* Open Containter */
len = sizeof(containerNameList);
if ((rv = SKF_EnumContainer(hApp, containerNameList, &len)) != SAR_OK) {
goto end;
}
containerName = containerNameList;
printf("Container Name: %s\n", containerName);
if ((rv = SKF_OpenContainer(hApp, containerName, &hContainer)) != SAR_OK) {
goto end;
}
if ((rv = SKF_GetContainerType(hContainer, &containerType)) != SAR_OK) {
goto end;
}
switch (containerType) {
case CONTAINER_TYPE_UNDEF:
containerTypeStr = "Undef";
break;
case CONTAINER_TYPE_RSA:
containerTypeStr = "RSA";
break;
case CONTAINER_TYPE_ECC:
containerTypeStr = "ECC";
break;
default:
containerTypeStr = "(error)";
}
printf("Container Type: %s\n", containerTypeStr);
/* Sign */
if ((rv = SKF_ECCSignData(hContainer, dgst, dgstLen, &sigblob)) != SAR_OK) {
goto end;
}
/* Export Signing Public Key */
if ((rv = SKF_ExportPublicKey(hContainer, TRUE, buf, &len)) != SAR_OK) {
goto end;
}
printf("Success\n");
end:
//SKF_CloseContainer(hContainer);
//SKF_CloseApplication(hApp);
return 0;
}
int open_container(const char *dev, const char *app, const char *container,
const unsigned char *authkey, size_t authkeylen)
{
DEVHANDLE hDev = NULL;
DEVINFO devInfo;
HAPPLICATION hApp = NULL;
HCONTAINER hContainer = NULL;
return 0;
}

81
crypto/sm1/Makefile Normal file
View File

@@ -0,0 +1,81 @@
#
# OpenSSL/crypto/sm1/Makefile
#
DIR= sm1
TOP= ../..
CC= cc
CPP= $(CC) -E
INCLUDES=-I.. -I$(TOP) -I../../include
CFLAG=-g
MAKEFILE= Makefile
AR= ar r
SM3_ASM_OBJ=
CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
GENERAL=Makefile
TEST=
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=
LIBOBJ=
SRC= $(LIBSRC)
EXHEADER= sm1.h
HEADER= $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
@touch lib
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.

View File

@@ -54,6 +54,7 @@
#define SM1_KEY_LENGTH 16
#define SM1_BLOCK_SIZE 16
#define SM1_IV_LENGTH (SM1_BLOCK_SIZE)
#ifdef __cplusplus
extern "C" {

View File

@@ -1,54 +0,0 @@
#include <stdio.h>
#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/assert.h>
int main(int argc, char **argv)
{
const char *engine_id = "SKF";
ENGINE *engine = NULL;
const EVP_CIPHER *cipher;
EVP_CIPHER_CTX ctx;
unsigned char key[16];
unsigned char iv[16];
const char *msg1 = "hello world";
const char *msg2 = "12345678";
unsigned char buf[128];
int len;
ENGINE_load_builtin_engines();
engine = ENGINE_by_id(engine_id);
OPENSSL_assert(engine != NULL);
rv = ENGINE_init(engine);
OPENSSL_assert(rv == 1);
cipher = ENGINE_get_cipher(engine, NID_sm1_cbc);
EVP_CIPHER_CTX_init(&ctx);
rv = RAND_bytes(key, (int)sizeof(key));
rv = RAND_bytes(iv, (int)sizeof(iv));
rv = EVP_EncryptInit_ex(&ctx, cipher, engine, key, iv);
p = buf;
rv = EVP_EncryptUpdate(&ctx, p, &len, (unsigned char *)msg1, (int)strlen(msg1));
p += len;
rv = EVP_EncryptUpdate(&ctx, p, &len, (unsigned char *)msg2, (int)strlen(msg2));
p += len;
rv = EVP_EncryptFinal_ex(&ctx, p, &len);
p += len;
EVP_CIPHER_CTX_cleanup(&ctx);
ENGINE_finish(engine);
ENGINE_free(engine);
return 0;
}

View File

@@ -76,3 +76,90 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
sm2_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h
sm2_asn1.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
sm2_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sm2_asn1.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
sm2_asn1.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
sm2_asn1.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
sm2_asn1.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
sm2_asn1.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
sm2_asn1.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sm2_asn1.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
sm2_asn1.o: ../../include/openssl/sha.h ../../include/openssl/sm2.h
sm2_asn1.o: ../../include/openssl/sm3.h ../../include/openssl/stack.h
sm2_asn1.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
sm2_asn1.o: ../../include/openssl/x509_vfy.h sm2_asn1.c
sm2_enc.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm2_enc.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
sm2_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sm2_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
sm2_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
sm2_enc.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
sm2_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
sm2_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
sm2_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sm2_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
sm2_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sm2_enc.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
sm2_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm2_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h sm2.h
sm2_enc.o: sm2_enc.c
sm2_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm2_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
sm2_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
sm2_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
sm2_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
sm2_err.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
sm2_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
sm2_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
sm2_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
sm2_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sm2_err.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
sm2_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm2_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
sm2_err.o: sm2_err.c
sm2_kap.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm2_kap.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
sm2_kap.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
sm2_kap.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
sm2_kap.o: ../../include/openssl/err.h ../../include/openssl/evp.h
sm2_kap.o: ../../include/openssl/kdf.h ../../include/openssl/lhash.h
sm2_kap.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
sm2_kap.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
sm2_kap.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
sm2_kap.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sm2_kap.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
sm2_kap.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm2_kap.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h sm2.h
sm2_kap.o: sm2_kap.c
sm2_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm2_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
sm2_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sm2_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
sm2_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
sm2_lib.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
sm2_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
sm2_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
sm2_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sm2_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
sm2_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sm2_lib.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
sm2_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm2_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
sm2_lib.o: sm2_lib.c
sm2_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm2_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
sm2_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sm2_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
sm2_sign.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h
sm2_sign.o: ../../include/openssl/evp.h ../../include/openssl/kdf.h
sm2_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
sm2_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
sm2_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sm2_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
sm2_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sm2_sign.o: ../../include/openssl/sm2.h ../../include/openssl/sm3.h
sm2_sign.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm2_sign.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
sm2_sign.o: sm2_sign.c

View File

@@ -69,8 +69,8 @@ extern "C" {
#define SM2_MAX_ID_BITS 65535
#define SM2_MAX_ID_LENGTH (SM2_MAX_ID_BITS/8)
#define SM2_DEFAULT_ID_GMT09 "1234567812345678"
#define SM2_DEFAULT_ID_GMSSL "anonym@gmssl.org"
#define SM2_DEFAULT_ID_GMT09 "1234567812345678"
#define SM2_DEFAULT_ID_GMSSL "anonym@gmssl.org"
#define SM2_DEFAULT_ID SM2_DEFAULT_ID_GMSSL
#define SM2_DEFAULT_POINT_CONVERSION_FORM POINT_CONVERSION_UNCOMPRESSED
@@ -81,7 +81,6 @@ int SM2_compute_id_digest(const EVP_MD *md, unsigned char *dgst,
unsigned int *dgstlen, EC_KEY *ec_key);
typedef struct sm2_enc_params_st {
const EVP_MD *kdf_md;
const EVP_MD *mac_md;
@@ -92,6 +91,7 @@ typedef struct sm2_enc_params_st {
#define SM2_ENC_PARAMS_mactag_size(params) \
((params)->mactag_size<0 ? EVP_MD_size((params)->mac_md) : (params->mactag_size))
int SM2_ENC_PARAMS_init_with_recommended(SM2_ENC_PARAMS *params);
typedef struct sm2_ciphertext_value_st {
EC_POINT *ephem_point;
@@ -103,6 +103,8 @@ typedef struct sm2_ciphertext_value_st {
int SM2_CIPHERTEXT_VALUE_size(const EC_GROUP *ec_group,
const SM2_ENC_PARAMS *params, size_t mlen);
SM2_CIPHERTEXT_VALUE *SM2_CIPHERTEXT_VALUE_new(const EC_GROUP *group);
void SM2_CIPHERTEXT_VALUE_free(SM2_CIPHERTEXT_VALUE *cv);
int SM2_CIPHERTEXT_VALUE_encode(const SM2_CIPHERTEXT_VALUE *cv,
const EC_GROUP *ec_group, const SM2_ENC_PARAMS *params,
@@ -130,10 +132,12 @@ int SM2_encrypt_with_recommended(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen, EC_KEY *ec_key);
int SM2_decrypt_with_recommended(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen, EC_KEY *ec_key);
#if 0
int SM2_encrypt_elgamal(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen, EC_KEY *ec_key);
int SM2_decrypt_elgamal(unsigned char *out, size_t *outlen,
const unsigned char *in, size_t inlen, EC_KEY *ec_key);
#endif
int SM2_compute_message_digest(const EVP_MD *id_md, const EVP_MD *msg_md,
const void *msg, size_t msglen, unsigned char *dgst,
@@ -169,14 +173,14 @@ typedef struct sm2_kap_ctx_st {
const EVP_MD *checksum_md;
point_conversion_form_t point_form;
KDF_FUNC kdf;
int is_initiator;
int do_checksum;
EC_KEY *ec_key;
unsigned char id_dgst[EVP_MAX_MD_SIZE];
unsigned int id_dgstlen;
EC_KEY *remote_pubkey;
unsigned char remote_id_dgst[EVP_MAX_MD_SIZE];
unsigned int remote_id_dgstlen;
@@ -185,7 +189,7 @@ typedef struct sm2_kap_ctx_st {
BN_CTX *bn_ctx;
BIGNUM *order;
BIGNUM *two_pow_w;
BIGNUM *t;
EC_POINT *point;
unsigned char pt_buf[1 + (OPENSSL_ECC_MAX_FIELD_BITS+7)/4];
@@ -207,54 +211,60 @@ int SM2_KAP_final_check(SM2_KAP_CTX *ctx, const unsigned char *checksum,
void SM2_KAP_CTX_cleanup(SM2_KAP_CTX *ctx);
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_SM2_strings(void);
/* Function codes. */
#define SM2_F_SM2_SET_ID 100
#define SM2_F_SM2_GET_ID 101
#define SM2_F_SM2_COMPUTE_ID_DIGEST 102
#define SM2_F_SM2_CIPHERTEXT_VALUE_SIZE 103
#define SM2_F_SM2_CIPHERTEXT_VALUE_FREE 104
#define SM2_F_SM2_CIPHERTEXT_VALUE_ENCODE 105
#define SM2_F_SM2_CIPHERTEXT_VALUE_DECODE 106
#define SM2_F_SM2_CIPHERTEXT_VALUE_PRINT 107
#define SM2_F_SM2_DO_ENCRYPT 108
#define SM2_F_SM2_DO_DECRYPT 109
#define SM2_F_SM2_ENCRYPT 110
#define SM2_F_SM2_DECRYPT 111
#define SM2_F_SM2_SIGNATURE_SIZE 112
#define SM2_F_SM2_SIGN_SETUP 113
#define SM2_F_SM2_DO_SIGN_EX 114
#define SM2_F_SM2_DO_SIGN 115
#define SM2_F_SM2_DO_VERIFY 116
#define SM2_F_SM2_SIGN_EX 117
#define SM2_F_SM2_SIGN 118
#define SM2_F_SM2_VERIFY 119
#define SM2_F_SM2_KAP_CTX_INIT 120
#define SM2_F_SM2_KAP_CTX_CLEANUP 121
#define SM2_F_SM2_KAP_PREPARE 122
#define SM2_F_SM2_KAP_COMPUTE_KEY 123
#define SM2_F_SM2_KAP_FINAL_CHECK 124
/* Error codes for the SM2 functions. */
/* Function codes. */
# define SM2_F_SM2_CIPHERTEXT_VALUE_DECODE 100
# define SM2_F_SM2_CIPHERTEXT_VALUE_ENCODE 101
# define SM2_F_SM2_CIPHERTEXT_VALUE_FREE 102
# define SM2_F_SM2_CIPHERTEXT_VALUE_PRINT 103
# define SM2_F_SM2_CIPHERTEXT_VALUE_SIZE 104
# define SM2_F_SM2_COMPUTE_ID_DIGEST 105
# define SM2_F_SM2_DECRYPT 106
# define SM2_F_SM2_DO_DECRYPT 107
# define SM2_F_SM2_DO_ENCRYPT 108
# define SM2_F_SM2_DO_SIGN 109
# define SM2_F_SM2_DO_SIGN_EX 110
# define SM2_F_SM2_DO_VERIFY 111
# define SM2_F_SM2_ENCRYPT 112
# define SM2_F_SM2_GET_ID 113
# define SM2_F_SM2_KAP_COMPUTE_KEY 114
# define SM2_F_SM2_KAP_CTX_CLEANUP 115
# define SM2_F_SM2_KAP_CTX_INIT 116
# define SM2_F_SM2_KAP_FINAL_CHECK 117
# define SM2_F_SM2_KAP_PREPARE 118
# define SM2_F_SM2_SET_ID 119
# define SM2_F_SM2_SIGN 120
# define SM2_F_SM2_SIGNATURE_SIZE 121
# define SM2_F_SM2_SIGN_EX 122
# define SM2_F_SM2_SIGN_SETUP 123
# define SM2_F_SM2_VERIFY 124
/* Reason codes. */
#define SM2_R_BAD_DATA 100
#define SM2_R_UNKNOWN_CIPHER_TYPE 101
#define SM2_R_ENCRYPT_FAILED 102
#define SM2_R_DECRYPT_FAILED 103
#define SM2_R_UNKNOWN_MAC_TYPE 104
#define SM2_R_GEN_MAC_FAILED 105
#define SM2_R_VERIFY_MAC_FAILED 106
#define SM2_R_ECDH_FAILED 107
#define SM2_R_BUFFER_TOO_SMALL 108
#define SM2_R_SM2_KAP_NOT_INITED 109
#define SM2_R_RANDOM_NUMBER_GENERATION_FAILED 110
#define SM2_R_ERROR 111
# define SM2_R_BAD_DATA 100
# define SM2_R_BAD_SIGNATURE 101
# define SM2_R_BUFFER_TOO_SMALL 102
# define SM2_R_DECRYPT_FAILED 103
# define SM2_R_ECDH_FAILED 104
# define SM2_R_ENCRYPT_FAILED 105
# define SM2_R_ERROR 106
# define SM2_R_GEN_MAC_FAILED 107
# define SM2_R_MISSING_PARAMETERS 108
# define SM2_R_NEED_NEW_SETUP_VALUES 109
# define SM2_R_RANDOM_NUMBER_GENERATION_FAILED 110
# define SM2_R_SM2_KAP_NOT_INITED 111
# define SM2_R_UNKNOWN_CIPHER_TYPE 112
# define SM2_R_UNKNOWN_MAC_TYPE 113
# define SM2_R_VERIFY_MAC_FAILED 114
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -95,6 +95,11 @@ end:
return ret;
}
SM2_CIPHERTEXT_VALUE *SM2_CIPHERTEXT_VALUE_new(const EC_GROUP *group)
{
return NULL;
}
void SM2_CIPHERTEXT_VALUE_free(SM2_CIPHERTEXT_VALUE *cv)
{
if (cv->ephem_point) EC_POINT_free(cv->ephem_point);
@@ -631,7 +636,7 @@ int SM2_do_decrypt(const SM2_ENC_PARAMS *params,
goto end;
}
if (cv->mactag_size != mactag_size ||
memcmp(mac, cv->mactag, cv->mactag_size)) {
OPENSSL_memcmp(mac, cv->mactag, cv->mactag_size)) {
SM2err(SM2_F_SM2_DO_DECRYPT, SM2_R_ERROR);
goto end;
}

View File

@@ -1,6 +1,6 @@
/* crypto/sm2/sm2_err.c */
/* ====================================================================
* Copyright (c) 2015 The GmSSL Project. All rights reserved.
* Copyright (c) 1999-2016 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
@@ -16,27 +16,27 @@
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the GmSSL Project.
* (http://gmssl.org/)"
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
* 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 "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
* 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 GmSSL Project
* (http://gmssl.org/)"
* "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 GmSSL PROJECT ``AS IS'' AND ANY
* 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 GmSSL PROJECT OR
* 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;
@@ -47,62 +47,77 @@
* 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include "sm2.h"
#include <openssl/sm2.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECIES,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECIES,0,reason)
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_SM2,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_SM2,0,reason)
static ERR_STRING_DATA SM2_str_functs[] = {
{ERR_FUNC(SM2_F_SM2_SET_ID), "SM2_SET_ID"},
{ERR_FUNC(SM2_F_SM2_GET_ID), "SM2_F_SM2_GET_ID"},
{ERR_FUNC(SM2_F_SM2_COMPUTE_ID_DIGEST), "SM2_compute_id_digest"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_SIZE), "SM2_CIPHERTEXT_VALUE_size"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_FREE), "SM2_CIPHERTEXT_VALUE_free"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_ENCODE), "SM2_CIPHERTEXT_VALUE_encode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_DECODE), "SM2_CIPHERTEXT_VALUE_decode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_PRINT), "SM2_CIPHERTEXT_VALUE_print"},
{ERR_FUNC(SM2_F_SM2_DO_ENCRYPT), "SM2_do_encrypt"},
{ERR_FUNC(SM2_F_SM2_DO_DECRYPT), "SM2_do_decrypt"},
{ERR_FUNC(SM2_F_SM2_ENCRYPT), "SM2_encrypt"},
{ERR_FUNC(SM2_F_SM2_DECRYPT), "SM2_decrypt"},
{ERR_FUNC(SM2_F_SM2_SIGNATURE_SIZE), "SM2_signature_size"},
{ERR_FUNC(SM2_F_SM2_SIGN_SETUP), "SM2_sign_setup"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN_EX), "SM2_do_sign_ex"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN), "SM2_do_sign"},
{ERR_FUNC(SM2_F_SM2_DO_VERIFY), "SM2_do_verify"},
{ERR_FUNC(SM2_F_SM2_SIGN_EX), "SM2_sign_ex"},
{ERR_FUNC(SM2_F_SM2_SIGN), "SM2_sign"},
{ERR_FUNC(SM2_F_SM2_VERIFY), "SM2_verify"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_INIT), "SM2_KAP_CTX_init"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_CLEANUP), "SM2_KAP_CTX_cleanup"},
{ERR_FUNC(SM2_F_SM2_KAP_PREPARE), "SM2_KAP_prepare"},
{ERR_FUNC(SM2_F_SM2_KAP_COMPUTE_KEY), "SM2_KAP_compute_key"},
{ERR_FUNC(SM2_F_SM2_KAP_FINAL_CHECK), "SM2_KAP_final_check"},
{0,NULL}
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_DECODE),
"SM2_CIPHERTEXT_VALUE_decode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_ENCODE),
"SM2_CIPHERTEXT_VALUE_encode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_FREE), "SM2_CIPHERTEXT_VALUE_free"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_PRINT), "SM2_CIPHERTEXT_VALUE_print"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_SIZE), "SM2_CIPHERTEXT_VALUE_size"},
{ERR_FUNC(SM2_F_SM2_COMPUTE_ID_DIGEST), "SM2_compute_id_digest"},
{ERR_FUNC(SM2_F_SM2_DECRYPT), "SM2_decrypt"},
{ERR_FUNC(SM2_F_SM2_DO_DECRYPT), "SM2_do_decrypt"},
{ERR_FUNC(SM2_F_SM2_DO_ENCRYPT), "SM2_do_encrypt"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN), "SM2_do_sign"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN_EX), "SM2_do_sign_ex"},
{ERR_FUNC(SM2_F_SM2_DO_VERIFY), "SM2_do_verify"},
{ERR_FUNC(SM2_F_SM2_ENCRYPT), "SM2_encrypt"},
{ERR_FUNC(SM2_F_SM2_GET_ID), "SM2_GET_ID"},
{ERR_FUNC(SM2_F_SM2_KAP_COMPUTE_KEY), "SM2_KAP_compute_key"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_CLEANUP), "SM2_KAP_CTX_cleanup"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_INIT), "SM2_KAP_CTX_init"},
{ERR_FUNC(SM2_F_SM2_KAP_FINAL_CHECK), "SM2_KAP_final_check"},
{ERR_FUNC(SM2_F_SM2_KAP_PREPARE), "SM2_KAP_prepare"},
{ERR_FUNC(SM2_F_SM2_SET_ID), "SM2_set_id"},
{ERR_FUNC(SM2_F_SM2_SIGN), "SM2_sign"},
{ERR_FUNC(SM2_F_SM2_SIGNATURE_SIZE), "SM2_SIGNATURE_SIZE"},
{ERR_FUNC(SM2_F_SM2_SIGN_EX), "SM2_sign_ex"},
{ERR_FUNC(SM2_F_SM2_SIGN_SETUP), "SM2_sign_setup"},
{ERR_FUNC(SM2_F_SM2_VERIFY), "SM2_verify"},
{0, NULL}
};
static ERR_STRING_DATA SM2_str_reasons[] = {
{ERR_REASON(SM2_R_BAD_DATA), "bad data"},
{ERR_REASON(SM2_R_UNKNOWN_CIPHER_TYPE), "unknown cipher type"},
{ERR_REASON(SM2_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(SM2_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(SM2_R_UNKNOWN_MAC_TYPE), "unknown MAC type"},
{ERR_REASON(SM2_R_GEN_MAC_FAILED), "MAC generation failed"},
{ERR_REASON(SM2_R_VERIFY_MAC_FAILED), "MAC verification failed"},
{ERR_REASON(SM2_R_ECDH_FAILED), "ECDH failed"},
{ERR_REASON(SM2_R_BUFFER_TOO_SMALL), "buffer too small"},
{ERR_REASON(SM2_R_SM2_KAP_NOT_INITED), "KAP not inited"},
{ERR_REASON(SM2_R_RANDOM_NUMBER_GENERATION_FAILED), "random number generation failed"},
{ERR_REASON(SM2_R_ERROR), "Error"},
{0,NULL}
{ERR_REASON(SM2_R_BAD_DATA), "bad data"},
{ERR_REASON(SM2_R_BAD_SIGNATURE), "bad signature"},
{ERR_REASON(SM2_R_BUFFER_TOO_SMALL), "buffer too small"},
{ERR_REASON(SM2_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(SM2_R_ECDH_FAILED), "ecdh failed"},
{ERR_REASON(SM2_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(SM2_R_ERROR), "error"},
{ERR_REASON(SM2_R_GEN_MAC_FAILED), "gen mac failed"},
{ERR_REASON(SM2_R_MISSING_PARAMETERS), "missing parameters"},
{ERR_REASON(SM2_R_NEED_NEW_SETUP_VALUES), "need new setup values"},
{ERR_REASON(SM2_R_RANDOM_NUMBER_GENERATION_FAILED),
"random number generation failed"},
{ERR_REASON(SM2_R_SM2_KAP_NOT_INITED), "sm2 kap not inited"},
{ERR_REASON(SM2_R_UNKNOWN_CIPHER_TYPE), "unknown cipher type"},
{ERR_REASON(SM2_R_UNKNOWN_MAC_TYPE), "unknown mac type"},
{ERR_REASON(SM2_R_VERIFY_MAC_FAILED), "verify mac failed"},
{0, NULL}
};
#endif
@@ -111,9 +126,9 @@ void ERR_load_SM2_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SM2_str_functs[0].error) == NULL) {
ERR_load_strings(0,SM2_str_functs);
ERR_load_strings(0,SM2_str_reasons);
}
if (ERR_func_error_string(SM2_str_functs[0].error) == NULL) {
ERR_load_strings(0, SM2_str_functs);
ERR_load_strings(0, SM2_str_reasons);
}
#endif
}

119
crypto/sm2/sm2_err2.c Normal file
View File

@@ -0,0 +1,119 @@
/* crypto/sm2/sm2_err.c */
/* ====================================================================
* Copyright (c) 2015 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <stdio.h>
#include <openssl/err.h>
#include "sm2.h"
#ifndef OPENSSL_NO_ERR
#define ERR_FUNC(func) ERR_PACK(ERR_LIB_ECIES,func,0)
#define ERR_REASON(reason) ERR_PACK(ERR_LIB_ECIES,0,reason)
static ERR_STRING_DATA SM2_str_functs[] = {
{ERR_FUNC(SM2_F_SM2_SET_ID), "SM2_SET_ID"},
{ERR_FUNC(SM2_F_SM2_GET_ID), "SM2_F_SM2_GET_ID"},
{ERR_FUNC(SM2_F_SM2_COMPUTE_ID_DIGEST), "SM2_compute_id_digest"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_SIZE), "SM2_CIPHERTEXT_VALUE_size"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_FREE), "SM2_CIPHERTEXT_VALUE_free"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_ENCODE), "SM2_CIPHERTEXT_VALUE_encode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_DECODE), "SM2_CIPHERTEXT_VALUE_decode"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_VALUE_PRINT), "SM2_CIPHERTEXT_VALUE_print"},
{ERR_FUNC(SM2_F_SM2_DO_ENCRYPT), "SM2_do_encrypt"},
{ERR_FUNC(SM2_F_SM2_DO_DECRYPT), "SM2_do_decrypt"},
{ERR_FUNC(SM2_F_SM2_ENCRYPT), "SM2_encrypt"},
{ERR_FUNC(SM2_F_SM2_DECRYPT), "SM2_decrypt"},
{ERR_FUNC(SM2_F_SM2_SIGNATURE_SIZE), "SM2_signature_size"},
{ERR_FUNC(SM2_F_SM2_SIGN_SETUP), "SM2_sign_setup"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN_EX), "SM2_do_sign_ex"},
{ERR_FUNC(SM2_F_SM2_DO_SIGN), "SM2_do_sign"},
{ERR_FUNC(SM2_F_SM2_DO_VERIFY), "SM2_do_verify"},
{ERR_FUNC(SM2_F_SM2_SIGN_EX), "SM2_sign_ex"},
{ERR_FUNC(SM2_F_SM2_SIGN), "SM2_sign"},
{ERR_FUNC(SM2_F_SM2_VERIFY), "SM2_verify"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_INIT), "SM2_KAP_CTX_init"},
{ERR_FUNC(SM2_F_SM2_KAP_CTX_CLEANUP), "SM2_KAP_CTX_cleanup"},
{ERR_FUNC(SM2_F_SM2_KAP_PREPARE), "SM2_KAP_prepare"},
{ERR_FUNC(SM2_F_SM2_KAP_COMPUTE_KEY), "SM2_KAP_compute_key"},
{ERR_FUNC(SM2_F_SM2_KAP_FINAL_CHECK), "SM2_KAP_final_check"},
{0,NULL}
};
static ERR_STRING_DATA SM2_str_reasons[] = {
{ERR_REASON(SM2_R_BAD_DATA), "bad data"},
{ERR_REASON(SM2_R_UNKNOWN_CIPHER_TYPE), "unknown cipher type"},
{ERR_REASON(SM2_R_ENCRYPT_FAILED), "encrypt failed"},
{ERR_REASON(SM2_R_DECRYPT_FAILED), "decrypt failed"},
{ERR_REASON(SM2_R_UNKNOWN_MAC_TYPE), "unknown MAC type"},
{ERR_REASON(SM2_R_GEN_MAC_FAILED), "MAC generation failed"},
{ERR_REASON(SM2_R_VERIFY_MAC_FAILED), "MAC verification failed"},
{ERR_REASON(SM2_R_ECDH_FAILED), "ECDH failed"},
{ERR_REASON(SM2_R_BUFFER_TOO_SMALL), "buffer too small"},
{ERR_REASON(SM2_R_SM2_KAP_NOT_INITED), "KAP not inited"},
{ERR_REASON(SM2_R_RANDOM_NUMBER_GENERATION_FAILED), "random number generation failed"},
{ERR_REASON(SM2_R_ERROR), "Error"},
{0,NULL}
};
#endif
void ERR_load_SM2_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SM2_str_functs[0].error) == NULL) {
ERR_load_strings(0,SM2_str_functs);
ERR_load_strings(0,SM2_str_reasons);
}
#endif
}

View File

@@ -202,33 +202,27 @@ int SM2_update_public_key(EC_KEY *ec_key, const EC_POINT *pub_key)
if (EC_METHOD_get_field_type(EC_GROUP_method_of(group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(group, pub_key, x, NULL, bn_ctx)) {
SM2err(SM2_F_SM2_KAP_COMPUTE_KEY, ERR_R_EC_LIB);
goto end;
}
} else {
if (!EC_POINT_get_affine_coordinates_GF2m(group, pub_key, x, NULL, bn_ctx)) {
SM2err(SM2_F_SM2_KAP_COMPUTE_KEY, ERR_R_EC_LIB);
goto end;
}
}
if (!BN_nnmod(x, x, ctx->two_pow_w, bn_ctx)) {
SM2err(SM2_F_SM2_KAP_PREPARE, ERR_R_BN_LIB);
goto end;
}
if (!BN_add(x, x, ctx->two_pow_w)) {
SM2err(SM2_F_SM2_KAP_PREPARE, ERR_R_BN_LIB);
goto end;
}
if (!BN_mod_mul(ctx->t, x, r, ctx->order, ctx->bn_ctx)) {
SM2err(SM2_F_SM2_KAP_PREPARE, ERR_R_BN_LIB);
goto end;
}
if (!EC_POINT_mul(group, point, NULL, point, x, ctx->bn_ctx)) {
SM2err(SM2_F_SM2_KAP_COMPUTE_KEY, ERR_R_EC_LIB);
goto end;
}
@@ -648,12 +642,10 @@ int SM2_KAP_final_check(SM2_KAP_CTX *ctx, const unsigned char *checksum,
if (ctx->do_checksum) {
if (checksumlen != EVP_MD_size(ctx->checksum_md)) {
SM2err(SM2_F_SM2_KAP_FINAL_CHECK, 0);
return 0;
}
if (memcmp(ctx->checksum, checksum, checksumlen)) {
SM2err(SM2_F_SM2_KAP_COMPUTE_KEY, ERR_R_EC_LIB);
return 0;
}

View File

@@ -146,12 +146,10 @@ int sm2_get_public_key_data(unsigned char *buf, EC_KEY *ec_key)
if (EC_METHOD_get_field_type(EC_GROUP_method_of(ec_group)) == NID_X9_62_prime_field) {
if (!EC_GROUP_get_curve_GFp(ec_group, p, x, y, bn_ctx)) {
SM2err(SM2_F_SM2_KAP_PREPARE, ERR_R_EC_LIB);
goto err;
}
} else {
if (!EC_GROUP_get_curve_GF2m(ec_group, p, x, y, bn_ctx)) {
SM2err(SM2_F_SM2_KAP_PREPARE, ERR_R_EC_LIB);
goto err;
}
}

View File

@@ -58,7 +58,6 @@
#include <openssl/rand.h>
#include <openssl/sm2.h>
/* k in [1, n-1], (x, y) = kG */
static int sm2_sign_setup(EC_KEY *ec_key, BN_CTX *ctx_in, BIGNUM **kp, BIGNUM **xp)
{
@@ -71,13 +70,13 @@ static int sm2_sign_setup(EC_KEY *ec_key, BN_CTX *ctx_in, BIGNUM **kp, BIGNUM **
EC_POINT *point = NULL;
if (ec_key == NULL || (ec_group = EC_KEY_get0_group(ec_key)) == NULL) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_PASSED_NULL_PARAMETER);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_PASSED_NULL_PARAMETER);
return 0;
}
if (ctx_in == NULL) {
if ((ctx = BN_CTX_new()) == NULL) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP,ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_SIGN_SETUP,ERR_R_MALLOC_FAILURE);
return 0;
}
}
@@ -89,17 +88,17 @@ static int sm2_sign_setup(EC_KEY *ec_key, BN_CTX *ctx_in, BIGNUM **kp, BIGNUM **
x = BN_new();
order = BN_new();
if (!k || !x || !order) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_GROUP_get_order(ec_group, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_EC_LIB);
goto err;
}
if ((point = EC_POINT_new(ec_group)) == NULL) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_EC_LIB);
goto err;
}
@@ -107,8 +106,8 @@ static int sm2_sign_setup(EC_KEY *ec_key, BN_CTX *ctx_in, BIGNUM **kp, BIGNUM **
/* get random k */
do {
if (!BN_rand_range(k, order)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP,
ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED);
SM2err(SM2_F_SM2_SIGN_SETUP,
SM2_R_RANDOM_NUMBER_GENERATION_FAILED);
goto err;
}
@@ -116,25 +115,25 @@ static int sm2_sign_setup(EC_KEY *ec_key, BN_CTX *ctx_in, BIGNUM **kp, BIGNUM **
/* compute r the x-coordinate of generator * k */
if (!EC_POINT_mul(ec_group, point, k, NULL, NULL, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_EC_LIB);
goto err;
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(ec_group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(ec_group, point, x, NULL, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP,ERR_R_EC_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP,ERR_R_EC_LIB);
goto err;
}
} else /* NID_X9_62_characteristic_two_field */ {
if (!EC_POINT_get_affine_coordinates_GF2m(ec_group, point, x, NULL, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP,ERR_R_EC_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP,ERR_R_EC_LIB);
goto err;
}
}
//FIXME: do we need this?
if (!BN_nnmod(x, x, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_SIGN_SETUP, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_SIGN_SETUP, ERR_R_BN_LIB);
goto err;
}
@@ -181,12 +180,12 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
ec_group = EC_KEY_get0_group(ec_key);
priv_key = EC_KEY_get0_private_key(ec_key);
if (!ec_group || !priv_key) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_PASSED_NULL_PARAMETER);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
if (!(ret = ECDSA_SIG_new())) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_MALLOC_FAILURE);
return NULL;
}
@@ -195,11 +194,11 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
e = BN_new();
bn = BN_new();
if (!ctx || !order || !e || !bn) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_GROUP_get_order(ec_group, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_EC_LIB);
goto err;
}
@@ -211,13 +210,13 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
}
#endif
if (!BN_bin2bn(dgst, dgst_len, e)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
#if 0
if ((8 * dgst_len > i) && !BN_rshift(e, e, 8 - (i & 0x7))) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
#endif
@@ -226,14 +225,14 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
/* use or compute k and (kG).x */
if (!in_k || !in_x) {
if (!sm2_sign_setup(ec_key, ctx, &k, &ret->r)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN,ERR_R_ECDSA_LIB);
SM2err(SM2_F_SM2_DO_SIGN,ERR_R_ECDSA_LIB);
goto err;
}
ck = k;
} else {
ck = in_k;
if (!BN_copy(ret->r, in_x)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_MALLOC_FAILURE);
goto err;
}
}
@@ -241,20 +240,20 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
/* r = e + x (mod n) */
if (!BN_mod_add(ret->r, ret->r, e, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_add(bn, ret->r, ck, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
/* check r != 0 && r + k != n */
if (BN_is_zero(ret->r) || BN_is_zero(bn)) {
if (in_k && in_x) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ECDSA_R_NEED_NEW_SETUP_VALUES);
SM2err(SM2_F_SM2_DO_SIGN, SM2_R_NEED_NEW_SETUP_VALUES);
goto err;
} else
continue;
@@ -262,35 +261,35 @@ static ECDSA_SIG *sm2_do_sign(const unsigned char *dgst, int dgst_len,
/* s = ((1 + d)^-1 * (k - rd)) mod n */
if (!BN_one(bn)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_add(ret->s, priv_key, bn, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_inverse(ret->s, ret->s, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_mul(bn, ret->r, priv_key, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_sub(bn, ck, bn, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
if (!BN_mod_mul(ret->s, ret->s, bn, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_SIGN, ERR_R_BN_LIB);
goto err;
}
/* check s != 0 */
if (BN_is_zero(ret->s)) {
if (in_k && in_x) {
ECDSAerr(ECDSA_F_ECDSA_DO_SIGN, ECDSA_R_NEED_NEW_SETUP_VALUES);
SM2err(SM2_F_SM2_DO_SIGN, SM2_R_NEED_NEW_SETUP_VALUES);
goto err;
}
} else
@@ -331,7 +330,7 @@ int sm2_do_verify(const unsigned char *dgst, int dgstlen,
!(ec_group = EC_KEY_get0_group(ec_key)) ||
!(pub_key = EC_KEY_get0_public_key(ec_key))) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ECDSA_R_MISSING_PARAMETERS);
SM2err(SM2_F_SM2_DO_VERIFY, SM2_R_MISSING_PARAMETERS);
return -1;
}
@@ -341,11 +340,11 @@ int sm2_do_verify(const unsigned char *dgst, int dgstlen,
t = BN_new();
if (!ctx || !order || !e || !t) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_GROUP_get_order(ec_group, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_EC_LIB);
goto err;
}
@@ -357,14 +356,14 @@ int sm2_do_verify(const unsigned char *dgst, int dgstlen,
BN_is_negative(sig->s) ||
BN_ucmp(sig->s, order) >= 0) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ECDSA_R_BAD_SIGNATURE);
SM2err(SM2_F_SM2_DO_VERIFY, SM2_R_BAD_SIGNATURE);
ret = 0;
goto err;
}
/* check t = r + s != 0 */
if (!BN_mod_add(t, sig->r, sig->s, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_BN_LIB);
goto err;
}
if (BN_is_zero(t)) {
@@ -380,44 +379,44 @@ int sm2_do_verify(const unsigned char *dgst, int dgstlen,
}
#endif
if (!BN_bin2bn(dgst, dgstlen, e)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_BN_LIB);
goto err;
}
#if 0
if ((8 * dgstlen > i) && !BN_rshift(e, e, 8 - (i & 0x7))) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_BN_LIB);
goto err;
}
#endif
/* compute (x, y) = sG + tP, P is pub_key */
if (!(point = EC_POINT_new(ec_group))) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_MALLOC_FAILURE);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_MALLOC_FAILURE);
goto err;
}
if (!EC_POINT_mul(ec_group, point, sig->s, pub_key, t, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_EC_LIB);
goto err;
}
if (EC_METHOD_get_field_type(EC_GROUP_method_of(ec_group)) == NID_X9_62_prime_field) {
if (!EC_POINT_get_affine_coordinates_GFp(ec_group, point, t, NULL, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_EC_LIB);
goto err;
}
} else /* NID_X9_62_characteristic_two_field */ {
if (!EC_POINT_get_affine_coordinates_GF2m(ec_group, point, t, NULL, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_EC_LIB);
goto err;
}
}
if (!BN_nnmod(t, t, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_BN_LIB);
goto err;
}
/* check (sG + tP).x + e == sig.r */
if (!BN_mod_add(t, t, e, order, ctx)) {
ECDSAerr(ECDSA_F_ECDSA_DO_VERIFY, ERR_R_BN_LIB);
SM2err(SM2_F_SM2_DO_VERIFY, ERR_R_BN_LIB);
goto err;
}
if (BN_ucmp(t, sig->r) == 0) {
@@ -492,8 +491,6 @@ int SM2_verify(int type, const unsigned char *dgst, int dgstlen,
int derlen = -1;
int ret = -1;
fprintf(stderr, "%s %d %s() executed\n", __FILE__, __LINE__, __FUNCTION__);
if (!(s = ECDSA_SIG_new())) {
return ret;
}
@@ -516,4 +513,3 @@ err:
ECDSA_SIG_free(s);
return ret;
}

View File

@@ -48,14 +48,14 @@ int change_rand(const char *hex)
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;
}
}
int restore_rand(void)
{
@@ -83,7 +83,7 @@ int hexequbin(const char *hex, const unsigned char *bin, size_t binlen)
sprintf(buf + i*2, "%02X", bin[i]);
}
buf[buflen - 1] = 0;
if (memcmp(hex, buf, binlen * 2) == 0) {
ret = 1;
}
@@ -114,7 +114,7 @@ EC_GROUP *new_ec_group(int is_prime_field,
goto err;
}
if (!BN_hex2bn(&p, p_hex) ||
if (!BN_hex2bn(&p, p_hex) ||
!BN_hex2bn(&a, a_hex) ||
!BN_hex2bn(&b, b_hex) ||
!BN_hex2bn(&x, x_hex) ||
@@ -150,7 +150,7 @@ EC_GROUP *new_ec_group(int is_prime_field,
goto err;
}
EC_GROUP_set_asn1_flag(group, flag);
EC_GROUP_set_asn1_flag(group, flag);
EC_GROUP_set_point_conversion_form(group, form);
ok = 1;
@@ -217,7 +217,7 @@ EC_KEY *new_ec_key(const EC_GROUP *group,
}
if (!EC_KEY_set_public_key_affine_coordinates(ec_key, x, y)) {
goto end;
}
}
ok = 1;
end:
@@ -229,7 +229,7 @@ end:
EC_KEY_free(ec_key);
ec_key = NULL;
}
return ec_key;
return ec_key;
}
int test_sm2_sign(const EC_GROUP *group,
@@ -293,7 +293,7 @@ int test_sm2_sign(const EC_GROUP *group,
fprintf(stderr, "error: %s %d\n", __FUNCTION__, __LINE__);
goto err;
}
/* verify */
if (!(pubkey = new_ec_key(group, NULL, xP, yP, id))) {
fprintf(stderr, "error: %s %d\n", __FUNCTION__, __LINE__);
@@ -337,8 +337,8 @@ int test_sm2_enc(const EC_GROUP *group,
}
buflen = sizeof(buf);
if (!SM2_encrypt_with_recommended((const unsigned char *)M, strlen(M),
buf, &buflen, ec_key)) {
if (!SM2_encrypt_with_recommended(buf, &buflen,
(const unsigned char *)M, strlen(M), ec_key)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
@@ -350,12 +350,12 @@ int test_sm2_enc(const EC_GROUP *group,
goto end;
}
EC_KEY_free(ec_key);
if (!(ec_key = new_ec_key(group, d, xP, yP, NULL))) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
if (!SM2_decrypt_with_recommended(buf, buflen, msg, &msglen, ec_key)) {
if (!SM2_decrypt_with_recommended(msg, &msglen, buf, buflen, ec_key)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
@@ -554,7 +554,7 @@ int test_sm2_test_vector()
"01686522130D590FB8DE635D8FCA715CC6BF3D05BEF3F75DA5D543454448166612",
"ALICE123@YAHOO.COM",
"26352AF82EC19F207BBC6F9474E11E90CE0F7DDACE03B27F801817E897A81FD5",
"message digest",
"message digest",
"AD673CBDA311417129A9EAA5F9AB1AA1633AD47718A84DFD46C17C6FA0AA3B12",
"36CD79FC8E24B7357A8A7B4A46D454C397703D6498158C605399B341ADA186D6",
"6D3FBA26EAB2A1054F5D198332E335817C8AC453ED26D3391CD4439D825BF25B",
@@ -574,7 +574,7 @@ int test_sm2_test_vector()
"4C62EEFD6ECFC2B95B92FD6C3D9575148AFA17425546D49018E5388D49DD7B4F",
"04"
"245C26FB68B1DDDDB12C4B6BF9F2B6D5FE60A383B0D18D1C4144ABF17F6252E7"
"76CB9264C2A7E88E52B19903FDC47378F605E36811F5C07423A24B84400F01B8"
"76CB9264C2A7E88E52B19903FDC47378F605E36811F5C07423A24B84400F01B8"
"650053A89B41C418B0C3AAD00D886C00286467"
"9C3D7360C30156FAB7C80A0276712DA9D8094A634B766D3A285E07480653426D")) {
printf("sm2 enc p256 failed\n");
@@ -624,7 +624,7 @@ int test_sm2_test_vector()
printf("sm2 kap p256 passed\n");
}
#if 1
#if 0
/* ZA will not pass! */
if (!test_sm2_kap(
sm2b257test,
@@ -702,7 +702,7 @@ end:
EVP_PKEY_CTX_free(pkctx);
return ret;
}
int test_evp_pkey_sign(EVP_PKEY *pkey, int do_sm2, int verbose)
{
int ret = 0;
@@ -770,7 +770,7 @@ int test_evp_pkey_sign(EVP_PKEY *pkey, int do_sm2, int verbose)
ret = 1;
end:
EVP_PKEY_CTX_free(pkctx);
return ret;
return ret;
}
int test_evp_pkey_encrypt(EVP_PKEY *pkey, int do_sm2, int verbose)
@@ -791,7 +791,7 @@ int test_evp_pkey_encrypt(EVP_PKEY *pkey, int do_sm2, int verbose)
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
/* EVP_PKEY_encrypt() */
if (!EVP_PKEY_encrypt_init(pkctx)) {
@@ -802,7 +802,7 @@ int test_evp_pkey_encrypt(EVP_PKEY *pkey, int do_sm2, int verbose)
if (!EVP_PKEY_CTX_set_ec_enc_type(pkctx, type)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
}
cbuflen = sizeof(cbuf);
if (!EVP_PKEY_encrypt(pkctx, cbuf, &cbuflen, msg, msglen)) {
@@ -827,7 +827,7 @@ int test_evp_pkey_encrypt(EVP_PKEY *pkey, int do_sm2, int verbose)
if (!EVP_PKEY_CTX_set_ec_enc_type(pkctx, type)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
}
bzero(mbuf, sizeof(mbuf));
mbuflen = sizeof(mbuf);
@@ -1000,7 +1000,7 @@ int test_evp_digestsign(EVP_PKEY *pkey, int do_sm2, const EVP_MD *md, int verbos
goto end;
}
pkctx = NULL;
pkctx = NULL;
if (!EVP_DigestVerifyInit(mdctx, &pkctx, md, NULL, pkey)) {
ERR_print_errors_fp(stderr);
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
@@ -1063,14 +1063,15 @@ int test_evp_seal(int curve_id, const EVP_CIPHER *cipher, BIO *out, int verbose)
}
if (NUM_PKEYS != EVP_SealInit(cctx, cipher, ek, ekl, iv, pkey, NUM_PKEYS)) {
ERR_print_errors_fp(stderr);
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
if (verbose > 1) {
for (i = 0; i < NUM_PKEYS; i++) {
int j;
BIO_printf(out, "ek[i] (%d-byte) = ", ekl[i]);
BIO_printf(out, "ek[%d] (%d-byte) = ", i, ekl[i]);
for (j = 0; j < ekl[i]; j++) {
BIO_printf(out, "%02X", ek[i][j]);
}
@@ -1110,7 +1111,7 @@ int test_evp_seal(int curve_id, const EVP_CIPHER *cipher, BIO *out, int verbose)
BIO_printf(out, "\n");
}
if (!EVP_OpenInit(cctx, cipher, ek[0], ekl[0], iv, pkey[0])) {
if (!EVP_OpenInit(cctx, cipher, ek[1], ekl[1], iv, pkey[1])) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
@@ -1205,13 +1206,13 @@ int test_sm2_evp(int verbose)
if (!test_evp_sign(pkey, md, verbose)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
}
/* test seal/open */
if (!test_evp_seal(curve_id, cipher, out, verbose)) {
fprintf(stderr, "error: %s %d\n", __FILE__, __LINE__);
goto end;
}
}
ret = 1;
@@ -1224,10 +1225,10 @@ end:
}
int main(int argc, char **argv)
{
{
int ret = -1;
BIO *out = NULL;
BIO *out = NULL;
out = BIO_new_fp(stdout, BIO_NOCLOSE);
/*
@@ -1238,20 +1239,20 @@ int main(int argc, char **argv)
} else {
CRYPTO_set_mem_debug_functions(0, 0, 0, 0, 0);
}
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
*/
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
*/
ERR_load_crypto_strings();
RAND_seed(rnd_seed, sizeof(rnd_seed));
if (!test_sm2_test_vector()) {
goto err;
}
if (!test_sm2_evp(2)) {
goto err;
}
}
ret =0;
err:
@@ -1261,7 +1262,7 @@ err:
if (ret)
ERR_print_errors(out);
//CRYPTO_cleanup_all_ex_data();
//ERR_remove_thread_state(NULL);
//ERR_free_strings();

View File

@@ -79,5 +79,4 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
sm3.o: sm3.c sm3.h ../byteorder.h
sm3test.o: sm3test.c sm3.h ../byteorder.h
sm3.o: ../byteorder.h sm3.c sm3.h

View File

@@ -23,8 +23,6 @@
#define IPAD 0x36
#define OPAD 0x5C
void hmac_sm3_init(hmac_sm3_ctx_t *ctx, const unsigned char *key, size_t key_len)
{
int i;

View File

@@ -119,4 +119,27 @@ static char *pt(unsigned char *md)
sprintf(&(buf[i * 2]), "%02x", md[i]);
return (buf);
}
/*
*/
#endif

90
crypto/sm9/Makefile Normal file
View File

@@ -0,0 +1,90 @@
#
# OpenSSL/crypto/sm9/Makefile
#
DIR= sm9
TOP= ../..
CC= cc
CPP= $(CC) -E
INCLUDES=-I.. -I$(TOP) -I../../include
CFLAG=-g
MAKEFILE= Makefile
AR= ar r
SM3_ASM_OBJ=
CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)
GENERAL=Makefile
TEST=sm9test.c
APPS=
LIB=$(TOP)/libcrypto.a
LIBSRC=sm9_lib.c sm9_err.c
LIBOBJ=sm9_lib.o sm9_err.o
SRC= $(LIBSRC)
EXHEADER= sm9.h
HEADER= sm9_lcl.h $(EXHEADER)
ALL= $(GENERAL) $(SRC) $(HEADER)
top:
(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
$(RANLIB) $(LIB) || echo Never mind.
@touch lib
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
links:
@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
do \
(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
ctags $(SRC)
tests:
lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
sm9_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
sm9_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sm9_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
sm9_err.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
sm9_err.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
sm9_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sm9_err.o: ../../include/openssl/safestack.h ../../include/openssl/sm9.h
sm9_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sm9_err.o: sm9_err.c

View File

@@ -86,17 +86,31 @@ int SM9_decrypt(SM9_PUBLIC_PARAMS *params,
unsigned char *out, size_t *outlen,
EVP_PKEY *pkey);
int SM9_sign(SM9_PUBLIC_PARAMS *params,
const unsigned char *dgst, int dgstlen,
unsigned char *sig, unsigned int *siglen,
EVP_PKEY *pkey);
int SM2_verify(SM9_PUBLIC_PARAMS *params,
const unsigned char *dgst, int dgstlen,
const unsigned char *sig, int siglen,
const char *id, size_t idlen);
#ifdef __cplusplus
/* BEGIN ERROR CODES */
/*
* The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_SM9_strings(void);
/* Error codes for the SM9 functions. */
/* Function codes. */
# define SM9_F_D2I_SM9_MASTER_SECRET 100
# define SM9_F_D2I_SM9_PUBLIC_PARAMS 101
# define SM9_F_I2D_SM9_MASTER_SECRET 102
# define SM9_F_I2D_SM9_PUBLIC_PARAMS 103
# define SM9_F_SM9_DECRYPT 104
# define SM9_F_SM9_ENCRYPT 105
# define SM9_F_SM9_EXTRACT_PRIVATE_KEY 106
# define SM9_F_SM9_PUBLIC_PARAMS_FREE 107
# define SM9_F_SM9_SETUP 108
/* Reason codes. */
# define SM9_R_NOT_IMPLEMENTED 100
#ifdef __cplusplus
}
#endif
#endif

101
crypto/sm9/sm9_err.c Normal file
View File

@@ -0,0 +1,101 @@
/* crypto/sm9/sm9_err.c */
/* ====================================================================
* Copyright (c) 1999-2016 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).
*
*/
/*
* NOTE: this file was auto generated by the mkerr.pl script: any changes
* made to it will be overwritten when the script next updates this file,
* only reason strings will be preserved.
*/
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/sm9.h>
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
# define ERR_FUNC(func) ERR_PACK(ERR_LIB_SM9,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_SM9,0,reason)
static ERR_STRING_DATA SM9_str_functs[] = {
{ERR_FUNC(SM9_F_D2I_SM9_MASTER_SECRET), "d2i_SM9_MASTER_SECRET"},
{ERR_FUNC(SM9_F_D2I_SM9_PUBLIC_PARAMS), "d2i_SM9_PUBLIC_PARAMS"},
{ERR_FUNC(SM9_F_I2D_SM9_MASTER_SECRET), "i2d_SM9_MASTER_SECRET"},
{ERR_FUNC(SM9_F_I2D_SM9_PUBLIC_PARAMS), "i2d_SM9_PUBLIC_PARAMS"},
{ERR_FUNC(SM9_F_SM9_DECRYPT), "SM9_decrypt"},
{ERR_FUNC(SM9_F_SM9_ENCRYPT), "SM9_encrypt"},
{ERR_FUNC(SM9_F_SM9_EXTRACT_PRIVATE_KEY), "SM9_extract_private_key"},
{ERR_FUNC(SM9_F_SM9_PUBLIC_PARAMS_FREE), "SM9_PUBLIC_PARAMS_free"},
{ERR_FUNC(SM9_F_SM9_SETUP), "SM9_setup"},
{0, NULL}
};
static ERR_STRING_DATA SM9_str_reasons[] = {
{ERR_REASON(SM9_R_NOT_IMPLEMENTED), "not implemented"},
{0, NULL}
};
#endif
void ERR_load_SM9_strings(void)
{
#ifndef OPENSSL_NO_ERR
if (ERR_func_error_string(SM9_str_functs[0].error) == NULL) {
ERR_load_strings(0, SM9_str_functs);
ERR_load_strings(0, SM9_str_reasons);
}
#endif
}

View File

@@ -1,4 +1,4 @@
/* crypto/sm9/sm9.h */
/* crypto/sm9/sm9_lcl.h */
/* ====================================================================
* Copyright (c) 2016 The GmSSL Project. All rights reserved.
*
@@ -49,6 +49,8 @@
*
*/
#ifndef HEADER_SM9_LCL_H
#define HEADER_SM9_LCL_H
#include "sm9.h"
@@ -86,14 +88,6 @@ struct sm9_method_st {
const unsigned char *in, size_t inlen,
unsigned char *out, size_t *outlen,
EVP_PKEY *pkey);
int (*sign)(SM9_PUBLIC_PARAMS *params,
const unsigned char *dgst, int dgstlen,
unsigned char *sig, unsigned int *siglen,
EVP_PKEY *pkey);
int (*verify)(SM9_PUBLIC_PARAMS *params,
const unsigned char *dgst, int dgstlen,
const unsigned char *sig, int siglen,
const char *id, size_t idlen);
};
#ifdef __cplusplus

118
crypto/sm9/sm9_lib.c Normal file
View File

@@ -0,0 +1,118 @@
/* crypto/sm9/sm9_lib.c */
/* ====================================================================
* Copyright (c) 2016 The GmSSL 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 GmSSL Project.
* (http://gmssl.org/)"
*
* 4. The name "GmSSL Project" must not be used to endorse or promote
* products derived from this software without prior written
* permission. For written permission, please contact
* guanzhi1980@gmail.com.
*
* 5. Products derived from this software may not be called "GmSSL"
* nor may "GmSSL" appear in their names without prior written
* permission of the GmSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the GmSSL Project
* (http://gmssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE GmSSL 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 GmSSL 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.
* ====================================================================
*
*/
#include <openssl/sm9.h>
#include "sm9_lcl.h"
int SM9_setup(SM9_PUBLIC_PARAMS **params, SM9_MASTER_SECRET **master)
{
SM9err(SM9_F_SM9_SETUP, SM9_R_NOT_IMPLEMENTED);
return 0;
}
void SM9_PUBLIC_PARAMS_free(SM9_PUBLIC_PARAMS *a)
{
SM9err(SM9_F_SM9_PUBLIC_PARAMS_FREE, SM9_R_NOT_IMPLEMENTED);
}
void SM9_MASTER_SECRET_free(SM9_MASTER_SECRET *a)
{
}
int i2d_SM9_PUBLIC_PARAMS(SM9_PUBLIC_PARAMS *a, unsigned char *out)
{
SM9err(SM9_F_I2D_SM9_PUBLIC_PARAMS, SM9_R_NOT_IMPLEMENTED);
return 0;
}
int i2d_SM9_MASTER_SECRET(SM9_MASTER_SECRET *a, unsigned char *out)
{
SM9err(SM9_F_I2D_SM9_MASTER_SECRET, SM9_R_NOT_IMPLEMENTED);
return 0;
}
SM9_PUBLIC_PARAMS *d2i_SM9_PUBLIC_PARAMS(SM9_PUBLIC_PARAMS **a, const unsigned char **in, long len)
{
SM9err(SM9_F_D2I_SM9_PUBLIC_PARAMS, SM9_R_NOT_IMPLEMENTED);
return NULL;
}
SM9_MASTER_SECRET *d2i_SM9_MASTER_SECRET(SM9_MASTER_SECRET **a, const unsigned char **in, long len)
{
SM9err(SM9_F_D2I_SM9_MASTER_SECRET, SM9_R_NOT_IMPLEMENTED);
return NULL;
}
EVP_PKEY *SM9_extract_private_key(SM9_MASTER_SECRET *master,
const char *id, size_t idlen, EVP_PKEY **pkey)
{
SM9err(SM9_F_SM9_EXTRACT_PRIVATE_KEY, SM9_R_NOT_IMPLEMENTED);
return NULL;
}
int SM9_encrypt(SM9_PUBLIC_PARAMS *params,
const unsigned char *in, size_t inlen,
unsigned char *out, size_t *outlen,
const char *id, size_t idlen)
{
SM9err(SM9_F_SM9_ENCRYPT, SM9_R_NOT_IMPLEMENTED);
return NULL;
}
int SM9_decrypt(SM9_PUBLIC_PARAMS *params,
const unsigned char *in, size_t inlen,
unsigned char *out, size_t *outlen,
EVP_PKEY *pkey)
{
SM9err(SM9_F_SM9_DECRYPT, SM9_R_NOT_IMPLEMENTED);
return 0;
}

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