diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-11-29 11:05:04 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-11-30 09:44:21 +0200 |
commit | ce4b5636268ef4ae229d7e072edcb1844c95a277 (patch) | |
tree | d9c5a6863c434b2a189911ec5aaace214ab7473a /rpmio | |
parent | a229dc15e22b77f055d55c873e242e8627b7b1ba (diff) | |
download | librpm-tizen-ce4b5636268ef4ae229d7e072edcb1844c95a277.tar.gz librpm-tizen-ce4b5636268ef4ae229d7e072edcb1844c95a277.tar.bz2 librpm-tizen-ce4b5636268ef4ae229d7e072edcb1844c95a277.zip |
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)
Diffstat (limited to 'rpmio')
-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: |