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 RA cert import during DL0 replication #721
Conversation
ipaserver/install/cainstance.py
Outdated
| @@ -400,7 +400,8 @@ def configure_instance(self, host_name, dm_password, admin_password, | |||
| self.step("Importing RA key", self.__import_ra_key) | |||
| else: | |||
| self.step("importing RA certificate from PKCS #12 file", | |||
| lambda: self.import_ra_cert(ra_p12)) | |||
| lambda: self.import_ra_cert(ra_p12, | |||
| self.dm_password)) | |||
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.
Could you please put this into a __import_ra_cert helper method so we get rid of this ugly lambda expression?
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.
Ok.
ipaserver/install/cainstance.py
Outdated
| if password is not None: | ||
| pwdfile_fd, pwdfile_name = tempfile.mkstemp() | ||
| os.write(pwdfile_fd, password) | ||
| os.close(pwdfile_fd) |
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.
You can / should use ipautil.write_tmp_file here.
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.
Will do, did not realize we have such a thing, thanks.
ipaserver/install/cainstance.py
Outdated
| """ | ||
| Cloned RAs will use the same RA agent cert as the master so we | ||
| need to import from a PKCS#12 file. | ||
|
|
||
| Used when setting up replication | ||
| """ | ||
| pwdarg = 'pass:' | ||
| if password is not None: |
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.
Why is the empty password special cased here?
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.
We won't need this in the end, this should be reworked.
|
🤷 |
|
... because you need to apply the same fix to |
|
Silly me 🙄 |
Previous versions of FreeIPA add password to the ra.p12 file contained in the password-protected tarball. This was forgotten about in the recent changes and fixed now. https://pagure.io/freeipa/issue/6878
Previous versions of FreeIPA add password to the ra.p12 file
contained in the password-protected tarball. This was forgotten
about in the recent changes and fixed now.
https://pagure.io/freeipa/issue/6878