Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSA-PSS signature params are parsed into a mess #94

Closed
kpp opened this issue Jul 16, 2021 · 0 comments
Closed

RSA-PSS signature params are parsed into a mess #94

kpp opened this issue Jul 16, 2021 · 0 comments

Comments

@kpp
Copy link
Contributor

kpp commented Jul 16, 2021

Here is a x509 pem cert.txt signed with RSA_PSS_SHA384.

openssl x509 -text -in cert.txt -noout gives clear info of the signature algorithm:

        Signature Algorithm: rsassaPss         
         Hash Algorithm: sha384
         Mask Algorithm: mgf1 with sha384
          Salt Length: 0x30
         Trailer Field: 0xBC (default)

Unfortunately with your cratecertificate.signature_algorithm.parameters are parsed into a mess:

params = BerObject {
    header: BerObjectHeader {
        class: Universal,
        structured: 1,
        tag: Sequence,
        len: Definite(
            52,
        ),
        raw_tag: Some(
            [
                48,
            ],
        ),
    },
    content: Sequence(
        [
            BerObject {
                header: BerObjectHeader {
                    class: ContextSpecific,
                    structured: 1,
                    tag: EndOfContent,
                    len: Definite(
                        15,
                    ),
                    raw_tag: Some(
                        [
                            160,
                        ],
                    ),
                },
                content: Unknown(
                    EndOfContent,
                    [
                        48,
                        13,
                        6,
                        9,
                        96,
                        134,
                        72,
                        1,
                        101,
                        3,
                        4,
                        2,
                        2,
                        5,
                        0,
                    ],
                ),
            },
            BerObject {
                header: BerObjectHeader {
                    class: ContextSpecific,
                    structured: 1,
                    tag: Boolean,
                    len: Definite(
                        28,
                    ),
                    raw_tag: Some(
                        [
                            161,
                        ],
                    ),
                },
                content: Unknown(
                    Boolean,
                    [
                        48,
                        26,
                        6,
                        9,
                        42,
                        134,
                        72,
                        134,
                        247,
                        13,
                        1,
                        1,
                        8,
                        48,
                        13,
                        6,
                        9,
                        96,
                        134,
                        72,
                        1,
                        101,
                        3,
                        4,
                        2,
                        2,
                        5,
                        0,
                    ],
                ),
            },
            BerObject {
                header: BerObjectHeader {
                    class: ContextSpecific,
                    structured: 1,
                    tag: Integer,
                    len: Definite(
                        3,
                    ),
                    raw_tag: Some(
                        [
                            162,
                        ],
                    ),
                },
                content: Unknown(
                    Integer,
                    [
                        2,
                        1,
                        48,
                    ],
                ),
            },
        ],
    ),
}

Would you please fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant