diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_null.c')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa_null.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_null.c b/src/lib/libcrypto/rsa/rsa_null.c index 7b58a0eca3..64057fbdcf 100644 --- a/src/lib/libcrypto/rsa/rsa_null.c +++ b/src/lib/libcrypto/rsa/rsa_null.c | |||
@@ -69,16 +69,16 @@ | |||
69 | * operations (like storing RSA keys) are permitted. | 69 | * operations (like storing RSA keys) are permitted. |
70 | */ | 70 | */ |
71 | 71 | ||
72 | static int RSA_null_public_encrypt(int flen, unsigned char *from, | 72 | static int RSA_null_public_encrypt(int flen, const unsigned char *from, |
73 | unsigned char *to, RSA *rsa,int padding); | 73 | unsigned char *to, RSA *rsa,int padding); |
74 | static int RSA_null_private_encrypt(int flen, unsigned char *from, | 74 | static int RSA_null_private_encrypt(int flen, const unsigned char *from, |
75 | unsigned char *to, RSA *rsa,int padding); | 75 | unsigned char *to, RSA *rsa,int padding); |
76 | static int RSA_null_public_decrypt(int flen, unsigned char *from, | 76 | static int RSA_null_public_decrypt(int flen, const unsigned char *from, |
77 | unsigned char *to, RSA *rsa,int padding); | 77 | unsigned char *to, RSA *rsa,int padding); |
78 | static int RSA_null_private_decrypt(int flen, unsigned char *from, | 78 | static int RSA_null_private_decrypt(int flen, const unsigned char *from, |
79 | unsigned char *to, RSA *rsa,int padding); | 79 | unsigned char *to, RSA *rsa,int padding); |
80 | #if 0 /* not currently used */ | 80 | #if 0 /* not currently used */ |
81 | static int RSA_null_mod_exp(BIGNUM *r0, BIGNUM *i, RSA *rsa); | 81 | static int RSA_null_mod_exp(const BIGNUM *r0, const BIGNUM *i, RSA *rsa); |
82 | #endif | 82 | #endif |
83 | static int RSA_null_init(RSA *rsa); | 83 | static int RSA_null_init(RSA *rsa); |
84 | static int RSA_null_finish(RSA *rsa); | 84 | static int RSA_null_finish(RSA *rsa); |
@@ -88,40 +88,41 @@ static RSA_METHOD rsa_null_meth={ | |||
88 | RSA_null_public_decrypt, | 88 | RSA_null_public_decrypt, |
89 | RSA_null_private_encrypt, | 89 | RSA_null_private_encrypt, |
90 | RSA_null_private_decrypt, | 90 | RSA_null_private_decrypt, |
91 | NULL, NULL, | 91 | NULL, |
92 | NULL, | ||
92 | RSA_null_init, | 93 | RSA_null_init, |
93 | RSA_null_finish, | 94 | RSA_null_finish, |
94 | 0, | 95 | 0, |
95 | NULL, | 96 | NULL, |
96 | }; | 97 | }; |
97 | 98 | ||
98 | RSA_METHOD *RSA_null_method(void) | 99 | const RSA_METHOD *RSA_null_method(void) |
99 | { | 100 | { |
100 | return(&rsa_null_meth); | 101 | return(&rsa_null_meth); |
101 | } | 102 | } |
102 | 103 | ||
103 | static int RSA_null_public_encrypt(int flen, unsigned char *from, | 104 | static int RSA_null_public_encrypt(int flen, const unsigned char *from, |
104 | unsigned char *to, RSA *rsa, int padding) | 105 | unsigned char *to, RSA *rsa, int padding) |
105 | { | 106 | { |
106 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 107 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
107 | return -1; | 108 | return -1; |
108 | } | 109 | } |
109 | 110 | ||
110 | static int RSA_null_private_encrypt(int flen, unsigned char *from, | 111 | static int RSA_null_private_encrypt(int flen, const unsigned char *from, |
111 | unsigned char *to, RSA *rsa, int padding) | 112 | unsigned char *to, RSA *rsa, int padding) |
112 | { | 113 | { |
113 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 114 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
114 | return -1; | 115 | return -1; |
115 | } | 116 | } |
116 | 117 | ||
117 | static int RSA_null_private_decrypt(int flen, unsigned char *from, | 118 | static int RSA_null_private_decrypt(int flen, const unsigned char *from, |
118 | unsigned char *to, RSA *rsa, int padding) | 119 | unsigned char *to, RSA *rsa, int padding) |
119 | { | 120 | { |
120 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 121 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |
121 | return -1; | 122 | return -1; |
122 | } | 123 | } |
123 | 124 | ||
124 | static int RSA_null_public_decrypt(int flen, unsigned char *from, | 125 | static int RSA_null_public_decrypt(int flen, const unsigned char *from, |
125 | unsigned char *to, RSA *rsa, int padding) | 126 | unsigned char *to, RSA *rsa, int padding) |
126 | { | 127 | { |
127 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); | 128 | RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED); |