read cert digest, store in signature_
| 707 | |
| 708 | // read cert digest, store in signature_ |
| 709 | word32 CertDecoder::GetDigest() |
| 710 | { |
| 711 | if (source_.GetError().What()) return 0; |
| 712 | byte b = source_.next(); |
| 713 | |
| 714 | if (b != OCTET_STRING) { |
| 715 | source_.SetError(OCTET_STR_E); |
| 716 | return 0; |
| 717 | } |
| 718 | |
| 719 | sigLength_ = GetLength(source_); |
| 720 | |
| 721 | signature_ = NEW_TC byte[sigLength_]; |
| 722 | memcpy(signature_, source_.get_current(), sigLength_); |
| 723 | source_.advance(sigLength_); |
| 724 | |
| 725 | return sigLength_; |
| 726 | } |
| 727 | |
| 728 | |
| 729 | // memory length checked add tag to buffer |
no test coverage detected