Skip to content

Commit

Permalink
17277 FIX check-cert: Fix checking of public key size
Browse files Browse the repository at this point in the history
When configuring to check the public key size of the certificate.
check-cert would just ignore this configuration option.

Now the checking works as expected.

CMK-17764

Change-Id: Ibf64acc5ba1e90da7b7b548e85b76b481c40bd61
  • Loading branch information
loocars committed Dec 13, 2024
1 parent 30baa7d commit 9b0a094
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .werks/17277.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[//]: # (werk v2)
# check-cert: Fix checking of public key size

key | value
---------- | ---
date | 2024-12-12T12:46:13+00:00
version | 2.4.0b1
class | fix
edition | cre
component | checks
level | 1
compatible | yes

When configuring to check the public key size of the certificate.
check-cert would just ignore this configuration option.

Now the checking works as expected.
4 changes: 2 additions & 2 deletions cmk/plugins/collection/server_side_calls/cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Subject(BaseModel):
organization: str | None = None
org_unit: str | None = None
pubkey_algorithm: PubKey | None = None
pubkey_size: str | None = None
pubkeysize: str | None = None


class Certificate(BaseModel):
Expand Down Expand Up @@ -231,7 +231,7 @@ def _subject_args(subject: Subject, host_config: HostConfig) -> Iterator[str]:
if (pubkey := subject.pubkey_algorithm) is not None:
yield "--pubkey-algorithm"
yield pubkey[0]
if (pubkey_size := subject.pubkey_size) is not None:
if (pubkey_size := subject.pubkeysize) is not None:
yield "--pubkey-size"
yield replace_macros(pubkey_size, host_config.macros)

Expand Down

0 comments on commit 9b0a094

Please sign in to comment.