-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Allow SP certificates to be OpenSSL::X509::Certificate #726
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -373,15 +373,24 @@ def get_all_sp_certs | |
|
||
# Validate certificate, certificate_new, private_key, and sp_cert_multi params. | ||
def validate_sp_certs_params! | ||
multi = sp_cert_multi && !sp_cert_multi.empty? | ||
cert = certificate && !certificate.empty? | ||
cert_new = certificate_new && !certificate_new.empty? | ||
pk = private_key && !private_key.empty? | ||
if multi && (cert || cert_new || pk) | ||
has_multi = sp_cert_multi && !sp_cert_multi.empty? | ||
if has_multi && (cert?(certificate) || cert?(certificate_new) || pk?) | ||
raise ArgumentError.new("Cannot specify both sp_cert_multi and certificate, certificate_new, private_key parameters") | ||
end | ||
end | ||
|
||
# Check if private key exists and is not empty | ||
def pk? | ||
private_key && !private_key.empty? | ||
end | ||
|
||
# Check if a certificate is present. | ||
def cert?(cert) | ||
return true if cert.is_a?(OpenSSL::X509::Certificate) | ||
|
||
cert && !cert.empty? | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all changes in this file can be rolled back There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without it we get the initial NoMethodError again (because
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK I will check this later, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In what status is this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pitbulk this change is fine. @tobiasamft how about also adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @johnnyshields, I've added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my comment above about allowing OpenSSL::PKey::PKey. You can also increase the max module size from rubocop so it passes. |
||
|
||
# Get certs from certificate, certificate_new, and private_key parameters. | ||
def get_sp_certs_single | ||
certs = { :signing => [], :encryption => [] } | ||
|
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.
Sorry I meant we should add: