summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/bio_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/bio_enc.c')
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 64fb2353af..ab81851503 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -132,7 +132,7 @@ static int enc_free(BIO *a)
132 if (a == NULL) return(0); 132 if (a == NULL) return(0);
133 b=(BIO_ENC_CTX *)a->ptr; 133 b=(BIO_ENC_CTX *)a->ptr;
134 EVP_CIPHER_CTX_cleanup(&(b->cipher)); 134 EVP_CIPHER_CTX_cleanup(&(b->cipher));
135 memset(a->ptr,0,sizeof(BIO_ENC_CTX)); 135 OPENSSL_cleanse(a->ptr,sizeof(BIO_ENC_CTX));
136 OPENSSL_free(a->ptr); 136 OPENSSL_free(a->ptr);
137 a->ptr=NULL; 137 a->ptr=NULL;
138 a->init=0; 138 a->init=0;
@@ -271,7 +271,7 @@ static int enc_write(BIO *b, const char *in, int inl)
271 if (i <= 0) 271 if (i <= 0)
272 { 272 {
273 BIO_copy_next_retry(b); 273 BIO_copy_next_retry(b);
274 return(i); 274 return (ret == inl) ? i : ret - inl;
275 } 275 }
276 n-=i; 276 n-=i;
277 ctx->buf_off+=i; 277 ctx->buf_off+=i;
@@ -325,10 +325,7 @@ again:
325 { 325 {
326 i=enc_write(b,NULL,0); 326 i=enc_write(b,NULL,0);
327 if (i < 0) 327 if (i < 0)
328 { 328 return i;
329 ret=i;
330 break;
331 }
332 } 329 }
333 330
334 if (!ctx->finished) 331 if (!ctx->finished)