aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/o_fips.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:43:31 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:43:31 +0100
commitc9aad1ae6227c434d480d1d3aa8eae3c3c910c18 (patch)
tree94b917df998c3d547e191b3b9c58bbffc616470e /openssl/crypto/o_fips.c
parentf1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (diff)
downloadvcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.tar.gz
vcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.tar.bz2
vcxsrv-c9aad1ae6227c434d480d1d3aa8eae3c3c910c18.zip
Upgraded to openssl-1.0.2
Diffstat (limited to 'openssl/crypto/o_fips.c')
-rw-r--r--openssl/crypto/o_fips.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/openssl/crypto/o_fips.c b/openssl/crypto/o_fips.c
index f6d1b2185..f56d5bb79 100644
--- a/openssl/crypto/o_fips.c
+++ b/openssl/crypto/o_fips.c
@@ -1,5 +1,6 @@
-/* Written by Stephen henson (steve@openssl.org) for the OpenSSL
- * project 2011.
+/*
+ * Written by Stephen henson (steve@openssl.org) for the OpenSSL project
+ * 2011.
*/
/* ====================================================================
* Copyright (c) 2011 The OpenSSL Project. All rights reserved.
@@ -9,7 +10,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -57,40 +58,39 @@
#include "cryptlib.h"
#ifdef OPENSSL_FIPS
-#include <openssl/fips.h>
-#include <openssl/fips_rand.h>
-#include <openssl/rand.h>
+# include <openssl/fips.h>
+# include <openssl/fips_rand.h>
+# include <openssl/rand.h>
#endif
int FIPS_mode(void)
- {
- OPENSSL_init();
+{
+ OPENSSL_init();
#ifdef OPENSSL_FIPS
- return FIPS_module_mode();
+ return FIPS_module_mode();
#else
- return 0;
+ return 0;
#endif
- }
+}
int FIPS_mode_set(int r)
- {
- OPENSSL_init();
+{
+ OPENSSL_init();
#ifdef OPENSSL_FIPS
-#ifndef FIPS_AUTH_USER_PASS
-#define FIPS_AUTH_USER_PASS "Default FIPS Crypto User Password"
-#endif
- if (!FIPS_module_mode_set(r, FIPS_AUTH_USER_PASS))
- return 0;
- if (r)
- RAND_set_rand_method(FIPS_rand_get_method());
- else
- RAND_set_rand_method(NULL);
- return 1;
+# ifndef FIPS_AUTH_USER_PASS
+# define FIPS_AUTH_USER_PASS "Default FIPS Crypto User Password"
+# endif
+ if (!FIPS_module_mode_set(r, FIPS_AUTH_USER_PASS))
+ return 0;
+ if (r)
+ RAND_set_rand_method(FIPS_rand_get_method());
+ else
+ RAND_set_rand_method(NULL);
+ return 1;
#else
- if (r == 0)
- return 1;
- CRYPTOerr(CRYPTO_F_FIPS_MODE_SET, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED);
- return 0;
+ if (r == 0)
+ return 1;
+ CRYPTOerr(CRYPTO_F_FIPS_MODE_SET, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED);
+ return 0;
#endif
- }
-
+}