• Peter Eisentraut's avatar
    Refactor client-side SSL certificate checking code · f75a9591
    Peter Eisentraut authored
    Separate the parts specific to the SSL library from the general logic.
    
    The previous code structure was
    
    open_client_SSL()
    calls verify_peer_name_matches_certificate()
    calls verify_peer_name_matches_certificate_name()
    calls wildcard_certificate_match()
    
    and was completely in fe-secure-openssl.c.  The new structure is
    
    open_client_SSL() [openssl]
    calls pq_verify_peer_name_matches_certificate() [generic]
    calls pgtls_verify_peer_name_matches_certificate_guts() [openssl]
    calls openssl_verify_peer_name_matches_certificate_name() [openssl]
    calls pq_verify_peer_name_matches_certificate_name() [generic]
    calls wildcard_certificate_match() [generic]
    
    Move the generic functions into a new file fe-secure-common.c, so the
    calls generally go fe-connect.c -> fe-secure.c -> fe-secure-${impl}.c ->
    fe-secure-common.c, although there is a bit of back-and-forth between
    the last two.
    Reviewed-by: default avatarMichael Paquier <michael.paquier@gmail.com>
    f75a9591
Makefile 6.04 KB