Skip to content

Commit

Permalink
allow EC Certs as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sriepen authored and opoplawski committed Dec 19, 2023
1 parent 31eed53 commit 1738f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/pfsense_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def _validate_params(self):
if params['key'] is not None:
key = params['key']
lines = key.splitlines()
if re.match('^-----BEGIN (RSA )?PRIVATE KEY-----$', lines[0]) and re.match('^-----END (RSA )?PRIVATE KEY-----$', lines[-1]):
if re.match('^-----BEGIN ((EC|RSA) )?PRIVATE KEY-----$', lines[0]) and re.match('^-----END ((EC|RSA) )?PRIVATE KEY-----$', lines[-1]):
params['key'] = base64.b64encode(key.encode()).decode()
elif not re.match('LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0t', key):
self.module.fail_json(msg='Could not recognize key format: %s' % (key))
Expand Down

0 comments on commit 1738f05

Please sign in to comment.