Commit 85b43c26 authored by Ziirish's avatar Ziirish

fix patch file

parent c22c1079
Pipeline #1579 passed with stages
in 5 minutes and 33 seconds
--- src/handy.c.ori 2019-03-20 17:26:14.471633892 +0000
+++ src/handy.c 2019-03-20 17:32:12.062620657 +0000
@@ -279,18 +279,22 @@
// compilation warnings on Macs.
unsigned char enc_iv[]={'[', 'l', 'k', 'd', '.', '$', 'G', 0xa3, '\0'};
- if(!(ctx=(EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX))))
+ if(!(ctx=(EVP_CIPHER_CTX *)EVP_CIPHER_CTX_new()))
{
log_out_of_memory(__FUNCTION__);
return NULL;
}
diff --git src/handy.c.orig src/handy.c
index 4d48597c..63cb6ebf 100644
--- src/handy.c.orig
+++ src/handy.c
@@ -279,18 +279,22 @@ EVP_CIPHER_CTX *enc_setup(int encrypt, const char *encryption_password)
// compilation warnings on Macs.
unsigned char enc_iv[]={'[', 'l', 'k', 'd', '.', '$', 'G', 0xa3, '\0'};
- if(!(ctx=(EVP_CIPHER_CTX *)malloc(sizeof(EVP_CIPHER_CTX))))
+ if(!(ctx=(EVP_CIPHER_CTX *)EVP_CIPHER_CTX_new()))
{
log_out_of_memory(__FUNCTION__);
return NULL;
}
- memset(ctx, 0, sizeof(EVP_CIPHER_CTX));
// Don't set key or IV because we will modify the parameters.
EVP_CIPHER_CTX_init(ctx);
if(!(EVP_CipherInit_ex(ctx, EVP_bf_cbc(), NULL, NULL, NULL, encrypt)))
{
logp("EVP_CipherInit_ex failed\n");
- free(ctx);
+ if(ctx)
+ {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+ ctx=NULL;
+ }
return NULL;
}
EVP_CIPHER_CTX_set_key_length(ctx, strlen(encryption_password));
@@ -301,7 +305,12 @@
enc_iv, encrypt))
{
logp("Second EVP_CipherInit_ex failed\n");
- free(ctx);
+ if(ctx)
+ {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+ ctx=NULL;
+ }
return NULL;
}
return ctx;
@@ -592,7 +601,8 @@
if(enc_ctx)
{
EVP_CIPHER_CTX_cleanup(enc_ctx);
- free(enc_ctx);
// Don't set key or IV because we will modify the parameters.
EVP_CIPHER_CTX_init(ctx);
if(!(EVP_CipherInit_ex(ctx, EVP_bf_cbc(), NULL, NULL, NULL, encrypt)))
{
logp("EVP_CipherInit_ex failed\n");
- free(ctx);
+ if(ctx)
+ {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+ ctx=NULL;
+ }
return NULL;
}
EVP_CIPHER_CTX_set_key_length(ctx, strlen(encryption_password));
@@ -301,7 +305,12 @@ EVP_CIPHER_CTX *enc_setup(int encrypt, const char *encryption_password)
enc_iv, encrypt))
{
logp("Second EVP_CipherInit_ex failed\n");
- free(ctx);
+ if(ctx)
+ {
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
+ ctx=NULL;
+ }
return NULL;
}
return ctx;
@@ -592,7 +601,8 @@ cleanup:
if(enc_ctx)
{
EVP_CIPHER_CTX_cleanup(enc_ctx);
- free(enc_ctx);
+ EVP_CIPHER_CTX_free(enc_ctx);
+ enc_ctx=NULL;
}
if(!ret)
}
if(!ret)
......@@ -13,7 +13,7 @@ git clone $BURP
cd burp
git checkout tags/$BURP_VERSION
./configure --disable-ipv6
patch -p0 </app/patch/burp-libssl1.1.patch
patch -Np0 </app/patch/burp-libssl1.1.patch
make -j
make install
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment