OLD | NEW |
1 /* | 1 /* |
2 * | 2 * |
3 * This Source Code Form is subject to the terms of the Mozilla Public | 3 * This Source Code Form is subject to the terms of the Mozilla Public |
4 * License, v. 2.0. If a copy of the MPL was not distributed with this | 4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | 6 |
7 #ifdef FREEBL_NO_DEPEND | 7 #ifdef FREEBL_NO_DEPEND |
8 #include "stubs.h" | 8 #include "stubs.h" |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 SECStatus | 495 SECStatus |
496 DSA_VerifyDigest(DSAPublicKey *key, const SECItem *signature, | 496 DSA_VerifyDigest(DSAPublicKey *key, const SECItem *signature, |
497 const SECItem *digest) | 497 const SECItem *digest) |
498 { | 498 { |
499 /* FIPS-compliance dictates that digest is a SHA hash. */ | 499 /* FIPS-compliance dictates that digest is a SHA hash. */ |
500 mp_int p, q, g; /* PQG parameters */ | 500 mp_int p, q, g; /* PQG parameters */ |
501 mp_int r_, s_; /* tuple (r', s') is received signature) */ | 501 mp_int r_, s_; /* tuple (r', s') is received signature) */ |
502 mp_int u1, u2, v, w; /* intermediate values used in verification */ | 502 mp_int u1, u2, v, w; /* intermediate values used in verification */ |
503 mp_int y; /* public key */ | 503 mp_int y; /* public key */ |
504 mp_err err; | 504 mp_err err; |
505 int dsa_subprime_len, dsa_signature_len, offset; | 505 unsigned int dsa_subprime_len, dsa_signature_len, offset; |
506 SECItem localDigest; | 506 SECItem localDigest; |
507 unsigned char localDigestData[DSA_MAX_SUBPRIME_LEN]; | 507 unsigned char localDigestData[DSA_MAX_SUBPRIME_LEN]; |
508 SECStatus verified = SECFailure; | 508 SECStatus verified = SECFailure; |
509 | 509 |
510 /* Check args. */ | 510 /* Check args. */ |
511 if (!key || !signature || !digest ) { | 511 if (!key || !signature || !digest ) { |
512 PORT_SetError(SEC_ERROR_INVALID_ARGS); | 512 PORT_SetError(SEC_ERROR_INVALID_ARGS); |
513 return SECFailure; | 513 return SECFailure; |
514 } | 514 } |
515 | 515 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 mp_clear(&s_); | 622 mp_clear(&s_); |
623 mp_clear(&u1); | 623 mp_clear(&u1); |
624 mp_clear(&u2); | 624 mp_clear(&u2); |
625 mp_clear(&v); | 625 mp_clear(&v); |
626 mp_clear(&w); | 626 mp_clear(&w); |
627 if (err) { | 627 if (err) { |
628 translate_mpi_error(err); | 628 translate_mpi_error(err); |
629 } | 629 } |
630 return verified; | 630 return verified; |
631 } | 631 } |
OLD | NEW |