Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
omnibus-heptapod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
heptapod
omnibus-heptapod
Commits
fa358f2ce46d
Commit
fa358f2ce46d
authored
3 years ago
by
Kenneth Chu
Browse files
Options
Downloads
Patches
Plain Diff
Refactor key size comparison to be more efficient
parent
fc1c18ccac94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!51
Validate shift of Heptapod 0.25 to oldstable series
,
!44
GitLab 14.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
files/gitlab-cookbooks/letsencrypt/resources/certificate.rb
+3
-20
3 additions, 20 deletions
files/gitlab-cookbooks/letsencrypt/resources/certificate.rb
with
3 additions
and
20 deletions
files/gitlab-cookbooks/letsencrypt/resources/certificate.rb
+
3
−
20
View file @
fa358f2c
...
...
@@ -21,8 +21,9 @@
# they provide invalid data
helper
=
LetsEncryptHelper
.
new
(
node
)
contact_info
=
helper
.
contact
target_key_size
=
new_resource
.
key_size
||
node
[
'acme'
][
'key_size'
]
if
::
File
.
file?
(
"
#{
new_resource
.
key
}
-staging"
)
staging_key
=
OpenSSL
::
PKey
::
RSA
.
new
::
File
.
read
"
#{
new_resource
.
key
}
-staging"
staging_key_size
=
staging_key
.
n
.
num_bits
...
...
@@ -24,18 +25,9 @@
if
::
File
.
file?
(
"
#{
new_resource
.
key
}
-staging"
)
staging_key
=
OpenSSL
::
PKey
::
RSA
.
new
::
File
.
read
"
#{
new_resource
.
key
}
-staging"
staging_key_size
=
staging_key
.
n
.
num_bits
if
new_resource
.
key_size
.
nil?
unless
staging_key_size
==
node
[
'acme'
][
'key_size'
]
file
"
#{
new_resource
.
key
}
-staging"
do
action
:delete
end
file
"
#{
new_resource
.
crt
}
-staging"
do
action
:delete
end
end
elsif
staging_key_size
!=
new_resource
.
key_size
if
staging_key_size
!=
target_key_size
file
"
#{
new_resource
.
key
}
-staging"
do
action
:delete
end
...
...
@@ -70,16 +62,7 @@
production_key
=
OpenSSL
::
PKey
::
RSA
.
new
::
File
.
read
new_resource
.
key
production_key_size
=
production_key
.
n
.
num_bits
if
new_resource
.
key_size
.
nil?
unless
production_key_size
==
node
[
'acme'
][
'key_size'
]
file
new_resource
.
key
do
action
:delete
end
file
new_resource
.
crt
do
action
:delete
end
end
elsif
production_key_size
!=
new_resource
.
key_size
if
production_key_size
!=
target_key_size
file
new_resource
.
key
do
action
:delete
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment