Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > a3345beea6469f70a31ef88890424a3e > files > 2

dump-0.4b46-5.mga7.src.rpm

diff -up dump-0.4b46/common/transformation_ssl.c.openssl11 dump-0.4b46/common/transformation_ssl.c
--- dump-0.4b46/common/transformation_ssl.c.openssl11	2016-06-08 07:01:45.000000000 +0200
+++ dump-0.4b46/common/transformation_ssl.c	2017-09-09 17:31:28.095155908 +0200
@@ -515,7 +515,7 @@ Transformation
 		//EVP_CIPHER_CTX_rand_key(ctx, t->state.ssl.key);
 		//EVP_CIPHER_CTX_cleanup(ctx);
 		//EVP_CIPHER_CTX_free(ctx);
-		RAND_bytes(t->state.ssl.key, t->state.ssl.cipher->key_len);
+		RAND_bytes(t->state.ssl.key, EVP_CIPHER_key_length(t->state.ssl.cipher));
 	} else {
 		// how do we get keys?
 	}
diff -up dump-0.4b46/rmt/cipher.c.openssl11 dump-0.4b46/rmt/cipher.c
--- dump-0.4b46/rmt/cipher.c.openssl11	2016-06-07 20:09:12.000000000 +0200
+++ dump-0.4b46/rmt/cipher.c	2017-09-09 17:34:01.776086854 +0200
@@ -23,7 +23,7 @@
 char *
 cipher(char *buf, int buflen, int do_encrypt)
 {
-	static EVP_CIPHER_CTX ctx;
+	static EVP_CIPHER_CTX * ctx = NULL;
 	static char *out = NULL;	/* return value, grown as necessary */
 	static int outlen = 0;
 	static int init = 0, which, blocksize;
@@ -71,13 +71,13 @@ cipher(char *buf, int buflen, int do_enc
 		}
 		EVP_BytesToKey(cipher, EVP_md5(), NULL,
 			buf, strlen(buf), 1, key, iv);
-		EVP_CIPHER_CTX_init(&ctx);
-		EVP_CipherInit_ex(&ctx, cipher, NULL, key, iv, do_encrypt);
-		EVP_CIPHER_CTX_set_padding(&ctx, 0);	// -nopad
+		ctx = EVP_CIPHER_CTX_new();
+		EVP_CipherInit_ex(ctx, cipher, NULL, key, iv, do_encrypt);
+		EVP_CIPHER_CTX_set_padding(ctx, 0);	// -nopad
 		OPENSSL_cleanse(buf, sizeof buf);
 		OPENSSL_cleanse(key, sizeof key);
 		OPENSSL_cleanse(iv, sizeof iv);
-		blocksize = EVP_CIPHER_CTX_block_size(&ctx);
+		blocksize = EVP_CIPHER_CTX_block_size(ctx);
 		which = do_encrypt;
 		init = 1;
 	}
@@ -95,7 +95,7 @@ cipher(char *buf, int buflen, int do_enc
 		outlen = (buflen+blocksize) * 2;
 		out = realloc(out, outlen);
 	}
-	if (!EVP_CipherUpdate(&ctx, out, &n, buf, buflen)) {
+	if (!EVP_CipherUpdate(ctx, out, &n, buf, buflen)) {
 		syslog(LOG_ERR, "EVP_CipherUpdate failed");
 		errno = EINVAL;
 		return NULL;