Skip to content

verify-x509-name with name-prefix mode does full subject match instead of prefix match #992

@raisOr1337

Description

@raisOr1337

Version: OpenVPN 2.6.14 (deb13u1)
OS: Debian Trixie (raspberry pi OS)

Expected behavior:
This option in the server.conf
verify-x509-name "C=A, ST=B, L=C, O=D, OU=E" name-prefix
should match any certificate whose subject STARTS with this string.

The intention is that the server only accepts certificates with certain values in certain fields that are the same across all client-certificates.
Since CN and emailAddress are different in the client certs, I need to match only the fields that are identical.

Actual behavior:
Full subject match is performed. Certificates with additional fields (CN, emailAddress) are rejected.

Log output:
VERIFY X509NAME ERROR: C=A, ST=B, L=C, O=D, OU=E, CN=F, emailAddress=G,
must be C=A, ST=B, L=C, O=D, OU=E

Increasing verb to 6 showed that the server is using this:
verify_x509_type = 3 (expected: 2 for name-prefix?)

Steps to reproduce:

  1. Create CA with EASYRSA_DN "org"
  2. Issue server/client certs with O, OU, CN, email fields
  3. Set verify-x509-name with name-prefix on server
  4. Connect with client -> VERIFY X509NAME ERROR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions