- the information is already available through rpmfiFDigest() but that
requires valid iteration index to be active, whereas the digest algo
is per info set, not per file
fdSetCpioPos(fsm->cfd, 0);
}
fsm->iter = mapInitIterator(ts, te, fi);
- fsm->digestalgo = fi->digestalgo;
+ fsm->digestalgo = rpmfiDigestAlgo(fi);
if (fsm->goal == FSM_PKGINSTALL || fsm->goal == FSM_PKGBUILD) {
void * ptr;
return (algo == PGPHASHALGO_MD5) ? digest : NULL;
}
+pgpHashAlgo rpmfiDigestAlgo(rpmfi fi)
+{
+ return fi ? fi->digestalgo : 0;
+}
+
const unsigned char * rpmfiFDigestIndex(rpmfi fi, int ix, pgpHashAlgo *algo, size_t *len)
{
const unsigned char *digest = NULL;
rpmfileState rpmfiFState(rpmfi fi);
/** \ingroup rpmfi
+ * Return digest algorithm of a file info set.
+ * @param fi file info set
+ * @return digest algorithm of file info set, 0 on invalid
+ */
+pgpHashAlgo rpmfiDigestAlgo(rpmfi fi);
+
+/** \ingroup rpmfi
* Return current file (binary) digest of file info set.
* @param fi file info set
* @retval algo digest hash algoritm used (pass NULL to ignore)