Fix the sense of the test on DH_check()'s return value. This was preventing
authorTom Lane <[email protected]>
Fri, 12 May 2006 22:44:43 +0000 (22:44 +0000)
committerTom Lane <[email protected]>
Fri, 12 May 2006 22:44:43 +0000 (22:44 +0000)
custom-generated DH parameters from actually being used by the server.
Found by Michael Fuhr.

src/backend/libpq/be-secure.c

index 8539e9a97aef3092a7495dae30026abecb0ea035..d59e7bcfeeb1864108205ba7c1f8c2fdeedf80be 100644 (file)
@@ -525,7 +525,7 @@ load_dh_file(int keylength)
        /* make sure the DH parameters are usable */
        if (dh != NULL)
        {
-               if (DH_check(dh, &codes))
+               if (DH_check(dh, &codes) == 0)
                {
                        elog(LOG, "DH_check error (%s): %s", fnbuf, SSLerrmessage());
                        return NULL;