Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manipulation of ASN1_STRING #193

Merged
merged 1 commit into from
Sep 18, 2021
Merged

Conversation

rkta
Copy link
Contributor

@rkta rkta commented Sep 13, 2021

Take the correct type from ASN1_STRING_get0_data() to fix a warning.
IA5Strings are ASCII, we do not need to care about signedness.

Since the pointer returned by ASN1_STRING_get0_data() points to internal
memory of the ASN1_STRING we are not allowed to manipulate the data.
Also it is not guaranteed that the data is null terminated. Copy the
data to our own buffer and make sure it is null terminated before using
it.

Take the correct type from ASN1_STRING_get0_data() to fix a warning.
IA5Strings are ASCII, we do not need to care about signedness.

Since the pointer returned by ASN1_STRING_get0_data() points to internal
memory of the ASN1_STRING we are not allowed to manipulate the data.
Also it is not guaranteed that the data is null terminated. Copy the
data to our own buffer and make sure it is null terminated before using
it.
@rkta rkta closed this Sep 13, 2021
@rkta rkta reopened this Sep 13, 2021
@tats tats merged commit b8a4431 into tats:master Sep 18, 2021
@tats
Copy link
Owner

tats commented Sep 18, 2021

Merged, thanks for your contribution.

@rkta rkta deleted the asn1_string_manipulation branch May 1, 2022 09:46
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.

None yet

2 participants