added cert logic

This commit is contained in:
mrdude2478 2023-09-20 23:09:07 +01:00
parent 0901c78d34
commit effbc835c8
2 changed files with 23 additions and 15 deletions

View File

@ -83,14 +83,18 @@ namespace tin::install::nsp
{
const PFS0FileEntry* fileEntry = this->GetFileEntry(i);
std::string name(this->GetFileEntryName(fileEntry));
auto foundExtension = name.substr(name.find(".") + 1);
// fix cert filname extension becoming corrupted when xcz/nsz is installing certs/ticks.
int pos = 0;
std::string mystr = name;
pos = mystr.find_last_of('.');
mystr = mystr.substr(5, pos);
//auto foundExtension = name.substr(name.find(".") + 1);
auto foundExtension = mystr.substr(mystr.find(".") + 1);
std::string cert ("cert");
std::size_t found = name.find(cert);
if (found!=std::string::npos){
int pos = 0;
std::string mystr = name;
pos = mystr.find_last_of('.');
mystr = mystr.substr(5, pos);
foundExtension = mystr.substr(mystr.find(".") + 1);
}
if (foundExtension == extension)
entryList.push_back(fileEntry);

View File

@ -158,15 +158,19 @@ namespace tin::install::xci
{
const HFS0FileEntry* fileEntry = this->GetFileEntry(i);
std::string name(this->GetFileEntryName(fileEntry));
auto foundExtension = name.substr(name.find(".") + 1);
// fix cert filname extension becoming corrupted when xcz/nsz is installing certs/ticks.
int pos = 0;
std::string mystr = name;
pos = mystr.find_last_of('.');
mystr = mystr.substr(5, pos);
//auto foundExtension = name.substr(name.find(".") + 1);
auto foundExtension = mystr.substr(mystr.find(".") + 1);
std::string cert ("cert");
std::size_t found = name.find(cert);
if (found!=std::string::npos){
int pos = 0;
std::string mystr = name;
pos = mystr.find_last_of('.');
mystr = mystr.substr(5, pos);
foundExtension = mystr.substr(mystr.find(".") + 1);
}
if (foundExtension == extension)
entryList.push_back(fileEntry);
}