-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
x509: fix type issues; a 2019.2-based variant of PR #52014, fixes #52026 #52456
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alxwr We still need a regression test for this bugfix.
@dwoz I'll be happy to write one. Would you please point me to an example to get me up to speed? |
@dwoz I found another related bug and fixed it: When I tried to use
This might be related: #53294 Regarding the tests: I followed https://github.com/saltstack/salt/blob/develop/HACKING.rst, but I can't get the tests to run locally on a Ubuntu 18.04. They fail with:
|
@Ch3LL I'm using PyZMQ 16.0.2. Thanks for the hint! I'll try to update. |
no problem. Let me know if i can help with anything else :) |
I found two some similar bugs in |
I have exactly the same issue (saltstack
After applying this patch all work as expected. It's said that we will not have this fix in @Ch3LL, @waynew when we could expect this fix will be released? |
@alxwr with our recent shift to using |
I confirm this PR fixes the issue, had the same error. Sad to see this is not merged after so long. |
Fixes "TypeError: a bytes-like object is required, not 'str'"
Fixes "TypeError: a bytes-like object is required, not 'str'"
TypeError: a bytes-like object is required, not 'str'
@waynew Sry for the long delay! I'd love to write tests, but I'd have to read up on them in order to write proper tests. I just haven't got the time to do that now. As I states in the description: this is a mere update and re-application of patches I didn't write myself. |
@alxwr I think the most reliable test in this case would likely be a sample cert or two which triggered the bug behavior. The integration tests already have Also #52014 had a test case attached you could just copy into this PR. |
@alxwr did that explanation make sense? Or do you need a bit more help in regards to testing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alxwr are you still interested in writing tests & getting this merged in?
@alxwr Are you still interested in driving this to completion? We'd love to help you know how to best write tests for this! |
Just getting example certs which display the errors would be enough to allow others to help writing tests. |
@waynew I was interested, but just didn't have the time. Sry. Seems this issue has been dealt with in a much better way than I currently can provide:
I'm closing this PR, because when I rebase the patches against master this amounts to something like this, which indicates #52935 took care of the problem: diff --git a/salt/modules/x509.py b/salt/modules/x509.py
index c278723038..e02fd61b66 100644
--- a/salt/modules/x509.py
+++ b/salt/modules/x509.py
@@ -742,7 +742,7 @@ def get_public_key(key, passphrase=None, asObj=False):
return evppubkey
rsa.save_pub_key_bio(bio)
- return bio.read_all()
+ return bio.read_all().decode() Thanks for your help! Sry I didn't manage to finish the PR in time. |
What does this PR do?
This is just an updated version of #52014.
What issues does this PR fix or reference?
#52014 #52026 #52180
Previous Behavior
modules.x509
fails to parse existing certificates.New Behavior
modules.x509
Tests written?
No, but tested on FreeBSD 11.2 and on other machines (see #52026)
Commits signed with GPG?
No
I just hope this helps getting #52014 into upstream. All credit goes to @arsiesys.