diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-11-29 10:43:24 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-11-30 09:44:15 +0200 |
commit | a229dc15e22b77f055d55c873e242e8627b7b1ba (patch) | |
tree | 579f48f3df86fdbd17c2b95b1959d9c6d0e6ca35 /rpmio | |
parent | 48f32ae0baad160bdce43c7875e46c584e2e684f (diff) | |
download | rpm-a229dc15e22b77f055d55c873e242e8627b7b1ba.tar.gz rpm-a229dc15e22b77f055d55c873e242e8627b7b1ba.tar.bz2 rpm-a229dc15e22b77f055d55c873e242e8627b7b1ba.zip |
Avoid deprecation warnings from NSS >= 3.14
- NSS >= 3.14 introduces support for DSA2 and marks DSA_SUBPRIME_LEN
as deprecated. Use explicit DSA1_SUBPRIME_LEN (we only support DSA1
for now) instead where available, add compatibility define for
older versions.
- Also directly include <blapit.h> where its defined - blabit.h gets
included via cryptohi.h but being explicit about it avoids having
to redefine it again "just in case".
(cherry picked from commit 73be0fc7d9faab9f1120e2979f2ca1feed522195)
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/digest_nss.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/rpmio/digest_nss.c b/rpmio/digest_nss.c index 700bc85bf..be3b652ea 100644 --- a/rpmio/digest_nss.c +++ b/rpmio/digest_nss.c @@ -5,6 +5,7 @@ #include <sechash.h> #include <keyhi.h> #include <cryptohi.h> +#include <blapit.h> #include <rpm/rpmlog.h> #include "rpmio/digest.h" @@ -297,25 +298,26 @@ static SECKEYPublicKey *pgpNewPublicKey(KeyType type) return key; } -#ifndef DSA_SUBPRIME_LEN -#define DSA_SUBPRIME_LEN 20 +/* compatibility with nss < 3.14 */ +#ifndef DSA1_SUBPRIME_LEN +#define DSA1_SUBPRIME_LEN DSA_SUBPRIME_LEN #endif static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num, const uint8_t *p, const uint8_t *pend) { SECItem *sig = pgpsig->data; - int lbits = DSA_SUBPRIME_LEN * 8; + int lbits = DSA1_SUBPRIME_LEN * 8; int rc = 1; /* assume failure */ switch (num) { case 0: - sig = pgpsig->data = SECITEM_AllocItem(NULL, NULL, 2*DSA_SUBPRIME_LEN); - memset(sig->data, 0, 2 * DSA_SUBPRIME_LEN); + sig = pgpsig->data = SECITEM_AllocItem(NULL, NULL, 2*DSA1_SUBPRIME_LEN); + memset(sig->data, 0, 2 * DSA1_SUBPRIME_LEN); rc = pgpMpiSet(lbits, sig->data, p, pend); break; case 1: - if (sig && pgpMpiSet(lbits, sig->data+DSA_SUBPRIME_LEN, p, pend) == 0) { + if (sig && pgpMpiSet(lbits, sig->data+DSA1_SUBPRIME_LEN, p, pend) == 0) { SECItem *signew = SECITEM_AllocItem(NULL, NULL, 0); if (signew && DSAU_EncodeDerSig(signew, sig) == SECSuccess) { SECITEM_FreeItem(sig, PR_TRUE); |