RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 14-Dec-2008 02:32:06 Branch: HEAD Handle: 2008121401320501 Modified files: rpm CHANGES rpm/rpmio rpmbc.c rpmgc.c rpmnss.c rpmpgp.h rpmssl.c Log: - stub in pgpImpl{Set,Verify}ECDSA methods. Summary: Revision Changes Path 1.2687 +1 -0 rpm/CHANGES 2.15 +25 -0 rpm/rpmio/rpmbc.c 2.14 +26 -0 rpm/rpmio/rpmgc.c 1.23 +25 -0 rpm/rpmio/rpmnss.c 2.79 +20 -0 rpm/rpmio/rpmpgp.h 2.21 +26 -0 rpm/rpmio/rpmssl.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2686 -r1.2687 CHANGES --- rpm/CHANGES 14 Dec 2008 01:02:58 -0000 1.2686 +++ rpm/CHANGES 14 Dec 2008 01:32:05 -0000 1.2687 @@ -1,5 +1,6 @@ 5.2a2 -> 5.2a3: + - jbj: stub in pgpImpl{Set,Verify}ECDSA methods. - jbj: rpmnss: fix: correct RSA/SHA512 cut-n-paste error. - jbj: rpmssl: don't bother with (unused) NID_foo. - jbj: use digest names in debugging messages. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmbc.c ============================================================================ $ cvs diff -u -r2.14 -r2.15 rpmbc.c --- rpm/rpmio/rpmbc.c 13 Dec 2008 19:57:31 -0000 2.14 +++ rpm/rpmio/rpmbc.c 14 Dec 2008 01:32:05 -0000 2.15 @@ -139,6 +139,30 @@ return rc; } +static +int rpmbcSetECDSA(/*...@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) + /*...@modifies dig @*/ +{ + int rc = 1; /* XXX always fail. */ + int xx; + +assert(sigp->hash_algo == rpmDigestAlgo(ctx)); + xx = rpmDigestFinal(ctx, (void **)NULL, NULL, 0); + + /* Compare leading 16 bits of digest for quick check. */ + + return rc; +} + +static +int rpmbcVerifyECDSA(pgpDig dig) + /*...@*/ +{ + int rc = 0; /* XXX always fail. */ + + return rc; +} + /** */ static /*...@observer@*/ @@ -303,6 +327,7 @@ struct pgpImplVecs_s rpmbcImplVecs = { rpmbcSetRSA, rpmbcVerifyRSA, rpmbcSetDSA, rpmbcVerifyDSA, + rpmbcSetECDSA, rpmbcVerifyECDSA, rpmbcMpiItem, rpmbcClean, rpmbcFree, rpmbcInit }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmgc.c ============================================================================ $ cvs diff -u -r2.13 -r2.14 rpmgc.c --- rpm/rpmio/rpmgc.c 13 Dec 2008 19:57:31 -0000 2.13 +++ rpm/rpmio/rpmgc.c 14 Dec 2008 01:32:05 -0000 2.14 @@ -208,6 +208,31 @@ return (rc ? 0 : 1); } + +static +int rpmgcSetECDSA(/*...@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) + /*...@modifies dig @*/ +{ + int rc = 1; /* XXX always fail. */ + int xx; + +assert(sigp->hash_algo == rpmDigestAlgo(ctx)); + xx = rpmDigestFinal(ctx, (void **)NULL, NULL, 0); + + /* Compare leading 16 bits of digest for quick check. */ + + return rc; +} + +static +int rpmgcVerifyECDSA(pgpDig dig) + /*...@*/ +{ + int rc = 0; /* XXX always fail. */ + + return rc; +} + /*...@-globuse -mustmod @*/ static int rpmgcMpiItem(/*...@unused@*/ const char * pre, pgpDig dig, int itemno, @@ -350,6 +375,7 @@ struct pgpImplVecs_s rpmgcImplVecs = { rpmgcSetRSA, rpmgcVerifyRSA, rpmgcSetDSA, rpmgcVerifyDSA, + rpmgcSetECDSA, rpmgcVerifyECDSA, rpmgcMpiItem, rpmgcClean, rpmgcFree, rpmgcInit }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmnss.c ============================================================================ $ cvs diff -u -r1.22 -r1.23 rpmnss.c --- rpm/rpmio/rpmnss.c 14 Dec 2008 01:02:59 -0000 1.22 +++ rpm/rpmio/rpmnss.c 14 Dec 2008 01:32:06 -0000 1.23 @@ -132,6 +132,30 @@ return rc; } +static +int rpmnssSetECDSA(/*...@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) + /*...@modifies dig @*/ +{ + int rc = 1; /* XXX always fail. */ + int xx; + +assert(sigp->hash_algo == rpmDigestAlgo(ctx)); + xx = rpmDigestFinal(ctx, (void **)NULL, NULL, 0); + + /* Compare leading 16 bits of digest for quick check. */ + + return rc; +} + +static +int rpmnssVerifyECDSA(pgpDig dig) + /*...@*/ +{ + int rc = 0; /* XXX always fail. */ + + return rc; +} + /** * @return 0 on success */ @@ -392,6 +416,7 @@ struct pgpImplVecs_s rpmnssImplVecs = { rpmnssSetRSA, rpmnssVerifyRSA, rpmnssSetDSA, rpmnssVerifyDSA, + rpmnssSetECDSA, rpmnssVerifyECDSA, rpmnssMpiItem, rpmnssClean, rpmnssFree, rpmnssInit }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmpgp.h ============================================================================ $ cvs diff -u -r2.78 -r2.79 rpmpgp.h --- rpm/rpmio/rpmpgp.h 13 Dec 2008 19:57:31 -0000 2.78 +++ rpm/rpmio/rpmpgp.h 14 Dec 2008 01:32:06 -0000 2.79 @@ -1630,6 +1630,8 @@ pgpImplVerify_t _pgpVerifyRSA; pgpImplSet_t _pgpSetDSA; pgpImplVerify_t _pgpVerifyDSA; + pgpImplSet_t _pgpSetECDSA; + pgpImplVerify_t _pgpVerifyECDSA; pgpImplMpiItem_t _pgpMpiItem; pgpImplClean_t _pgpClean; pgpImplFree_t _pgpFree; @@ -1681,6 +1683,24 @@ /** */ /*...@unused@*/ static inline +int pgpImplSetECDSA(/*...@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) + /*...@modifies ctx, dig @*/ +{ + return (*pgpImplVecs->_pgpSetECDSA) (ctx, dig, sigp); +} + +/** + */ +/*...@unused@*/ static inline +int pgpImplVerifyECDSA(pgpDig dig) + /*...@*/ +{ + return (*pgpImplVecs->_pgpVerifyECDSA) (dig); +} + +/** + */ +/*...@unused@*/ static inline int pgpImplMpiItem(const char * pre, pgpDig dig, int itemno, const rpmuint8_t * p, /*...@null@*/ const rpmuint8_t * pend) /*...@modifies dig @*/ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmssl.c ============================================================================ $ cvs diff -u -r2.20 -r2.21 rpmssl.c --- rpm/rpmio/rpmssl.c 14 Dec 2008 00:34:27 -0000 2.20 +++ rpm/rpmio/rpmssl.c 14 Dec 2008 01:32:06 -0000 2.21 @@ -213,6 +213,31 @@ return rc; } + +static +int rpmsslSetECDSA(/*...@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sigp) + /*...@modifies dig @*/ +{ + int rc = 1; /* XXX always fail. */ + int xx; + +assert(sigp->hash_algo == rpmDigestAlgo(ctx)); + xx = rpmDigestFinal(ctx, (void **)NULL, NULL, 0); + + /* Compare leading 16 bits of digest for quick check. */ + + return rc; +} + +static +int rpmsslVerifyECDSA(pgpDig dig) + /*...@*/ +{ + int rc = 0; /* XXX always fail. */ + + return rc; +} + static int rpmsslMpiItem(/*...@unused@*/ const char * pre, pgpDig dig, int itemno, const rpmuint8_t * p, @@ -321,6 +346,7 @@ struct pgpImplVecs_s rpmsslImplVecs = { rpmsslSetRSA, rpmsslVerifyRSA, rpmsslSetDSA, rpmsslVerifyDSA, + rpmsslSetECDSA, rpmsslVerifyECDSA, rpmsslMpiItem, rpmsslClean, rpmsslFree, rpmsslInit }; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org