From 26b94e3f1908ba068bc17f2f4d8652ed34153948 Mon Sep 17 00:00:00 2001 From: Mehrn0ush Date: Tue, 10 Nov 2026 22:42:14 +0400 Subject: [PATCH 1/3] feat(2.0): add SSH algorithm lists to protocolProperties Signed-off-by: Mehrn0ush --- .../cyclonedx-cryptography-2.0.schema.json | 81 ++++++++++++++++ ...tography-ssh-algorithms-item-type-2.0.json | 24 +++++ ...raphy-ssh-algorithms-missing-name-2.0.json | 26 ++++++ ...y-ssh-algorithms-unknown-category-2.0.json | 26 ++++++ ...valid-cryptography-ssh-algorithms-2.0.json | 93 +++++++++++++++++++ 5 files changed, 250 insertions(+) create mode 100644 tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-item-type-2.0.json create mode 100644 tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-missing-name-2.0.json create mode 100644 tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-unknown-category-2.0.json create mode 100644 tools/src/test/resources/2.0/valid-cryptography-ssh-algorithms-2.0.json diff --git a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json index e84ef647e..e40945036 100644 --- a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json +++ b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json @@ -695,6 +695,59 @@ "title": "Cipher Suite" } }, + "sshAlgorithms": { + "type": "object", + "title": "SSH Algorithms", + "description": "The SSH algorithms, grouped by the name-list categories of the key exchange initialization message (`SSH_MSG_KEXINIT`) defined in [RFC 4253 section 7.1](https://www.rfc-editor.org/rfc/rfc4253#section-7.1), as configured or observed for the subject of this BOM. Array order does not convey negotiation preference. The lists do not identify which algorithms were selected in a particular connection. Each list applies to both directions of the connection unless a producer records the two directions separately in different components.", + "additionalProperties": false, + "properties": { + "kex": { + "type": "array", + "title": "Key Exchange Algorithms", + "description": "SSH key exchange methods (`kex_algorithms`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Key Exchange Algorithms entry" + } + }, + "hostKey": { + "type": "array", + "title": "Host Key Algorithms", + "description": "SSH server host key algorithms (`server_host_key_algorithms`), used to authenticate the server.", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Host Key Algorithms entry" + } + }, + "encryption": { + "type": "array", + "title": "Encryption Algorithms", + "description": "SSH encryption algorithms (`encryption_algorithms_client_to_server` and `encryption_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Encryption Algorithms entry" + } + }, + "mac": { + "type": "array", + "title": "MAC Algorithms", + "description": "SSH message authentication code algorithms (`mac_algorithms_client_to_server` and `mac_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "MAC Algorithms entry" + } + }, + "compression": { + "type": "array", + "title": "Compression Algorithms", + "description": "SSH compression algorithms (`compression_algorithms_client_to_server` and `compression_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Compression Algorithms entry" + } + } + } + }, "ikev2TransformTypes": { "type": "object", "title": "IKEv2 Transform Types", @@ -833,6 +886,34 @@ } } }, + "sshAlgorithm": { + "type": "object", + "title": "SSH Algorithm", + "description": "Object representing an algorithm name as it appears in an SSH name-list.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "The algorithm name as used in SSH. Prefer the name from the IANA Secure Shell (SSH) Protocol Parameters registry where a registered name exists.", + "examples": [ + "mlkem768x25519-sha256", + "ssh-ed25519", + "aes256-gcm@openssh.com", + "hmac-sha2-256", + "none" + ] + }, + "algorithm": { + "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", + "title": "Algorithm reference", + "description": "The `refId` to algorithm cryptographic asset." + } + } + }, "ikeV2Enc": { "type": "object", "title": "Encryption Algorithm (ENCR)", diff --git a/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-item-type-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-item-type-2.0.json new file mode 100644 index 000000000..5de98386e --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-item-type-2.0.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "definitions": { + "components": [ + { + "type": "cryptographic-asset", + "name": "SSH server", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "sshAlgorithms": { + "kex": [ + "curve25519-sha256" + ] + } + } + } + } + ] + } +} diff --git a/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-missing-name-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-missing-name-2.0.json new file mode 100644 index 000000000..53260ca28 --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-missing-name-2.0.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "definitions": { + "components": [ + { + "type": "cryptographic-asset", + "name": "SSH server", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "sshAlgorithms": { + "hostKey": [ + { + "algorithm": "alg-ed25519" + } + ] + } + } + } + } + ] + } +} diff --git a/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-unknown-category-2.0.json b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-unknown-category-2.0.json new file mode 100644 index 000000000..a2265550c --- /dev/null +++ b/tools/src/test/resources/2.0/invalid-cryptography-ssh-algorithms-unknown-category-2.0.json @@ -0,0 +1,26 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "definitions": { + "components": [ + { + "type": "cryptographic-asset", + "name": "SSH server", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "sshAlgorithms": { + "keyExchange": [ + { + "name": "curve25519-sha256" + } + ] + } + } + } + } + ] + } +} diff --git a/tools/src/test/resources/2.0/valid-cryptography-ssh-algorithms-2.0.json b/tools/src/test/resources/2.0/valid-cryptography-ssh-algorithms-2.0.json new file mode 100644 index 000000000..e7076e899 --- /dev/null +++ b/tools/src/test/resources/2.0/valid-cryptography-ssh-algorithms-2.0.json @@ -0,0 +1,93 @@ +{ + "$schema": "https://cyclonedx.org/schema/2.0/cyclonedx-2.0.schema.json", + "specFormat": "CycloneDX", + "specVersion": "2.0", + "definitions": { + "components": [ + { + "type": "cryptographic-asset", + "refId": "alg-ed25519", + "name": "Ed25519", + "cryptoProperties": { + "assetType": "algorithm", + "algorithmProperties": { + "primitive": "signature", + "algorithmFamily": "EdDSA", + "cryptoFunctions": [ + "sign", + "verify" + ] + } + } + }, + { + "type": "cryptographic-asset", + "name": "SSH server KEXINIT", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "version": "2.0", + "sshAlgorithms": { + "kex": [ + { + "name": "mlkem768x25519-sha256" + }, + { + "name": "curve25519-sha256" + } + ], + "hostKey": [ + { + "name": "ssh-ed25519", + "algorithm": "alg-ed25519" + }, + { + "name": "rsa-sha2-512" + } + ], + "encryption": [ + { + "name": "chacha20-poly1305@openssh.com" + }, + { + "name": "aes256-gcm@openssh.com" + } + ], + "mac": [ + { + "name": "hmac-sha2-256" + } + ], + "compression": [ + { + "name": "none" + }, + { + "name": "zlib@openssh.com" + } + ] + } + } + } + }, + { + "type": "cryptographic-asset", + "name": "SSH host key only", + "cryptoProperties": { + "assetType": "protocol", + "protocolProperties": { + "type": "ssh", + "sshAlgorithms": { + "hostKey": [ + { + "name": "ssh-ed25519" + } + ] + } + } + } + } + ] + } +} From a343720353c6798030850dea70ae39fd3684e736 Mon Sep 17 00:00:00 2001 From: Mehrn0ush Date: Wed, 11 Nov 2026 15:42:27 +0400 Subject: [PATCH 2/3] docs(2.0): clarify SSH algorithm list scope and direction Signed-off-by: Mehrn0ush --- .../cyclonedx-cryptography-2.0.schema.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json index e40945036..1182f5a10 100644 --- a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json +++ b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json @@ -698,25 +698,25 @@ "sshAlgorithms": { "type": "object", "title": "SSH Algorithms", - "description": "The SSH algorithms, grouped by the name-list categories of the key exchange initialization message (`SSH_MSG_KEXINIT`) defined in [RFC 4253 section 7.1](https://www.rfc-editor.org/rfc/rfc4253#section-7.1), as configured or observed for the subject of this BOM. Array order does not convey negotiation preference. The lists do not identify which algorithms were selected in a particular connection. Each list applies to both directions of the connection unless a producer records the two directions separately in different components.", + "description": "The SSH algorithms, grouped by the name-list categories of the key exchange initialization message (`SSH_MSG_KEXINIT`) defined in [RFC 4253 section 7.1](https://www.rfc-editor.org/rfc/rfc4253#section-7.1), as configured or observed for the subject of this BOM. Array order does not convey negotiation preference. The lists do not identify which algorithms were selected in a particular connection. Name-lists that SSH negotiates separately for each direction (encryption, MAC, and compression) are recorded here without distinguishing the direction. Algorithms used for user authentication ([RFC 4252](https://www.rfc-editor.org/rfc/rfc4252)) are not part of these lists.", "additionalProperties": false, "properties": { "kex": { "type": "array", "title": "Key Exchange Algorithms", - "description": "SSH key exchange methods (`kex_algorithms`).", + "description": "SSH key exchange methods (`kex_algorithms`). Extension indicators carried in the same name-list, such as `ext-info-s` ([RFC 8308](https://www.rfc-editor.org/rfc/rfc8308)), are not key exchange methods and are not recorded here.", "items": { "$ref": "#/$defs/sshAlgorithm", - "title": "Key Exchange Algorithms entry" + "title": "Key Exchange Algorithm" } }, "hostKey": { "type": "array", "title": "Host Key Algorithms", - "description": "SSH server host key algorithms (`server_host_key_algorithms`), used to authenticate the server.", + "description": "SSH server host key algorithms (`server_host_key_algorithms`): the algorithms a server offers, or a client accepts, for authenticating the server.", "items": { "$ref": "#/$defs/sshAlgorithm", - "title": "Host Key Algorithms entry" + "title": "Host Key Algorithm" } }, "encryption": { @@ -725,7 +725,7 @@ "description": "SSH encryption algorithms (`encryption_algorithms_client_to_server` and `encryption_algorithms_server_to_client`).", "items": { "$ref": "#/$defs/sshAlgorithm", - "title": "Encryption Algorithms entry" + "title": "Encryption Algorithm" } }, "mac": { @@ -734,7 +734,7 @@ "description": "SSH message authentication code algorithms (`mac_algorithms_client_to_server` and `mac_algorithms_server_to_client`).", "items": { "$ref": "#/$defs/sshAlgorithm", - "title": "MAC Algorithms entry" + "title": "MAC Algorithm" } }, "compression": { @@ -743,7 +743,7 @@ "description": "SSH compression algorithms (`compression_algorithms_client_to_server` and `compression_algorithms_server_to_client`).", "items": { "$ref": "#/$defs/sshAlgorithm", - "title": "Compression Algorithms entry" + "title": "Compression Algorithm" } } } @@ -898,7 +898,7 @@ "name": { "type": "string", "title": "Name", - "description": "The algorithm name as used in SSH. Prefer the name from the IANA Secure Shell (SSH) Protocol Parameters registry where a registered name exists.", + "description": "The algorithm name as it appears in the SSH name-list. Where a registered name exists, the name from the IANA Secure Shell (SSH) Protocol Parameters registry should be used.", "examples": [ "mlkem768x25519-sha256", "ssh-ed25519", From 2c9c89c6746b37618f3b760adc1d019bc8be92bb Mon Sep 17 00:00:00 2001 From: Mehrn0ush Date: Thu, 12 Nov 2026 13:00:50 +0400 Subject: [PATCH 3/3] refactor(2.0): move SSH algorithm lists after IKEv2 blocks; Avoids a merge conflict with #1184, which inserts at the same positions. Signed-off-by: Mehrn0ush --- .../cyclonedx-cryptography-2.0.schema.json | 162 +++++++++--------- 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json index 1182f5a10..49a823ac6 100644 --- a/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json +++ b/schema/2.0/modules/cyclonedx-cryptography-2.0.schema.json @@ -695,59 +695,6 @@ "title": "Cipher Suite" } }, - "sshAlgorithms": { - "type": "object", - "title": "SSH Algorithms", - "description": "The SSH algorithms, grouped by the name-list categories of the key exchange initialization message (`SSH_MSG_KEXINIT`) defined in [RFC 4253 section 7.1](https://www.rfc-editor.org/rfc/rfc4253#section-7.1), as configured or observed for the subject of this BOM. Array order does not convey negotiation preference. The lists do not identify which algorithms were selected in a particular connection. Name-lists that SSH negotiates separately for each direction (encryption, MAC, and compression) are recorded here without distinguishing the direction. Algorithms used for user authentication ([RFC 4252](https://www.rfc-editor.org/rfc/rfc4252)) are not part of these lists.", - "additionalProperties": false, - "properties": { - "kex": { - "type": "array", - "title": "Key Exchange Algorithms", - "description": "SSH key exchange methods (`kex_algorithms`). Extension indicators carried in the same name-list, such as `ext-info-s` ([RFC 8308](https://www.rfc-editor.org/rfc/rfc8308)), are not key exchange methods and are not recorded here.", - "items": { - "$ref": "#/$defs/sshAlgorithm", - "title": "Key Exchange Algorithm" - } - }, - "hostKey": { - "type": "array", - "title": "Host Key Algorithms", - "description": "SSH server host key algorithms (`server_host_key_algorithms`): the algorithms a server offers, or a client accepts, for authenticating the server.", - "items": { - "$ref": "#/$defs/sshAlgorithm", - "title": "Host Key Algorithm" - } - }, - "encryption": { - "type": "array", - "title": "Encryption Algorithms", - "description": "SSH encryption algorithms (`encryption_algorithms_client_to_server` and `encryption_algorithms_server_to_client`).", - "items": { - "$ref": "#/$defs/sshAlgorithm", - "title": "Encryption Algorithm" - } - }, - "mac": { - "type": "array", - "title": "MAC Algorithms", - "description": "SSH message authentication code algorithms (`mac_algorithms_client_to_server` and `mac_algorithms_server_to_client`).", - "items": { - "$ref": "#/$defs/sshAlgorithm", - "title": "MAC Algorithm" - } - }, - "compression": { - "type": "array", - "title": "Compression Algorithms", - "description": "SSH compression algorithms (`compression_algorithms_client_to_server` and `compression_algorithms_server_to_client`).", - "items": { - "$ref": "#/$defs/sshAlgorithm", - "title": "Compression Algorithm" - } - } - } - }, "ikev2TransformTypes": { "type": "object", "title": "IKEv2 Transform Types", @@ -805,6 +752,59 @@ } } }, + "sshAlgorithms": { + "type": "object", + "title": "SSH Algorithms", + "description": "The SSH algorithms, grouped by the name-list categories of the key exchange initialization message (`SSH_MSG_KEXINIT`) defined in [RFC 4253 section 7.1](https://www.rfc-editor.org/rfc/rfc4253#section-7.1), as configured or observed for the subject of this BOM. Array order does not convey negotiation preference. The lists do not identify which algorithms were selected in a particular connection. Name-lists that SSH negotiates separately for each direction (encryption, MAC, and compression) are recorded here without distinguishing the direction. Algorithms used for user authentication ([RFC 4252](https://www.rfc-editor.org/rfc/rfc4252)) are not part of these lists.", + "additionalProperties": false, + "properties": { + "kex": { + "type": "array", + "title": "Key Exchange Algorithms", + "description": "SSH key exchange methods (`kex_algorithms`). Extension indicators carried in the same name-list, such as `ext-info-s` ([RFC 8308](https://www.rfc-editor.org/rfc/rfc8308)), are not key exchange methods and are not recorded here.", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Key Exchange Algorithm" + } + }, + "hostKey": { + "type": "array", + "title": "Host Key Algorithms", + "description": "SSH server host key algorithms (`server_host_key_algorithms`): the algorithms a server offers, or a client accepts, for authenticating the server.", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Host Key Algorithm" + } + }, + "encryption": { + "type": "array", + "title": "Encryption Algorithms", + "description": "SSH encryption algorithms (`encryption_algorithms_client_to_server` and `encryption_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Encryption Algorithm" + } + }, + "mac": { + "type": "array", + "title": "MAC Algorithms", + "description": "SSH message authentication code algorithms (`mac_algorithms_client_to_server` and `mac_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "MAC Algorithm" + } + }, + "compression": { + "type": "array", + "title": "Compression Algorithms", + "description": "SSH compression algorithms (`compression_algorithms_client_to_server` and `compression_algorithms_server_to_client`).", + "items": { + "$ref": "#/$defs/sshAlgorithm", + "title": "Compression Algorithm" + } + } + } + }, "relatedCryptographicAssets": { "$ref": "#/$defs/relatedCryptographicAssets" } @@ -886,34 +886,6 @@ } } }, - "sshAlgorithm": { - "type": "object", - "title": "SSH Algorithm", - "description": "Object representing an algorithm name as it appears in an SSH name-list.", - "additionalProperties": false, - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "The algorithm name as it appears in the SSH name-list. Where a registered name exists, the name from the IANA Secure Shell (SSH) Protocol Parameters registry should be used.", - "examples": [ - "mlkem768x25519-sha256", - "ssh-ed25519", - "aes256-gcm@openssh.com", - "hmac-sha2-256", - "none" - ] - }, - "algorithm": { - "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", - "title": "Algorithm reference", - "description": "The `refId` to algorithm cryptographic asset." - } - } - }, "ikeV2Enc": { "type": "object", "title": "Encryption Algorithm (ENCR)", @@ -1018,6 +990,34 @@ } } }, + "sshAlgorithm": { + "type": "object", + "title": "SSH Algorithm", + "description": "Object representing an algorithm name as it appears in an SSH name-list.", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "The algorithm name as it appears in the SSH name-list. Where a registered name exists, the name from the IANA Secure Shell (SSH) Protocol Parameters registry should be used.", + "examples": [ + "mlkem768x25519-sha256", + "ssh-ed25519", + "aes256-gcm@openssh.com", + "hmac-sha2-256", + "none" + ] + }, + "algorithm": { + "$ref": "cyclonedx-common-2.0.schema.json#/$defs/refLinkType", + "title": "Algorithm reference", + "description": "The `refId` to algorithm cryptographic asset." + } + } + }, "cryptographicFunction": { "title": "Cryptographic Function", "description": "A cryptographic function or usage.",