diff options
Diffstat (limited to 'src/lib/libcrypto/evp/bio_md.c')
-rw-r--r-- | src/lib/libcrypto/evp/bio_md.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index f4aa41ac4b..c632dfb202 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c | |||
@@ -176,11 +176,10 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
176 | { | 176 | { |
177 | case BIO_CTRL_RESET: | 177 | case BIO_CTRL_RESET: |
178 | if (b->init) | 178 | if (b->init) |
179 | ret = EVP_DigestInit_ex(ctx,ctx->digest, NULL); | 179 | EVP_DigestInit_ex(ctx,ctx->digest, NULL); |
180 | else | 180 | else |
181 | ret=0; | 181 | ret=0; |
182 | if (ret > 0) | 182 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); |
183 | ret=BIO_ctrl(b->next_bio,cmd,num,ptr); | ||
184 | break; | 183 | break; |
185 | case BIO_C_GET_MD: | 184 | case BIO_C_GET_MD: |
186 | if (b->init) | 185 | if (b->init) |
@@ -192,12 +191,11 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
192 | ret=0; | 191 | ret=0; |
193 | break; | 192 | break; |
194 | case BIO_C_GET_MD_CTX: | 193 | case BIO_C_GET_MD_CTX: |
195 | pctx=ptr; | ||
196 | *pctx=ctx; | ||
197 | break; | ||
198 | case BIO_C_SET_MD_CTX: | ||
199 | if (b->init) | 194 | if (b->init) |
200 | b->ptr=ptr; | 195 | { |
196 | pctx=ptr; | ||
197 | *pctx=ctx; | ||
198 | } | ||
201 | else | 199 | else |
202 | ret=0; | 200 | ret=0; |
203 | break; | 201 | break; |
@@ -209,9 +207,8 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
209 | 207 | ||
210 | case BIO_C_SET_MD: | 208 | case BIO_C_SET_MD: |
211 | md=ptr; | 209 | md=ptr; |
212 | ret = EVP_DigestInit_ex(ctx,md, NULL); | 210 | EVP_DigestInit_ex(ctx,md, NULL); |
213 | if (ret > 0) | 211 | b->init=1; |
214 | b->init=1; | ||
215 | break; | 212 | break; |
216 | case BIO_CTRL_DUP: | 213 | case BIO_CTRL_DUP: |
217 | dbio=ptr; | 214 | dbio=ptr; |