diff options
Diffstat (limited to 'src/lib/libcrypto/evp/bio_md.c')
-rw-r--r-- | src/lib/libcrypto/evp/bio_md.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index 9841e32e1a..ed5c1135fd 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c | |||
@@ -130,8 +130,8 @@ static int md_read(BIO *b, char *out, int outl) | |||
130 | { | 130 | { |
131 | if (ret > 0) | 131 | if (ret > 0) |
132 | { | 132 | { |
133 | if (EVP_DigestUpdate(ctx,(unsigned char *)out, | 133 | EVP_DigestUpdate(ctx,(unsigned char *)out, |
134 | (unsigned int)ret)<=0) return (-1); | 134 | (unsigned int)ret); |
135 | } | 135 | } |
136 | } | 136 | } |
137 | BIO_clear_retry_flags(b); | 137 | BIO_clear_retry_flags(b); |
@@ -157,11 +157,8 @@ static int md_write(BIO *b, const char *in, int inl) | |||
157 | (unsigned int)ret); | 157 | (unsigned int)ret); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | if(b->next_bio != NULL) | 160 | BIO_clear_retry_flags(b); |
161 | { | 161 | BIO_copy_next_retry(b); |
162 | BIO_clear_retry_flags(b); | ||
163 | BIO_copy_next_retry(b); | ||
164 | } | ||
165 | return(ret); | 162 | return(ret); |
166 | } | 163 | } |
167 | 164 | ||
@@ -197,7 +194,6 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
197 | case BIO_C_GET_MD_CTX: | 194 | case BIO_C_GET_MD_CTX: |
198 | pctx=ptr; | 195 | pctx=ptr; |
199 | *pctx=ctx; | 196 | *pctx=ctx; |
200 | b->init = 1; | ||
201 | break; | 197 | break; |
202 | case BIO_C_SET_MD_CTX: | 198 | case BIO_C_SET_MD_CTX: |
203 | if (b->init) | 199 | if (b->init) |
@@ -253,9 +249,7 @@ static int md_gets(BIO *bp, char *buf, int size) | |||
253 | ctx=bp->ptr; | 249 | ctx=bp->ptr; |
254 | if (size < ctx->digest->md_size) | 250 | if (size < ctx->digest->md_size) |
255 | return(0); | 251 | return(0); |
256 | if (EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret)<=0) | 252 | EVP_DigestFinal_ex(ctx,(unsigned char *)buf,&ret); |
257 | return -1; | ||
258 | |||
259 | return((int)ret); | 253 | return((int)ret); |
260 | } | 254 | } |
261 | 255 | ||