extract compare signature hash from plain and place into digest
| 924 | |
| 925 | // extract compare signature hash from plain and place into digest |
| 926 | void CertDecoder::GetCompareHash(const byte* plain, word32 sz, byte* digest, |
| 927 | word32 digSz) |
| 928 | { |
| 929 | if (source_.GetError().What()) return; |
| 930 | |
| 931 | Source s(plain, sz); |
| 932 | CertDecoder dec(s, false); |
| 933 | |
| 934 | dec.GetSequence(); |
| 935 | dec.GetAlgoId(); |
| 936 | dec.GetDigest(); |
| 937 | |
| 938 | if (dec.sigLength_ > digSz) { |
| 939 | source_.SetError(SIG_LEN_E); |
| 940 | return; |
| 941 | } |
| 942 | |
| 943 | memcpy(digest, dec.signature_, dec.sigLength_); |
| 944 | } |
| 945 | |
| 946 | |
| 947 | // validate signature signed by someone else |