Ejemplo n.º 1
0
bool EndlessISO::VerifySquashFS(const CString & image, const CString & signatureFilename, HashingCallback_t hashingCallback, LPVOID hashingContext)
{
    FUNCTION_ENTER;

    auto extractor = SevenZip::SevenZipExtractor(pImpl->sevenZip, image.GetString());
    extractor.SetCompressionFormat(SevenZip::CompressionFormat::SquashFS);

    UINT32 i = 0;
    auto size = extractor.GetOrigSizes()[i];
    std::unique_ptr<SevenZip::SevenZipExtractStream> stream(extractor.ExtractStream(i));

    auto reader = [&](void *buf, size_t bytes) {
        return stream->Read(buf, (UINT32)bytes);
    };
    return VerifyStream(reader, size, signatureFilename, hashingCallback, hashingContext);
}
Ejemplo n.º 2
0
ptr<StreamHasher::VerifyStream> StreamHasher::CreateVerifyStream(ptr<InputStream> sourceDataStream, ptr<InputStream> sourceHashStream)
{
	return NEW(VerifyStream(this, sourceDataStream, sourceHashStream));
}