summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/rsa/rsa_null.c
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-07-09 08:20:08 +0000
committermiod <miod@openbsd.org>2014-07-09 08:20:08 +0000
commit87203b09ae4087c72bdef490d474f017ac8c73cf (patch)
treed2a4f7968b7a0d1d12e65af3baac6e66fd262516 /lib/libssl/src/crypto/rsa/rsa_null.c
parentSet default of net.inet6.icmp6.nodeinfo to 0, (diff)
downloadwireguard-openbsd-87203b09ae4087c72bdef490d474f017ac8c73cf.tar.xz
wireguard-openbsd-87203b09ae4087c72bdef490d474f017ac8c73cf.zip
KNF
Diffstat (limited to 'lib/libssl/src/crypto/rsa/rsa_null.c')
-rw-r--r--lib/libssl/src/crypto/rsa/rsa_null.c87
1 files changed, 50 insertions, 37 deletions
diff --git a/lib/libssl/src/crypto/rsa/rsa_null.c b/lib/libssl/src/crypto/rsa/rsa_null.c
index c4404fbe442..54f1cabc743 100644
--- a/lib/libssl/src/crypto/rsa/rsa_null.c
+++ b/lib/libssl/src/crypto/rsa/rsa_null.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_null.c,v 1.6 2014/06/12 15:49:30 deraadt Exp $ */
+/* $OpenBSD: rsa_null.c,v 1.7 2014/07/09 08:20:08 miod Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -62,7 +62,8 @@
#include <openssl/rsa.h>
#include <openssl/rand.h>
-/* This is a dummy RSA implementation that just returns errors when called.
+/*
+ * This is a dummy RSA implementation that just returns errors when called.
* It is designed to allow some RSA functions to work while stopping those
* covered by the RSA patent. That is RSA, encryption, decryption, signing
* and verify is not allowed but RSA key generation, key checking and other
@@ -92,53 +93,65 @@ static RSA_METHOD rsa_null_meth = {
.finish = RSA_null_finish,
};
-const RSA_METHOD *RSA_null_method(void)
- {
- return(&rsa_null_meth);
- }
+const RSA_METHOD *
+RSA_null_method(void)
+{
+ return &rsa_null_meth;
+}
-static int RSA_null_public_encrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa, int padding)
- {
- RSAerr(RSA_F_RSA_NULL_PUBLIC_ENCRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
+static int
+RSA_null_public_encrypt(int flen, const unsigned char *from, unsigned char *to,
+ RSA *rsa, int padding)
+{
+ RSAerr(RSA_F_RSA_NULL_PUBLIC_ENCRYPT,
+ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
return -1;
- }
+}
-static int RSA_null_private_encrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa, int padding)
- {
- RSAerr(RSA_F_RSA_NULL_PRIVATE_ENCRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
+static int
+RSA_null_private_encrypt(int flen, const unsigned char *from, unsigned char *to,
+ RSA *rsa, int padding)
+{
+ RSAerr(RSA_F_RSA_NULL_PRIVATE_ENCRYPT,
+ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
return -1;
- }
+}
-static int RSA_null_private_decrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa, int padding)
- {
- RSAerr(RSA_F_RSA_NULL_PRIVATE_DECRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
+static int
+RSA_null_private_decrypt(int flen, const unsigned char *from, unsigned char *to,
+ RSA *rsa, int padding)
+{
+ RSAerr(RSA_F_RSA_NULL_PRIVATE_DECRYPT,
+ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
return -1;
- }
+}
-static int RSA_null_public_decrypt(int flen, const unsigned char *from,
- unsigned char *to, RSA *rsa, int padding)
- {
- RSAerr(RSA_F_RSA_NULL_PUBLIC_DECRYPT, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
+static int
+RSA_null_public_decrypt(int flen, const unsigned char *from, unsigned char *to,
+ RSA *rsa, int padding)
+{
+ RSAerr(RSA_F_RSA_NULL_PUBLIC_DECRYPT,
+ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
return -1;
- }
+}
#if 0 /* not currently used */
-static int RSA_null_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
- {
+static int
+RSA_null_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa)
+{
...err(RSA_F_RSA_NULL_MOD_EXP, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
return -1;
- }
+}
#endif
-static int RSA_null_init(RSA *rsa)
- {
- return(1);
- }
+static int
+RSA_null_init(RSA *rsa)
+{
+ return 1;
+}
-static int RSA_null_finish(RSA *rsa)
- {
- return(1);
- }
+static int
+RSA_null_finish(RSA *rsa)
+{
+ return 1;
+}