Skip to content

Commit

Permalink
Move digest functionality to the internal OpenPGP implementation
Browse files Browse the repository at this point in the history
rpmio/digest.h contains definitions that are only used by the interal
OpenPGP parser, and are not required by the future Sequoia backend.
Move those definitions into rpmio/rpmpgp_internal.h.

Fixes #2006.

(cherry picked c3e9882)
  • Loading branch information
nwalfield authored and pmatilai committed Aug 17, 2022
1 parent f6b9531 commit 317da93
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <rpm/rpmmacro.h>
#include <rpm/rpmbase64.h>

#include "rpmio/digest.h"
#include "rpmio/rpmpgpval.h"
#include "lib/manifest.h"
#include "lib/misc.h"
#include "lib/signature.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/rpmts.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <rpm/rpmsq.h>
#include <rpm/rpmte.h>

#include "rpmio/digest.h"
#include "rpmio/rpmpgpval.h"
#include "lib/rpmal.h"
#include "lib/rpmchroot.h"
#include "lib/rpmplugins.h"
Expand Down
2 changes: 1 addition & 1 deletion lib/rpmvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <rpm/rpmmacro.h>
#include <rpm/rpmlog.h>
#include "lib/rpmvs.h"
#include "rpmio/digest.h"
#include "rpmio/rpmpgpval.h"

#include "debug.h"

Expand Down
5 changes: 3 additions & 2 deletions rpmio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ AM_CPPFLAGS += -DLOCALSTATEDIR="\"$(localstatedir)\""
usrlibdir = $(libdir)
usrlib_LTLIBRARIES = librpmio.la
librpmio_la_SOURCES = \
argv.c base64.c digest.h digest.c expression.c macro.c \
argv.c base64.c digest.c expression.c macro.c \
rpmhook.c rpmio.c rpmlog.c rpmmalloc.c rgetopt.c \
rpmpgp.c rpmpgpval.h rpmsq.c rpmsw.c url.c \
rpmio_internal.h rpmhook.h rpmvercmp.c rpmver.c \
rpmstring.c rpmfileutil.c rpmglob.c \
rpmkeyring.c rpmstrpool.c rpmmacro_internal.h \
rpmlua.c rpmlua.h lposix.c lposix.h rpmpgp_internal.c
rpmlua.c rpmlua.h lposix.c lposix.h \
rpmpgp_internal.c rpmpgp_internal.h

if WITH_OPENSSL
librpmio_la_SOURCES += digest_openssl.c
Expand Down
2 changes: 1 addition & 1 deletion rpmio/digest.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "system.h"

#include "rpmio/digest.h"
#include "rpmio/rpmpgp_internal.h"

#include "debug.h"

Expand Down
2 changes: 1 addition & 1 deletion rpmio/digest_libgcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <gcrypt.h>

#include <rpm/rpmcrypto.h>
#include "rpmio/digest.h"
#include "rpmio/rpmpgp_internal.h"
#include "rpmio/rpmio_internal.h"
#include "debug.h"

Expand Down
2 changes: 1 addition & 1 deletion rpmio/digest_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <openssl/dsa.h>
#include <rpm/rpmcrypto.h>

#include "rpmio/digest.h"
#include "rpmio/rpmpgp_internal.h"


/* Compatibility functions for OpenSSL 1.0.2 */
Expand Down
2 changes: 0 additions & 2 deletions rpmio/rpmkeyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
#include <rpm/rpmkeyring.h>
#include <rpm/rpmbase64.h>

#include "rpmio/digest.h"

#include "debug.h"

int _print_pkts = 0;
Expand Down
1 change: 0 additions & 1 deletion rpmio/rpmpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <rpm/rpmstring.h>
#include <rpm/rpmlog.h>

#include "rpmio/digest.h"
#include "rpmio/rpmpgpval.h"
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */

Expand Down
2 changes: 1 addition & 1 deletion rpmio/rpmpgp_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <rpm/rpmlog.h>
#include <rpm/rpmbase64.h>

#include "rpmio/digest.h"
#include "rpmio/rpmpgpval.h"
#include "rpmio/rpmpgp_internal.h"
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */

#include "debug.h"
Expand Down
12 changes: 6 additions & 6 deletions rpmio/digest.h → rpmio/rpmpgp_internal.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _RPMDIGEST_H
#define _RPMDIGEST_H
#ifndef _RPMPGP_INTERNAL_H
#define _RPMPGP_INTERNAL_H

#include <rpm/rpmpgp.h>
#include "rpmio/rpmpgpval.h"

typedef struct pgpDigAlg_s * pgpDigAlg;

Expand All @@ -23,7 +23,7 @@ pgpDigAlg pgpPubkeyNew(int algo, int curve);

pgpDigAlg pgpSignatureNew(int algo);

pgpDigAlg pgpDigAlgFree(pgpDigAlg da);
pgpDigAlg pgpDigAlgFree(pgpDigAlg alg);

/** \ingroup rpmpgp
* Return no. of bits in a multiprecision integer.
Expand All @@ -46,5 +46,5 @@ size_t pgpMpiLen(const uint8_t *p)
{
return (2 + ((pgpMpiBits(p)+7)>>3));
}
#endif /* _RPMDIGEST_H */

#endif /* _RPMPGP_INTERNAL_H */
6 changes: 3 additions & 3 deletions rpmio/rpmpgpval.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _RPMPGP_INTERNAL_H
#define _RPMPGP_INTERNAL_H
#ifndef _RPMPGPVAL_H
#define _RPMPGPVAL_H

#include <rpm/rpmpgp.h>

Expand Down Expand Up @@ -170,4 +170,4 @@ static struct pgpValTbl_s const pgpArmorKeyTbl[] = {
{ -1, "Unknown armor key" }
};

#endif /* _RPMPGP_INTERNAL_H */
#endif /* _RPMPGPVAL_H */

0 comments on commit 317da93

Please sign in to comment.