Commit 2aa5a2c7 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Check for FIPS mode after loading config.



PR#3958

Reviewed-by: default avatarRich Salz <rsalz@openssl.org>
parent eac2b837
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -134,13 +134,6 @@ int MAIN(int argc, char **argv)

    apps_startup();

# ifdef OPENSSL_FIPS
    if (FIPS_mode())
        cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
    else
# endif
        cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;

    enc = EVP_des_ede3_cbc();
    if (bio_err == NULL)
        bio_err = BIO_new_fp(stderr, BIO_NOCLOSE);
@@ -148,6 +141,13 @@ int MAIN(int argc, char **argv)
    if (!load_config(bio_err, NULL))
        goto end;

# ifdef OPENSSL_FIPS
    if (FIPS_mode())
        cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC;
    else
# endif
        cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC;

    args = argv + 1;

    while (*args) {