Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions zynqmp/src/bootimage-zynqmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void ZynqMpBootImage::ParseBootImage(PartitionBifOptions* it)
{
PartitionHeader* ph = (*partHdr);
uint32_t encrPartLen = ph->GetEncryptedPartitionLength();
size_t imageAuthBlock = image->GetAuthBlock();
size_t imageAuthBlock = newImage->GetAuthBlock();
int acSize = 1;
if (imageAuthBlock != 0)
{
Expand All @@ -342,7 +342,7 @@ void ZynqMpBootImage::ParseBootImage(PartitionBifOptions* it)
if (ph->IsAuthCertPresent())
{
LOG_INFO("Loading AC context for section %s ", ph->section->Name.c_str());
image->SetAuthenticationType(Authentication::RSA);
newImage->SetAuthenticationType(Authentication::RSA);
options.bifOptions->SetHeaderAC(true);
/* load in previous certificate data */
for (int i = 0; i < acSize; i++)
Expand All @@ -360,7 +360,7 @@ void ZynqMpBootImage::ParseBootImage(PartitionBifOptions* it)
}
}
}
offset = image->GetNextImageHeaderOffset();
offset = newImage->GetNextImageHeaderOffset();
} while (offset != 0);
}

Expand Down
21 changes: 12 additions & 9 deletions zynqmp/src/imageheadertable-zynqmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,24 @@ ZynqMpImageHeader::ZynqMpImageHeader(std::ifstream& ifs)
hdr->ReadHeader(ifs);
hdr->ReadData(ifs);

/* Ownership transfers to partitionHeaderList; keep a non-owning pointer
to read the header fields below, since release() nulls the unique_ptr */
ZynqMpPartitionHeader* hdrPtr = hdr.get();
partitionHeaderList.push_back(hdr.release());

Bootloader = false;
Alignment = 0;
Offset = 0;
Reserve = 0;

destCpu = (DestinationCPU::Type)hdr->GetDestinationCpu();
exceptionLevel = (ExceptionLevel::Type)hdr->GetExceptionLevel();
trustzone = (TrustZone::Type)hdr->GetTrustZone();
early_handoff = hdr->GetEarlyHandoff();
hivec = hdr->GetHivec();
authBlock = hdr->GetAuthblock();
destCpu = (DestinationCPU::Type)hdrPtr->GetDestinationCpu();
exceptionLevel = (ExceptionLevel::Type)hdrPtr->GetExceptionLevel();
trustzone = (TrustZone::Type)hdrPtr->GetTrustZone();
early_handoff = hdrPtr->GetEarlyHandoff();
hivec = hdrPtr->GetHivec();
authBlock = hdrPtr->GetAuthblock();

switch (hdr->GetDestinationDevice())
switch (hdrPtr->GetDestinationDevice())
{
case DestinationDevice::DEST_DEV_PS:
SetDomain(Domain::PS);
Expand All @@ -145,10 +148,10 @@ ZynqMpImageHeader::ZynqMpImageHeader(std::ifstream& ifs)
break;

case DestinationDevice::DEST_DEV_NONE:
LOG_DEBUG(DEBUG_STAMP, "Bad destination field in imported partition header - %s", hdr->section->Name.c_str());
LOG_DEBUG(DEBUG_STAMP, "Bad destination field in imported partition header - %s", hdrPtr->section->Name.c_str());
LOG_ERROR("Failure parsing imported bootimage");
}
offset += hdr->GetPartitionHeaderSize();
offset += hdrPtr->GetPartitionHeaderSize();
}
}

Expand Down