diff options
Diffstat (limited to 'src/lib/libcrypto/evp/bio_md.c')
| -rw-r--r-- | src/lib/libcrypto/evp/bio_md.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c index f4aa41ac4b..d648ac6da6 100644 --- a/src/lib/libcrypto/evp/bio_md.c +++ b/src/lib/libcrypto/evp/bio_md.c | |||
| @@ -153,7 +153,7 @@ static int md_write(BIO *b, const char *in, int inl) | |||
| 153 | { | 153 | { |
| 154 | if (ret > 0) | 154 | if (ret > 0) |
| 155 | { | 155 | { |
| 156 | EVP_DigestUpdate(ctx,(unsigned char *)in, | 156 | EVP_DigestUpdate(ctx,(const unsigned char *)in, |
| 157 | (unsigned int)ret); | 157 | (unsigned int)ret); |
| 158 | } | 158 | } |
| 159 | } | 159 | } |
| @@ -192,8 +192,13 @@ static long md_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 192 | ret=0; | 192 | ret=0; |
| 193 | break; | 193 | break; |
| 194 | case BIO_C_GET_MD_CTX: | 194 | case BIO_C_GET_MD_CTX: |
| 195 | pctx=ptr; | 195 | if (b->init) |
| 196 | *pctx=ctx; | 196 | { |
| 197 | pctx=ptr; | ||
| 198 | *pctx=ctx; | ||
| 199 | } | ||
| 200 | else | ||
| 201 | ret=0; | ||
| 197 | break; | 202 | break; |
| 198 | case BIO_C_SET_MD_CTX: | 203 | case BIO_C_SET_MD_CTX: |
| 199 | if (b->init) | 204 | if (b->init) |
