mirror of
https://github.com/jakcron/nstool
synced 2024-11-15 02:06:40 +00:00
[es] Fixed a bug where string fields were not imported correctly.
This commit is contained in:
parent
2f9cba6d40
commit
3a4259d2cc
2 changed files with 3 additions and 3 deletions
|
@ -129,10 +129,10 @@ void es::CertificateBody::fromBytes(const byte_t* src, size_t size)
|
|||
hdr = (const sCertificateHeader*)mRawBinary.data();
|
||||
|
||||
if (hdr->issuer[0] != 0)
|
||||
mIssuer = std::string(hdr->issuer, cert::kIssuerSize);
|
||||
mIssuer = std::string(hdr->issuer, _MIN(strlen(hdr->issuer), cert::kIssuerSize));
|
||||
mPublicKeyType = (cert::PublicKeyType)hdr->key_type.get();
|
||||
if (hdr->subject[0] != 0)
|
||||
mSubject = std::string(hdr->subject, cert::kSubjectSize);
|
||||
mSubject = std::string(hdr->subject, _MIN(strlen(hdr->subject), cert::kSubjectSize));
|
||||
mCertId = hdr->cert_id.get();
|
||||
|
||||
// save public key
|
||||
|
|
|
@ -112,7 +112,7 @@ void es::TicketBody_V2::fromBytes(const byte_t * bytes, size_t len)
|
|||
throw fnd::Exception(kModuleName, "Unsupported format version");
|
||||
}
|
||||
|
||||
mIssuer.append(body->issuer, ticket::kIssuerSize);
|
||||
mIssuer = std::string(body->issuer, _MIN(strlen(body->issuer), ticket::kIssuerSize));
|
||||
memcpy(mEncTitleKey, body->enc_title_key, ticket::kEncTitleKeySize);
|
||||
mEncType = (ticket::TitleKeyEncType)body->title_key_enc_type;
|
||||
mTicketVersion = body->ticket_version.get();
|
||||
|
|
Loading…
Reference in a new issue