aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rsa
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rsa')
-rw-r--r--crypto/rsa/rsa.h8
-rw-r--r--crypto/rsa/rsa_err.c3
-rw-r--r--crypto/rsa/rsa_lib.c27
3 files changed, 18 insertions, 20 deletions
diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h
index 74033cf6078..f9f9b5cfe91 100644
--- a/crypto/rsa/rsa.h
+++ b/crypto/rsa/rsa.h
@@ -59,6 +59,10 @@
#ifndef HEADER_RSA_H
#define HEADER_RSA_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <openssl/bn.h>
#include <openssl/crypto.h>
@@ -66,10 +70,6 @@
#error RSA is disabled.
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-
typedef struct rsa_st RSA;
typedef struct rsa_meth_st
diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c
index 1cde7c0da46..5cfbea2b033 100644
--- a/crypto/rsa/rsa_err.c
+++ b/crypto/rsa/rsa_err.c
@@ -54,8 +54,7 @@
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
- * made to it will be overwritten when the script next updates this file,
- * only reason strings will be preserved.
+ * made to it will be overwritten when the script next updates this file.
*/
#include <stdio.h>
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 88d93a46ddb..074a4f5074b 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -81,19 +81,6 @@ void RSA_set_default_method(RSA_METHOD *meth)
RSA_METHOD *RSA_get_default_method(void)
{
- if (default_RSA_meth == NULL)
- {
-#ifdef RSA_NULL
- default_RSA_meth=RSA_null_method();
-#else
-#ifdef RSAref
- default_RSA_meth=RSA_PKCS1_RSAref();
-#else
- default_RSA_meth=RSA_PKCS1_SSLeay();
-#endif
-#endif
- }
-
return default_RSA_meth;
}
@@ -116,6 +103,18 @@ RSA *RSA_new_method(RSA_METHOD *meth)
{
RSA *ret;
+ if (default_RSA_meth == NULL)
+ {
+#ifdef RSA_NULL
+ default_RSA_meth=RSA_null_method();
+#else
+#ifdef RSAref
+ default_RSA_meth=RSA_PKCS1_RSAref();
+#else
+ default_RSA_meth=RSA_PKCS1_SSLeay();
+#endif
+#endif
+ }
ret=(RSA *)Malloc(sizeof(RSA));
if (ret == NULL)
{
@@ -124,7 +123,7 @@ RSA *RSA_new_method(RSA_METHOD *meth)
}
if (meth == NULL)
- ret->meth=RSA_get_default_method();
+ ret->meth=default_RSA_meth;
else
ret->meth=meth;