From: Viktor Dukhovni Date: Sun, 9 Feb 2025 06:55:44 +0000 (+1100) Subject: Fix docs/comments with ASN.1 private key syntax X-Git-Tag: openssl-3.5.0-alpha1~568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edb3824604be4faada6eb028a0c624bcb1d56184;p=thirdparty%2Fopenssl.git 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) --- 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: *