diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2012-11-29 10:43:24 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2012-12-07 14:35:50 +0200 |
commit | df74b7aee1f821e1f96494c84d580413c76a8c64 (patch) | |
tree | 6bfd25204dda538f325d47baf66e6f556417785a | |
parent | b36e8ac5f58869d13f6c36680b475a9f3b570cee (diff) | |
download | rpm-df74b7aee1f821e1f96494c84d580413c76a8c64.tar.gz rpm-df74b7aee1f821e1f96494c84d580413c76a8c64.tar.bz2 rpm-df74b7aee1f821e1f96494c84d580413c76a8c64.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)
-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); |