]> granicus.if.org Git - openssl/commit
Report a readable error on a duplicate cert in ca app
authorMatt Caswell <matt@openssl.org>
Thu, 8 Mar 2018 15:55:46 +0000 (15:55 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 15 Mar 2018 13:34:57 +0000 (13:34 +0000)
commit50615b3c969d1cc2d4beb09f141c678bfe06382b
treef03a4263f702cff41051b6bbc3a344228c8c4e71
parent5caf721bbb154c6845c7f2a0fd7f450bfc496444
Report a readable error on a duplicate cert in ca app

Commit 87e8fec (16 years ago!) introduced a bug where if we are
attempting to insert a cert with a duplicate subject name, and
duplicate subject names are not allowed (which is the default),
then we get an unhelpful error message back (error number 2). Prior
to that commit we got a helpful error message which displayed details
of the conflicting entry in the database.

That commit was itself attempting to fix a bug with the noemailDN option
where we were setting the subject field in the database too early
(before extensions had made any amendments to it).

This PR moves the check for a conflicting Subject name until after all
changes to the Subject have been made by extensions etc.

This also, co-incidentally Fixes the ca crashing bug described in issue
5109.

Fixes #5109

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5445)
apps/ca.c