1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/lib/util/pkcs1sig.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + */ 1.8 + 1.9 +#ifndef _PKCS1SIG_H_ 1.10 +#define _PKCS1SIG_H_ 1.11 + 1.12 +#include "hasht.h" 1.13 +#include "seccomon.h" 1.14 +#include "secoidt.h" 1.15 + 1.16 +/* SGN_VerifyPKCS1DigestInfo verifies that the length of the digest is correct 1.17 + * for the given algorithm, then verifies that the recovered data from the 1.18 + * PKCS#1 signature is a properly-formatted DigestInfo that identifies the 1.19 + * given digest algorithm, then verifies that the digest in the DigestInfo 1.20 + * matches the given digest. 1.21 + * 1.22 + * dataRecoveredFromSignature must be the result of calling PK11_VerifyRecover 1.23 + * or equivalent. 1.24 + * 1.25 + * If unsafeAllowMissingParameters is true (not recommended), then a DigestInfo 1.26 + * without the mandatory ASN.1 NULL parameter will also be accepted. 1.27 + */ 1.28 +SECStatus _SGN_VerifyPKCS1DigestInfo(SECOidTag digestAlg, 1.29 + const SECItem* digest, 1.30 + const SECItem* dataRecoveredFromSignature, 1.31 + PRBool unsafeAllowMissingParameters); 1.32 + 1.33 +#endif /* _PKCS1SIG_H_ */