Skip to content

Comments

a_strex.c: prevent out of bound read in do_buf()#6105

Closed
mspncp wants to merge 1 commit intoopenssl:masterfrom
mspncp:pr-a-strex-fix-out-of-bound-read
Closed

a_strex.c: prevent out of bound read in do_buf()#6105
mspncp wants to merge 1 commit intoopenssl:masterfrom
mspncp:pr-a-strex-fix-out-of-bound-read

Conversation

@mspncp
Copy link
Contributor

@mspncp mspncp commented Apr 26, 2018

...which is used for ASN1_STRING_print_ex*() and X509_NAME_print_ex*().

which is used for ASN1_STRING_print_ex*() and X509_NAME_print_ex*().
outlen = 0;
charwidth = type & BUF_TYPE_WIDTH_MASK;

switch (charwidth) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i = UTF8_getc(p, buflen, &c);
if (i < 0)
return -1; /* Invalid UTF8String */
buflen -= i;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mspncp
Copy link
Contributor Author

mspncp commented Apr 26, 2018

@levitte, you're faster than the speed of light! 😉

@mspncp
Copy link
Contributor Author

mspncp commented Apr 26, 2018

Should I backport this?

@levitte
Copy link
Member

levitte commented Apr 26, 2018

@levitte, you're faster than the speed of light! 😉

Are you on the moon? 😁

Should I backport this?

Sure... although, does it cherry-pick cleanly to 1.1.0? Then there's no need to make a separate PR...

@mspncp
Copy link
Contributor Author

mspncp commented Apr 26, 2018

@levitte, you're faster than the speed of light! 😉

Are you on the moon? 😁

Well, you approved the pull request before I finished documenting it. So you must have travelled back in time, i.e. faster than the speed of light.

Should I backport this?

Sure... although, does it cherry-pick cleanly to 1.1.0? Then there's no need to make a separate PR...

Well, the changes to crypto/asn1/a_strex.c can be cherry-picked, but the error codes not. They require a separate make errors, after which ASN1_F_DO_BUF gets assigned a different number on 1.1.0. How do you normally deal with these cases?

@mspncp
Copy link
Contributor Author

mspncp commented Apr 26, 2018

Travis failure is caused by apt-get.

@levitte
Copy link
Member

levitte commented Apr 26, 2018

Well, the changes to crypto/asn1/a_strex.c can be cherry-picked, but the error codes not. They require a separate make errors, after which ASN1_F_DO_BUF gets assigned a different number on 1.1.0. How do you normally deal with these cases?

For 1.0.2, we don't care, since 1.1.0 has renumbered more or less everything anyway.

@mspncp
Copy link
Contributor Author

mspncp commented Apr 26, 2018

For 1.0.2, we don't care, since 1.1.0 has renumbered more or less everything anyway.

I was actually talking about backporting from master to 1.1.0. Is it necessary and/or desirable that the error codes (here: ASN1_F_DO_BUF) are the same value on both branches? If yes, the conflicts need to be resolved manually. If no, it would be sufficient to only cherry-pick the changes made to crypto/asn1/a_strex.c and then rerun make errors afterwards.

@levitte
Copy link
Member

levitte commented Apr 27, 2018

Hmmm, we usually do keep the numbers in sync between 1.1.0 and 1.1.1, so...

@mspncp
Copy link
Contributor Author

mspncp commented Apr 27, 2018

Giving travis another try...

@mspncp mspncp closed this Apr 27, 2018
@mspncp mspncp reopened this Apr 27, 2018
@mspncp
Copy link
Contributor Author

mspncp commented May 1, 2018

Richard, since you approved this pr, would you mind approving the backports #6117 and #6118, too?

@mspncp mspncp added approval: done This pull request has the required number of approvals branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) labels May 1, 2018
levitte pushed a commit that referenced this pull request May 2, 2018
which is used for ASN1_STRING_print_ex*() and X509_NAME_print_ex*().

Reviewed-by: Richard Levitte <[email protected]>
(Merged from #6105)
@mspncp
Copy link
Contributor Author

mspncp commented May 2, 2018

Merged thanks!

c671843 master
ebdeeb3 1.1.0 (#6117)
7e6c0f5 1.0.2 (#6118)

@mspncp mspncp closed this May 2, 2018
@mspncp mspncp deleted the pr-a-strex-fix-out-of-bound-read branch May 2, 2018 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants