Hi,
When I am upgrading from 4.1 to 5.0, I found that GDSADigestVerifier is missing in
5.0. So I need to replace it with something new in 5.0.
Here is my old code using v4.1:
// convert signature from format DER to P1363
DSAPublicKey pubkey(p, q, g, y); // I replaced this one
with DSA::Verifier pubkey(p, q, g, y)
// get P1363 signature length
int new_siglen = pubkey.SignatureLength();
byte new_sig[1024];
try {
DSAConvertSignatureFormat(new_sig, new_siglen, DSA_P1363,
m_signature, m_siglen, DSA_DER);
}
catch (...) {
return false; // invalid signature
}
// calculate digest
byte digest[20];
SHA sha1;
sha1.CalculateDigest((byte*) digest, (byte*) m_body, strlen(m_body));
// verify the signature
GDSADigestVerifier verifier(p, q, g, y); // I don't
know how to replace these two lines
return verifier.VerifyDigest(digest, sizeof(digest), new_sig);
Anybody helps? Thanks in advance!
Yanmu Huang