+ bool VerifyVendor(std::string const &Message);
+
+ virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE;
+
+ public:
+ // This refers more to the Transaction-Manager than the actual file
+ bool IMSHit;
+
+ virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE;
+ virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
+ virtual bool HashesRequired() const APT_OVERRIDE;
+
+ // transaction code
+ void Add(pkgAcqTransactionItem * const I);
+ void AbortTransaction();
+ bool TransactionHasError() const;
+ void CommitTransaction();
+
+ /** \brief Stage (queue) a copy action when the transaction is committed
+ */
+ void TransactionStageCopy(pkgAcqTransactionItem * const I,
+ const std::string &From,
+ const std::string &To);
+ /** \brief Stage (queue) a removal action when the transaction is committed
+ */
+ void TransactionStageRemoval(pkgAcqTransactionItem * const I, const std::string &FinalFile);
+
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const APT_OVERRIDE;
+
+ pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ std::vector<IndexTarget> const &IndexTargets,
+ IndexTarget const &DataTarget);
+ virtual ~pkgAcqMetaBase();
+};
+ /*}}}*/
+/** \brief An item that is responsible for downloading the meta-index {{{
+ * file (i.e., Release) itself and verifying its signature.
+ *
+ * Once the download and verification are complete, the downloads of
+ * the individual index files are queued up using pkgAcqDiffIndex.
+ * If the meta-index file had a valid signature, the expected hashsums
+ * of the index files will be the md5sums listed in the meta-index;
+ * otherwise, the expected hashsums will be "" (causing the
+ * authentication of the index files to be bypassed).
+ */
+class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
+{
+ void * const d;
+ protected:
+ IndexTarget const DetachedSigTarget;
+
+ /** \brief delayed constructor */
+ void Init(std::string const &URIDesc, std::string const &ShortDesc);
+
+ public:
+ virtual std::string DescURI() const APT_OVERRIDE;
+
+ // Specialized action members
+ virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual void Done(std::string const &Message, HashStringList const &Hashes,
+ pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual void Finished() APT_OVERRIDE;
+
+ /** \brief Create a new pkgAcqMetaIndex. */
+ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
+ std::vector<IndexTarget> const &IndexTargets);
+ virtual ~pkgAcqMetaIndex();
+
+ friend class pkgAcqMetaSig;
+};
+ /*}}}*/
+/** \brief An acquire item that downloads the detached signature {{{
+ * of a meta-index (Release) file, then queues up the release
+ * file itself.
+ *
+ * \todo Why protected members?
+ *
+ * \sa pkgAcqMetaIndex
+ */
+class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
+{
+ void * const d;
+
+ pkgAcqMetaIndex * const MetaIndex;
+
+ /** \brief The file we use to verify the MetaIndexFile with (not always set!) */
+ std::string MetaIndexFileSignature;
+
+ protected:
+
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const APT_OVERRIDE;
+
+ public:
+ virtual bool HashesRequired() const APT_OVERRIDE { return false; }
+
+ // Specialized action members
+ virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual void Done(std::string const &Message, HashStringList const &Hashes,
+ pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual std::string Custom600Headers() const APT_OVERRIDE;
+
+ /** \brief Create a new pkgAcqMetaSig. */
+ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex);
+ virtual ~pkgAcqMetaSig();
+};
+ /*}}}*/
+/** \brief An item repsonsible for downloading clearsigned metaindexes {{{*/
+class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
+{
+ void * const d;
+
+ IndexTarget const ClearsignedTarget;
+ IndexTarget const DetachedDataTarget;
+
+ public:
+ /** \brief A package-system-specific parser for the meta-index file. */
+ metaIndex *MetaIndexParser;
+ metaIndex *LastMetaIndexParser;
+
+ virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual std::string Custom600Headers() const APT_OVERRIDE;
+ virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual void Done(std::string const &Message, HashStringList const &Hashes,
+ pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+
+ /** \brief Create a new pkgAcqMetaClearSig. */
+ pkgAcqMetaClearSig(pkgAcquire * const Owner,
+ IndexTarget const &ClearsignedTarget,
+ IndexTarget const &DetachedDataTarget,
+ IndexTarget const &DetachedSigTarget,
+ std::vector<IndexTarget> const &IndexTargets,
+ metaIndex * const MetaIndexParser);
+ virtual ~pkgAcqMetaClearSig();
+};
+ /*}}}*/
+/** \brief Common base class for all classes that deal with fetching indexes {{{*/
+class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem
+{
+ void * const d;
+
+ public:
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const APT_OVERRIDE;
+
+ pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
+ IndexTarget const &Target);
+ virtual ~pkgAcqBaseIndex();