31 const std::string &base_url,
32 const std::string &repository_name,
33 const uint64_t minimum_timestamp,
39 const bool probe_hosts = base_url ==
"";
46 string certificate_url = base_url +
"/";
50 &certificate_hash, &certificate_memsink);
62 "repository name does not match (found %s, expected %s)",
64 repository_name.c_str());
87 retval_dl = download_manager->
Fetch(&download_certificate);
110 "failed to verify repository manifest");
116 retval_wl = whitelist.
LoadUrl(base_url);
119 "whitelist verification failed (%d): %s", retval_wl,
128 "failed to verify repository signature against whitelist (%d): %s",
163 const std::string &repository_name,
164 const uint64_t minimum_timestamp,
170 const bool probe_hosts = base_url ==
"";
172 const string manifest_url = base_url + string(
"/.cvmfspublished");
177 retval_dl = download_manager->
Fetch(&download_manifest);
180 "failed to download repository manifest (%d - %s)", retval_dl,
186 return DoVerify(manifest_memsink.
data(), manifest_memsink.
pos(), base_url,
187 repository_name, minimum_timestamp, base_catalog,
188 signature_manager, download_manager, ensemble);
195 Failures Fetch(
const std::string &base_url,
const std::string &repository_name,
196 const uint64_t minimum_timestamp,
const shash::Any *base_catalog,
201 DoFetch(base_url, repository_name, minimum_timestamp, base_catalog,
202 signature_manager, download_manager, ensemble);
209 "failed to fetch manifest (%d - %s), trying another stratum 1",
212 result =
DoFetch(base_url, repository_name, minimum_timestamp, base_catalog,
213 signature_manager, download_manager, ensemble);
224 const std::string &base_url,
const std::string &repository_name,
225 const uint64_t minimum_timestamp,
230 unsigned char *manifest_copy =
231 reinterpret_cast<unsigned char *
>(smalloc(manifest_size));
232 memcpy(manifest_copy, manifest_data, manifest_size);
233 return DoVerify(manifest_copy, manifest_size, base_url, repository_name,
234 minimum_timestamp, base_catalog, signature_manager,
235 download_manager, ensemble);
const char * Code2Ascii(const ObjectFetcherFailures::Failures error)
const manifest::Manifest * manifest() const
static Manifest * LoadMem(const unsigned char *buffer, const unsigned length)
Failures Verify(unsigned char *manifest_data, size_t manifest_size, const std::string &base_url, const std::string &repository_name, const uint64_t minimum_timestamp, const shash::Any *base_catalog, signature::SignatureManager *signature_manager, download::DownloadManager *download_manager, ManifestEnsemble *ensemble)
unsigned char * raw_manifest_buf
Failures LoadUrl(const std::string &base_url)
Failures VerifyLoadedCertificate() const
bool LoadCertificateMem(const unsigned char *buffer, const unsigned buffer_size)
void CopyBuffers(unsigned *plain_size, unsigned char **plain_buf, unsigned *pkcs7_size, unsigned char **pkcs7_buf) const
std::string MakeCertificatePath() const
assert((mem||(size==0))&&"Out Of Memory")
unsigned whitelist_pkcs7_size
static Failures DoFetch(const std::string &base_url, const std::string &repository_name, const uint64_t minimum_timestamp, const shash::Any *base_catalog, signature::SignatureManager *signature_manager, download::DownloadManager *download_manager, ManifestEnsemble *ensemble)
virtual void FetchCertificate(const shash::Any &hash)
unsigned char * whitelist_buf
const char * Code2Ascii(const Failures error)
unsigned raw_manifest_size
uint64_t publish_timestamp() const
std::string repository_name() const
Failures Fetch(const std::string &base_url, const std::string &repository_name, const uint64_t minimum_timestamp, const shash::Any *base_catalog, signature::SignatureManager *signature_manager, download::DownloadManager *download_manager, ManifestEnsemble *ensemble)
shash::Any certificate() const
const char * Code2Ascii(const Failures error)
unsigned char * whitelist_pkcs7_buf
shash::Any catalog_hash() const
const whitelist::Whitelist * whitelist() const
static Failures DoVerify(unsigned char *manifest_data, size_t manifest_size, const std::string &base_url, const std::string &repository_name, const uint64_t minimum_timestamp, const shash::Any *base_catalog, signature::SignatureManager *signature_manager, download::DownloadManager *download_manager, ManifestEnsemble *ensemble)
Failures Fetch(JobInfo *info)
shash::Md5 root_path() const
bool VerifyLetter(const unsigned char *buffer, const unsigned buffer_size, const bool by_rsa)
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)