• M
    Report a readable error on a duplicate cert in ca app · 2cedf794
    Matt Caswell 提交于
    Commit 87e8feca (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: NRichard Levitte <levitte@openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/5444)
    2cedf794
ca.c 82.8 KB