diff options
author | Ben Laurie <ben@openssl.org> | 2001-07-30 23:57:25 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2001-07-30 23:57:25 +0000 |
commit | dbad169019598981174ff46c7a9bf58373b0e53a (patch) | |
tree | ce8ca1188d5614648f24b03967785543f1edc8f5 /crypto/pem | |
parent | 3ba5d1cf2eb6ef28ac5f6d9f3d28020d00c5be50 (diff) |
Really add the EVP and all of the DES changes.
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/Makefile.ssl | 202 | ||||
-rw-r--r-- | crypto/pem/pem.h | 3 | ||||
-rw-r--r-- | crypto/pem/pem_seal.c | 27 |
3 files changed, 133 insertions, 99 deletions
diff --git a/crypto/pem/Makefile.ssl b/crypto/pem/Makefile.ssl index c07ba33d29..c9d432cb56 100644 --- a/crypto/pem/Makefile.ssl +++ b/crypto/pem/Makefile.ssl @@ -83,130 +83,160 @@ clean: # DO NOT DELETE THIS LINE -- make depend depends on it. pem_all.o: ../../e_os.h ../../include/openssl/asn1.h -pem_all.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -pem_all.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pem_all.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -pem_all.o: ../../include/openssl/des.h ../../include/openssl/dh.h -pem_all.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -pem_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h -pem_all.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -pem_all.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -pem_all.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +pem_all.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_all.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_all.o: ../../include/openssl/e_os2.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/pem.h ../../include/openssl/pem2.h -pem_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/rc2.h -pem_all.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -pem_all.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -pem_all.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.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/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_all.o: ../cryptlib.h pem_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h -pem_err.o: ../../include/openssl/blowfish.h ../../include/openssl/bn.h -pem_err.o: ../../include/openssl/buffer.h ../../include/openssl/cast.h -pem_err.o: ../../include/openssl/crypto.h ../../include/openssl/des.h -pem_err.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h -pem_err.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h -pem_err.o: ../../include/openssl/evp.h ../../include/openssl/idea.h -pem_err.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h -pem_err.o: ../../include/openssl/md4.h ../../include/openssl/md5.h -pem_err.o: ../../include/openssl/mdc2.h ../../include/openssl/obj_mac.h +pem_err.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h +pem_err.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h +pem_err.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.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/pem.h pem_err.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h -pem_err.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -pem_err.o: ../../include/openssl/rc5.h ../../include/openssl/rd_fst.h -pem_err.o: ../../include/openssl/rijndael.h ../../include/openssl/ripemd.h pem_err.o: ../../include/openssl/rsa.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/x509_vfy.h pem_info.o: ../../e_os.h ../../include/openssl/asn1.h -pem_info.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -pem_info.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pem_info.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -pem_info.o: ../../include/openssl/des.h ../../include/openssl/dh.h -pem_info.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -pem_info.o: ../../include/openssl/err.h ../../include/openssl/evp.h -pem_info.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -pem_info.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -pem_info.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +pem_info.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_info.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_info.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_info.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h +pem_info.o: ../../include/openssl/evp.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/pem.h pem_info.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h -pem_info.o: ../../include/openssl/rc2.h ../../include/openssl/rc4.h -pem_info.o: ../../include/openssl/rc5.h ../../include/openssl/rd_fst.h -pem_info.o: ../../include/openssl/rijndael.h ../../include/openssl/ripemd.h pem_info.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h pem_info.o: ../../include/openssl/sha.h ../../include/openssl/stack.h pem_info.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h -pem_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_info.c +pem_info.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_lib.o: ../../e_os.h ../../include/openssl/asn1.h -pem_lib.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -pem_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pem_lib.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h +pem_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h pem_lib.o: ../../include/openssl/des.h ../../include/openssl/dh.h pem_lib.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h pem_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h -pem_lib.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -pem_lib.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -pem_lib.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.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/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/rc2.h -pem_lib.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -pem_lib.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -pem_lib.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h -pem_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h -pem_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h -pem_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -pem_lib.o: ../cryptlib.h pem_lib.c +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/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/rsa.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/x509.h +pem_lib.o: ../../include/openssl/x509_vfy.h ../cryptlib.h +pem_oth.o: ../../e_os.h ../../include/openssl/asn1.h +pem_oth.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_oth.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_oth.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_oth.o: ../../include/openssl/e_os2.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/pem.h ../../include/openssl/pem2.h +pem_oth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h +pem_oth.o: ../../include/openssl/rsa.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_pk8.o: ../../e_os.h ../../include/openssl/asn1.h +pem_pk8.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_pk8.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_pk8.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_pk8.o: ../../include/openssl/e_os2.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/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/rsa.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_pkey.o: ../../e_os.h ../../include/openssl/asn1.h +pem_pkey.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_pkey.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_pkey.o: ../../include/openssl/e_os2.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/opensslv.h ../../include/openssl/pem.h +pem_pkey.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs12.h +pem_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h +pem_pkey.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +pem_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h +pem_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h +pem_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h pem_seal.o: ../../e_os.h ../../include/openssl/asn1.h -pem_seal.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -pem_seal.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pem_seal.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -pem_seal.o: ../../include/openssl/des.h ../../include/openssl/dh.h -pem_seal.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -pem_seal.o: ../../include/openssl/err.h ../../include/openssl/evp.h -pem_seal.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -pem_seal.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -pem_seal.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +pem_seal.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_seal.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_seal.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_seal.o: ../../include/openssl/e_os2.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/opensslv.h ../../include/openssl/pem.h pem_seal.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h -pem_seal.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h -pem_seal.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -pem_seal.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -pem_seal.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +pem_seal.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h pem_seal.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h pem_seal.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h pem_seal.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h -pem_seal.o: ../cryptlib.h pem_seal.c +pem_seal.o: ../cryptlib.h pem_sign.o: ../../e_os.h ../../include/openssl/asn1.h -pem_sign.o: ../../include/openssl/bio.h ../../include/openssl/blowfish.h -pem_sign.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h -pem_sign.o: ../../include/openssl/cast.h ../../include/openssl/crypto.h -pem_sign.o: ../../include/openssl/des.h ../../include/openssl/dh.h -pem_sign.o: ../../include/openssl/dsa.h ../../include/openssl/e_os2.h -pem_sign.o: ../../include/openssl/err.h ../../include/openssl/evp.h -pem_sign.o: ../../include/openssl/idea.h ../../include/openssl/lhash.h -pem_sign.o: ../../include/openssl/md2.h ../../include/openssl/md4.h -pem_sign.o: ../../include/openssl/md5.h ../../include/openssl/mdc2.h +pem_sign.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_sign.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_sign.o: ../../include/openssl/e_os2.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/opensslv.h ../../include/openssl/pem.h pem_sign.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h -pem_sign.o: ../../include/openssl/rand.h ../../include/openssl/rc2.h -pem_sign.o: ../../include/openssl/rc4.h ../../include/openssl/rc5.h -pem_sign.o: ../../include/openssl/rd_fst.h ../../include/openssl/rijndael.h -pem_sign.o: ../../include/openssl/ripemd.h ../../include/openssl/rsa.h +pem_sign.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h pem_sign.o: ../../include/openssl/safestack.h ../../include/openssl/sha.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 +pem_sign.o: ../cryptlib.h +pem_x509.o: ../../e_os.h ../../include/openssl/asn1.h +pem_x509.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_x509.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_x509.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_x509.o: ../../include/openssl/e_os2.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/opensslv.h ../../include/openssl/pem.h +pem_x509.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h +pem_x509.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +pem_x509.o: ../../include/openssl/sha.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_xaux.o: ../../e_os.h ../../include/openssl/asn1.h +pem_xaux.o: ../../include/openssl/bio.h ../../include/openssl/bn.h +pem_xaux.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h +pem_xaux.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h +pem_xaux.o: ../../include/openssl/e_os2.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/opensslv.h ../../include/openssl/pem.h +pem_xaux.o: ../../include/openssl/pem2.h ../../include/openssl/pkcs7.h +pem_xaux.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h +pem_xaux.o: ../../include/openssl/sha.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 diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h index b7a0c418b5..3397ed3aa6 100644 --- a/crypto/pem/pem.h +++ b/crypto/pem/pem.h @@ -127,7 +127,8 @@ extern "C" { #define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" #define PEM_STRING_DSAPARAMS "DSA PARAMETERS" - + /* Note that this structure is initialised by PEM_SealInit and cleaned up + by PEM_SealFinal (at least for now) */ typedef struct PEM_Encode_Seal_st { EVP_ENCODE_CTX encode; diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c index b69a381e55..50a1b9162a 100644 --- a/crypto/pem/pem_seal.c +++ b/crypto/pem/pem_seal.c @@ -91,10 +91,13 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, goto err; } - EVP_EncodeInit(&(ctx->encode)); - EVP_SignInit(&(ctx->md),md_type); + EVP_EncodeInit(&ctx->encode); - ret=EVP_SealInit(&(ctx->cipher),type,ek,ekl,iv,pubk,npubk); + EVP_MD_CTX_init(&ctx->md); + EVP_SignInit(&ctx->md,md_type); + + EVP_CIPHER_CTX_init(&ctx->cipher); + ret=EVP_SealInit(&ctx->cipher,type,ek,ekl,iv,pubk,npubk); if (!ret) goto err; /* base64 encode the keys */ @@ -120,7 +123,7 @@ void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, int i,j; *outl=0; - EVP_SignUpdate(&(ctx->md),in,inl); + EVP_SignUpdate(&ctx->md,in,inl); for (;;) { if (inl <= 0) break; @@ -128,8 +131,8 @@ void PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl, i=1200; else i=inl; - EVP_EncryptUpdate(&(ctx->cipher),buffer,&j,in,i); - EVP_EncodeUpdate(&(ctx->encode),out,&j,buffer,j); + EVP_EncryptUpdate(&ctx->cipher,buffer,&j,in,i); + EVP_EncodeUpdate(&ctx->encode,out,&j,buffer,j); *outl+=j; out+=j; in+=i; @@ -158,20 +161,20 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, goto err; } - EVP_EncryptFinal(&(ctx->cipher),s,(int *)&i); - EVP_EncodeUpdate(&(ctx->encode),out,&j,s,i); + EVP_EncryptFinal(&ctx->cipher,s,(int *)&i); + EVP_EncodeUpdate(&ctx->encode,out,&j,s,i); *outl=j; out+=j; - EVP_EncodeFinal(&(ctx->encode),out,&j); + EVP_EncodeFinal(&ctx->encode,out,&j); *outl+=j; - if (!EVP_SignFinal(&(ctx->md),s,&i,priv)) goto err; + if (!EVP_SignFinal(&ctx->md,s,&i,priv)) goto err; *sigl=EVP_EncodeBlock(sig,s,i); ret=1; err: - memset((char *)&(ctx->md),0,sizeof(ctx->md)); - memset((char *)&(ctx->cipher),0,sizeof(ctx->cipher)); + EVP_MD_CTX_cleanup(&ctx->md); + EVP_CIPHER_CTX_cleanup(&ctx->cipher); if (s != NULL) OPENSSL_free(s); return(ret); } |