diff options
author | Bodo Möller <bodo@openssl.org> | 2002-02-13 18:21:51 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2002-02-13 18:21:51 +0000 |
commit | 4d94ae00d5614d64d4dd065860c4b00161a81f82 (patch) | |
tree | e993aa323ea753b3c0782439eb78f4f8c896a67e /crypto/pkcs7 | |
parent | 60d8bae30d1040a4f955e3247443b2dd4c674cde (diff) |
ECDSA support
Submitted by: Nils Larsch <nla@trustcenter.de>
Diffstat (limited to 'crypto/pkcs7')
-rw-r--r-- | crypto/pkcs7/Makefile.ssl | 89 | ||||
-rw-r--r-- | crypto/pkcs7/pk7_doit.c | 7 | ||||
-rw-r--r-- | crypto/pkcs7/pk7_lib.c | 2 |
3 files changed, 57 insertions, 41 deletions
diff --git a/crypto/pkcs7/Makefile.ssl b/crypto/pkcs7/Makefile.ssl index f606abe440..2e58c66842 100644 --- a/crypto/pkcs7/Makefile.ssl +++ b/crypto/pkcs7/Makefile.ssl @@ -105,6 +105,7 @@ pk7_asn1.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h pk7_asn1.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h pk7_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h pk7_asn1.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +pk7_asn1.o: ../../include/openssl/ec.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 @@ -114,13 +115,15 @@ pk7_asn1.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h pk7_asn1.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h pk7_asn1.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h pk7_asn1.o: ../cryptlib.h pk7_asn1.c -pk7_attr.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -pk7_attr.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pk7_attr.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h -pk7_attr.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -pk7_attr.o: ../../include/openssl/err.h ../../include/openssl/evp.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/asn1.h ../../include/openssl/asn1t.h +pk7_attr.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pk7_attr.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pk7_attr.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pk7_attr.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.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/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/rsa.h @@ -129,13 +132,15 @@ pk7_attr.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h pk7_attr.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h pk7_attr.o: pk7_attr.c pk7_doit.o: ../../e_os.h ../../include/openssl/asn1.h -pk7_doit.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -pk7_doit.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -pk7_doit.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h -pk7_doit.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.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/asn1t.h ../../include/openssl/bio.h +pk7_doit.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +pk7_doit.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +pk7_doit.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pk7_doit.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +pk7_doit.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h +pk7_doit.o: ../../include/openssl/evp.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/rsa.h ../../include/openssl/safestack.h @@ -144,26 +149,29 @@ pk7_doit.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h pk7_doit.o: ../../include/openssl/x509_vfy.h ../../include/openssl/x509v3.h pk7_doit.o: ../cryptlib.h pk7_doit.c pk7_lib.o: ../../e_os.h ../../include/openssl/asn1.h -pk7_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -pk7_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -pk7_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -pk7_lib.o: ../../include/openssl/e_os2.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/rsa.h ../../include/openssl/safestack.h -pk7_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h -pk7_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -pk7_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pk7_lib.c +pk7_lib.o: ../../include/openssl/asn1t.h ../../include/openssl/bio.h +pk7_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +pk7_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h +pk7_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +pk7_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h +pk7_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.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/rsa.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: ../cryptlib.h pk7_lib.c pk7_mime.o: ../../e_os.h ../../include/openssl/asn1.h -pk7_mime.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -pk7_mime.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h -pk7_mime.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -pk7_mime.o: ../../include/openssl/e_os2.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/asn1t.h ../../include/openssl/bio.h +pk7_mime.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +pk7_mime.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h +pk7_mime.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h +pk7_mime.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h +pk7_mime.o: ../../include/openssl/err.h ../../include/openssl/evp.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/rsa.h ../../include/openssl/safestack.h @@ -171,13 +179,14 @@ pk7_mime.o: ../../include/openssl/sha.h ../../include/openssl/stack.h pk7_mime.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h pk7_mime.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pk7_mime.c pk7_smime.o: ../../e_os.h ../../include/openssl/asn1.h -pk7_smime.o: ../../include/openssl/bio.h ../../include/openssl/bn.h -pk7_smime.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h -pk7_smime.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h -pk7_smime.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.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/asn1t.h ../../include/openssl/bio.h +pk7_smime.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +pk7_smime.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h +pk7_smime.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pk7_smime.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h +pk7_smime.o: ../../include/openssl/ecdsa.h ../../include/openssl/err.h +pk7_smime.o: ../../include/openssl/evp.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/rsa.h diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index f016fdb2e2..0119272d75 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -628,6 +628,10 @@ int PKCS7_dataFinal(PKCS7 *p7, BIO *bio) if (si->pkey->type == EVP_PKEY_DSA) ctx_tmp.digest=EVP_dss1(); #endif +#ifndef OPENSSL_NO_ECDSA + if (si->pkey->type == EVP_PKEY_ECDSA) + ctx_tmp.digest=EVP_ecdsa(); +#endif if (!EVP_SignFinal(&ctx_tmp,(unsigned char *)buf->data, (unsigned int *)&buf->length,si->pkey)) @@ -825,6 +829,9 @@ for (ii=0; ii<md_len; ii++) printf("%02X",md_dat[ii]); printf(" calc\n"); #ifndef OPENSSL_NO_DSA if(pkey->type == EVP_PKEY_DSA) mdc_tmp.digest=EVP_dss1(); #endif +#ifndef OPENSSL_NO_ECDSA + if (pkey->type == EVP_PKEY_ECDSA) mdc_tmp.digest=EVP_ecdsa(); +#endif i=EVP_VerifyFinal(&mdc_tmp,os->data,os->length, pkey); EVP_PKEY_free(pkey); diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index c00ed6833a..3e0a889288 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -308,7 +308,7 @@ int PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey, const EVP_MD *dgst) { char is_dsa; - if (pkey->type == EVP_PKEY_DSA) is_dsa = 1; + if (pkey->type == EVP_PKEY_DSA || pkey->type == EVP_PKEY_ECDSA) is_dsa = 1; else is_dsa = 0; /* We now need to add another PKCS7_SIGNER_INFO entry */ ASN1_INTEGER_set(p7i->version,1); |