Skip to content

Clear PIN from buffer on destruction#138

Open
metsma wants to merge 1 commit intomainfrom
verify
Open

Clear PIN from buffer on destruction#138
metsma wants to merge 1 commit intomainfrom
verify

Conversation

@metsma
Copy link
Contributor

@metsma metsma commented Oct 17, 2025

WE2-1055

Signed-off-by: Raul Metsma raul@metsma.ee

@mrts
Copy link
Member

mrts commented Oct 31, 2025

Isn't it better to use a separate dedicated class for VERIFY PIN?

See #84

@metsma
Copy link
Contributor Author

metsma commented Nov 1, 2025

Isn't it better to use a separate dedicated class for VERIFY PIN?

See #84

It has separate struct?

@mrts mrts mentioned this pull request Feb 23, 2026
PCSC_CPP_DEFAULT_MOVE(VerifyApdu);
constexpr ~VerifyApdu() noexcept final { std::fill(d.begin(), d.end(), byte_type(0)); }
};
return VerifyApdu {0x00, 0x20, 0x00, p2, std::move(pin)};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slicing, because you return VerifyApdu by value from CommandApdu verify().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no additional member variables?

Copy link
Member

@mrts mrts Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but the VerifyApdu destructor will not be called and CommandApdu destructor will be called instead because of slicing as far as I understand. Try printing something to stdout in VerifyApdu destructor to verify.

WE2-1055

Signed-off-by: Raul Metsma <raul@metsma.ee>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants