From edb3824604be4faada6eb028a0c624bcb1d56184 Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Sun, 9 Feb 2025 17:55:44 +1100 Subject: [PATCH] Fix docs/comments with ASN.1 private key syntax Reviewed-by: Tim Hudson Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/26674) --- doc/man7/EVP_PKEY-ML-DSA.pod | 8 ++++---- providers/implementations/encode_decode/ml_dsa_codecs.c | 8 ++++---- providers/implementations/encode_decode/ml_dsa_codecs.h | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/man7/EVP_PKEY-ML-DSA.pod b/doc/man7/EVP_PKEY-ML-DSA.pod index 4cd072f67d5..c647c4f5093 100644 --- a/doc/man7/EVP_PKEY-ML-DSA.pod +++ b/doc/man7/EVP_PKEY-ML-DSA.pod @@ -127,11 +127,11 @@ B<ξ> seed and the secret key B are present in the private key as part of the DER encoding of the ASN.1 sequence: ML-DSA-PrivateKey ::= CHOICE { - seed [0] IMPLICIT OCTET STRING SIZE (32), - expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) + seed [0] IMPLICIT OCTET STRING (SIZE (32)), + expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)), both SEQUENCE { - seed OCTET STRING SIZE (32), - expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) } } + seed OCTET STRING (SIZE (32)), + expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)) } } If the C format is not included in the list, this format will not be recognised on input. diff --git a/providers/implementations/encode_decode/ml_dsa_codecs.c b/providers/implementations/encode_decode/ml_dsa_codecs.c index 365133d6c84..e7be0094cc6 100644 --- a/providers/implementations/encode_decode/ml_dsa_codecs.c +++ b/providers/implementations/encode_decode/ml_dsa_codecs.c @@ -22,11 +22,11 @@ * corresponding to the "either or both" variants of: * * ML-DSA-PrivateKey ::= CHOICE { - * seed [0] IMPLICIT OCTET STRING SIZE (32), - * expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) + * seed [0] IMPLICIT OCTET STRING (SIZE (32)), + * expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)), * both SEQUENCE { - * seed OCTET STRING SIZE (32), - * expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) } } + * seed OCTET STRING (SIZE (32)), + * expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)) } } * * one more for a historical OQS encoding: * diff --git a/providers/implementations/encode_decode/ml_dsa_codecs.h b/providers/implementations/encode_decode/ml_dsa_codecs.h index 4bbcaae259b..87993415fba 100644 --- a/providers/implementations/encode_decode/ml_dsa_codecs.h +++ b/providers/implementations/encode_decode/ml_dsa_codecs.h @@ -36,11 +36,11 @@ typedef struct { * corresponding to the "either or both" variants of: * * ML-DSA-PrivateKey ::= CHOICE { - * seed [0] IMPLICIT OCTET STRING SIZE (32), - * expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) + * seed [0] IMPLICIT OCTET STRING (SIZE (32)), + * expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)), * both SEQUENCE { - * seed OCTET STRING SIZE (32), - * expandedKey OCTET STRING SIZE (2560 | 4032 | 4896) } } + * seed OCTET STRING (SIZE (32)), + * expandedKey OCTET STRING (SIZE (2560 | 4032 | 4896)) } } * * one more for a historical OQS encoding: * -- 2.47.2