diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-11-29 11:05:04 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-12-07 14:36:05 +0200 |
commit | 1632cd1e5c18be49e5e9ea5df0c347b26844a487 (patch) | |
tree | a9d98d02efc021d5dfae41396e7143d017c8b380 | |
parent | df74b7aee1f821e1f96494c84d580413c76a8c64 (diff) | |
download | rpm-1632cd1e5c18be49e5e9ea5df0c347b26844a487.tar.gz |
Use NSS-defined constants for DSA q-bits and signature length too
- No functional changes here (either), but using the proper constants
simply makes things that little bit clearer.
(cherry picked from commit 604da18bc267f89568081c1ab163c7fc45207220)
-rw-r--r-- | rpmio/digest_nss.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/rpmio/digest_nss.c b/rpmio/digest_nss.c index be3b652ea..f1e5d6aa3 100644 --- a/rpmio/digest_nss.c +++ b/rpmio/digest_nss.c @@ -302,18 +302,24 @@ static SECKEYPublicKey *pgpNewPublicKey(KeyType type) #ifndef DSA1_SUBPRIME_LEN #define DSA1_SUBPRIME_LEN DSA_SUBPRIME_LEN #endif +#ifndef DSA1_SIGNATURE_LEN +#define DSA1_SIGNATURE_LEN DSA_SIGNATURE_LEN +#endif +#ifndef DSA1_Q_BITS +#define DSA1_Q_BITS DSA_Q_BITS +#endif static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num, const uint8_t *p, const uint8_t *pend) { SECItem *sig = pgpsig->data; - int lbits = DSA1_SUBPRIME_LEN * 8; + int lbits = DSA1_Q_BITS; int rc = 1; /* assume failure */ switch (num) { case 0: - sig = pgpsig->data = SECITEM_AllocItem(NULL, NULL, 2*DSA1_SUBPRIME_LEN); - memset(sig->data, 0, 2 * DSA1_SUBPRIME_LEN); + sig = pgpsig->data = SECITEM_AllocItem(NULL, NULL, DSA1_SIGNATURE_LEN); + memset(sig->data, 0, DSA1_SIGNATURE_LEN); rc = pgpMpiSet(lbits, sig->data, p, pend); break; case 1: |