diff options
| author | markus <> | 2003-05-11 21:36:58 +0000 |
|---|---|---|
| committer | markus <> | 2003-05-11 21:36:58 +0000 |
| commit | 1c98a87f0daac81245653c227eb2f2508a22a965 (patch) | |
| tree | 3de6d603296ec563b936da4e6a8a1e33d48f8884 /src/lib/libcrypto/evp/bio_enc.c | |
| parent | 31392c89d1135cf2a416f97295f6d21681b3fbc4 (diff) | |
| download | openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.gz openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.bz2 openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.zip | |
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libcrypto/evp/bio_enc.c')
| -rw-r--r-- | src/lib/libcrypto/evp/bio_enc.c | 9 |
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) |
