diff options
Diffstat (limited to 'src/lib/libcrypto/ts/ts_rsp_verify.c')
| -rw-r--r-- | src/lib/libcrypto/ts/ts_rsp_verify.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_verify.c b/src/lib/libcrypto/ts/ts_rsp_verify.c index afe16afbe4..ed0252d7d7 100644 --- a/src/lib/libcrypto/ts/ts_rsp_verify.c +++ b/src/lib/libcrypto/ts/ts_rsp_verify.c | |||
| @@ -509,15 +509,17 @@ static int TS_check_status_info(TS_RESP *response) | |||
| 509 | TS_failure_info[i].code)) | 509 | TS_failure_info[i].code)) |
| 510 | { | 510 | { |
| 511 | if (!first) | 511 | if (!first) |
| 512 | strcpy(failure_text, ","); | 512 | strlcat(failure_text, ",", |
| 513 | TS_STATUS_BUF_SIZE); | ||
| 513 | else | 514 | else |
| 514 | first = 0; | 515 | first = 0; |
| 515 | strcat(failure_text, TS_failure_info[i].text); | 516 | strlcat(failure_text, TS_failure_info[i].text, |
| 517 | TS_STATUS_BUF_SIZE); | ||
| 516 | } | 518 | } |
| 517 | } | 519 | } |
| 518 | } | 520 | } |
| 519 | if (failure_text[0] == '\0') | 521 | if (failure_text[0] == '\0') |
| 520 | strcpy(failure_text, "unspecified"); | 522 | strlcpy(failure_text, "unspecified", TS_STATUS_BUF_SIZE); |
| 521 | 523 | ||
| 522 | /* Making up the error string. */ | 524 | /* Making up the error string. */ |
| 523 | TSerr(TS_F_TS_CHECK_STATUS_INFO, TS_R_NO_TIME_STAMP_TOKEN); | 525 | TSerr(TS_F_TS_CHECK_STATUS_INFO, TS_R_NO_TIME_STAMP_TOKEN); |
| @@ -614,15 +616,12 @@ static int TS_compute_imprint(BIO *data, TS_TST_INFO *tst_info, | |||
| 614 | goto err; | 616 | goto err; |
| 615 | } | 617 | } |
| 616 | 618 | ||
| 617 | if (!EVP_DigestInit(&md_ctx, md)) | 619 | EVP_DigestInit(&md_ctx, md); |
| 618 | goto err; | ||
| 619 | while ((length = BIO_read(data, buffer, sizeof(buffer))) > 0) | 620 | while ((length = BIO_read(data, buffer, sizeof(buffer))) > 0) |
| 620 | { | 621 | { |
| 621 | if (!EVP_DigestUpdate(&md_ctx, buffer, length)) | 622 | EVP_DigestUpdate(&md_ctx, buffer, length); |
| 622 | goto err; | ||
| 623 | } | 623 | } |
| 624 | if (!EVP_DigestFinal(&md_ctx, *imprint, NULL)) | 624 | EVP_DigestFinal(&md_ctx, *imprint, NULL); |
| 625 | goto err; | ||
| 626 | 625 | ||
| 627 | return 1; | 626 | return 1; |
| 628 | err: | 627 | err: |
