Skip to content

Commit

Permalink
Fix for possible missing wc_GetPkcs8TraditionalOffset.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarske committed Jan 2, 2025
1 parent 3c5c512 commit 4b80e92
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tpm2_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2822,8 +2822,10 @@ int wolfTPM2_DecodeRsaDer(const byte* der, word32 derSz,
rc = wc_InitRsaKey(key, NULL);
if (rc == 0) {
idx = 0;
#ifdef HAVE_PKCS8
/* skip PKCS8 header */
(void)wc_GetPkcs8TraditionalOffset((byte*)der, &idx, derSz);
#endif
rc = wc_RsaPrivateKeyDecode(der, &idx, key, derSz);
if (rc == 0) {
isPrivateKey = 1;
Expand Down

0 comments on commit 4b80e92

Please sign in to comment.