[pkg-opensc-commit] [engine-pkcs11] 27/43: Fixed "make check" on OpenSSL 1.1.0-dev

Eric Dorland eric at moszumanska.debian.org
Sun Jan 31 06:38:49 UTC 2016


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository engine-pkcs11.

commit 3d27871581f5b3365e9fa722fa7b4a37c71c9c67
Author: Michał Trojnara <Michal.Trojnara at stunnel.org>
Date:   Tue Jan 26 14:32:39 2016 +0100

    Fixed "make check" on OpenSSL 1.1.0-dev
---
 tests/evp-sign.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/tests/evp-sign.c b/tests/evp-sign.c
index dd1a07c..5bc5fb1 100644
--- a/tests/evp-sign.c
+++ b/tests/evp-sign.c
@@ -150,7 +150,7 @@ int main(int argc, char **argv)
 	long errline;
 	ENGINE *e;
 	CONF *conf;
-	EVP_MD_CTX ctx;
+	EVP_MD_CTX *ctx;
 	const char *module_path, *efile;
 	BIO *in, *b;
 	enum { NONE, BY_DEFAULT, BY_CTRL } pin_method = NONE;
@@ -260,46 +260,48 @@ int main(int argc, char **argv)
 
 	digest_algo = EVP_get_digestbyname("sha1");
 
-	EVP_MD_CTX_init(&ctx);
-	if (EVP_DigestInit(&ctx, digest_algo) <= 0) {
+	ctx = EVP_MD_CTX_create();
+	if (EVP_DigestInit(ctx, digest_algo) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
 
-	EVP_SignInit(&ctx, digest_algo);
+	EVP_SignInit(ctx, digest_algo);
 
 #define TEST_DATA "test data"
-	if (EVP_SignUpdate(&ctx, TEST_DATA, sizeof(TEST_DATA)) <= 0) {
+	if (EVP_SignUpdate(ctx, TEST_DATA, sizeof(TEST_DATA)) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
 
 	n = sizeof(buf);
-	if (EVP_SignFinal(&ctx, buf, &n, private_key) <= 0) {
+	if (EVP_SignFinal(ctx, buf, &n, private_key) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
+	EVP_MD_CTX_destroy(ctx);
 
-	EVP_MD_CTX_init(&ctx);
-	if (EVP_DigestInit(&ctx, digest_algo) <= 0) {
+	ctx = EVP_MD_CTX_create();
+	if (EVP_DigestInit(ctx, digest_algo) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
 
-	if (EVP_DigestVerifyInit(&ctx, NULL, digest_algo, NULL, pubkey) <= 0) {
+	if (EVP_DigestVerifyInit(ctx, NULL, digest_algo, NULL, pubkey) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
 
-	if (EVP_DigestVerifyUpdate(&ctx, TEST_DATA, sizeof(TEST_DATA)) <= 0) {
+	if (EVP_DigestVerifyUpdate(ctx, TEST_DATA, sizeof(TEST_DATA)) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
 
-	if (EVP_DigestVerifyFinal(&ctx, buf, n) <= 0) {
+	if (EVP_DigestVerifyFinal(ctx, buf, n) <= 0) {
 		display_openssl_errors(__LINE__);
 		exit(1);
 	}
+	EVP_MD_CTX_destroy(ctx);
 
 	EVP_PKEY_free(pubkey);
 	EVP_PKEY_free(private_key);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/engine-pkcs11.git



More information about the pkg-opensc-commit mailing list