diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa.h')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 319 |
1 files changed, 173 insertions, 146 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index aeb78ffcd3..030a6c88e5 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
@@ -59,36 +59,73 @@ | |||
59 | #ifndef HEADER_RSA_H | 59 | #ifndef HEADER_RSA_H |
60 | #define HEADER_RSA_H | 60 | #define HEADER_RSA_H |
61 | 61 | ||
62 | #include <openssl/asn1.h> | ||
63 | |||
64 | #ifndef OPENSSL_NO_BIO | ||
65 | #include <openssl/bio.h> | ||
66 | #endif | ||
67 | #include <openssl/bn.h> | ||
68 | #include <openssl/crypto.h> | ||
69 | #include <openssl/ossl_typ.h> | ||
70 | |||
71 | #ifdef OPENSSL_NO_RSA | ||
72 | #error RSA is disabled. | ||
73 | #endif | ||
74 | |||
62 | #ifdef __cplusplus | 75 | #ifdef __cplusplus |
63 | extern "C" { | 76 | extern "C" { |
64 | #endif | 77 | #endif |
65 | 78 | ||
66 | #include "bn.h" | 79 | typedef struct rsa_st RSA; |
67 | #include "crypto.h" | ||
68 | 80 | ||
69 | typedef struct rsa_meth_st | 81 | typedef struct rsa_meth_st |
70 | { | 82 | { |
71 | char *name; | 83 | const char *name; |
72 | int (*rsa_pub_enc)(); | 84 | int (*rsa_pub_enc)(int flen,const unsigned char *from, |
73 | int (*rsa_pub_dec)(); | 85 | unsigned char *to, |
74 | int (*rsa_priv_enc)(); | 86 | RSA *rsa,int padding); |
75 | int (*rsa_priv_dec)(); | 87 | int (*rsa_pub_dec)(int flen,const unsigned char *from, |
76 | int (*rsa_mod_exp)(); /* Can be null */ | 88 | unsigned char *to, |
77 | int (*bn_mod_exp)(); /* Can be null */ | 89 | RSA *rsa,int padding); |
78 | int (*init)(/* RSA * */); /* called at new */ | 90 | int (*rsa_priv_enc)(int flen,const unsigned char *from, |
79 | int (*finish)(/* RSA * */); /* called at free */ | 91 | unsigned char *to, |
80 | 92 | RSA *rsa,int padding); | |
93 | int (*rsa_priv_dec)(int flen,const unsigned char *from, | ||
94 | unsigned char *to, | ||
95 | RSA *rsa,int padding); | ||
96 | int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa); /* Can be null */ | ||
97 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
98 | const BIGNUM *m, BN_CTX *ctx, | ||
99 | BN_MONT_CTX *m_ctx); /* Can be null */ | ||
100 | int (*init)(RSA *rsa); /* called at new */ | ||
101 | int (*finish)(RSA *rsa); /* called at free */ | ||
81 | int flags; /* RSA_METHOD_FLAG_* things */ | 102 | int flags; /* RSA_METHOD_FLAG_* things */ |
82 | char *app_data; /* may be needed! */ | 103 | char *app_data; /* may be needed! */ |
104 | /* New sign and verify functions: some libraries don't allow arbitrary data | ||
105 | * to be signed/verified: this allows them to be used. Note: for this to work | ||
106 | * the RSA_public_decrypt() and RSA_private_encrypt() should *NOT* be used | ||
107 | * RSA_sign(), RSA_verify() should be used instead. Note: for backwards | ||
108 | * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER | ||
109 | * option is set in 'flags'. | ||
110 | */ | ||
111 | int (*rsa_sign)(int type, | ||
112 | const unsigned char *m, unsigned int m_length, | ||
113 | unsigned char *sigret, unsigned int *siglen, const RSA *rsa); | ||
114 | int (*rsa_verify)(int dtype, | ||
115 | const unsigned char *m, unsigned int m_length, | ||
116 | unsigned char *sigbuf, unsigned int siglen, const RSA *rsa); | ||
117 | |||
83 | } RSA_METHOD; | 118 | } RSA_METHOD; |
84 | 119 | ||
85 | typedef struct rsa_st | 120 | struct rsa_st |
86 | { | 121 | { |
87 | /* The first parameter is used to pickup errors where | 122 | /* The first parameter is used to pickup errors where |
88 | * this is passed instead of aEVP_PKEY, it is set to 0 */ | 123 | * this is passed instead of aEVP_PKEY, it is set to 0 */ |
89 | int pad; | 124 | int pad; |
90 | int version; | 125 | long version; |
91 | RSA_METHOD *meth; | 126 | const RSA_METHOD *meth; |
127 | /* functional reference if 'meth' is ENGINE-provided */ | ||
128 | ENGINE *engine; | ||
92 | BIGNUM *n; | 129 | BIGNUM *n; |
93 | BIGNUM *e; | 130 | BIGNUM *e; |
94 | BIGNUM *d; | 131 | BIGNUM *d; |
@@ -97,203 +134,182 @@ typedef struct rsa_st | |||
97 | BIGNUM *dmp1; | 134 | BIGNUM *dmp1; |
98 | BIGNUM *dmq1; | 135 | BIGNUM *dmq1; |
99 | BIGNUM *iqmp; | 136 | BIGNUM *iqmp; |
100 | /* be carefull using this if the RSA structure is shared */ | 137 | /* be careful using this if the RSA structure is shared */ |
101 | CRYPTO_EX_DATA ex_data; | 138 | CRYPTO_EX_DATA ex_data; |
102 | int references; | 139 | int references; |
103 | int flags; | 140 | int flags; |
104 | 141 | ||
105 | /* Normally used to cached montgomery values */ | 142 | /* Used to cache montgomery values */ |
106 | char *method_mod_n; | 143 | BN_MONT_CTX *_method_mod_n; |
107 | char *method_mod_p; | 144 | BN_MONT_CTX *_method_mod_p; |
108 | char *method_mod_q; | 145 | BN_MONT_CTX *_method_mod_q; |
109 | 146 | ||
147 | /* all BIGNUM values are actually in the following data, if it is not | ||
148 | * NULL */ | ||
149 | char *bignum_data; | ||
110 | BN_BLINDING *blinding; | 150 | BN_BLINDING *blinding; |
111 | } RSA; | 151 | }; |
112 | 152 | ||
113 | #define RSA_3 0x3L | 153 | #define RSA_3 0x3L |
114 | #define RSA_F4 0x10001L | 154 | #define RSA_F4 0x10001L |
115 | 155 | ||
116 | #define RSA_METHOD_FLAG_NO_CHECK 0x01 /* don't check pub/private match */ | 156 | #define RSA_METHOD_FLAG_NO_CHECK 0x01 /* don't check pub/private match */ |
157 | |||
117 | #define RSA_FLAG_CACHE_PUBLIC 0x02 | 158 | #define RSA_FLAG_CACHE_PUBLIC 0x02 |
118 | #define RSA_FLAG_CACHE_PRIVATE 0x04 | 159 | #define RSA_FLAG_CACHE_PRIVATE 0x04 |
119 | #define RSA_FLAG_BLINDING 0x08 | 160 | #define RSA_FLAG_BLINDING 0x08 |
120 | #define RSA_FLAG_THREAD_SAFE 0x10 | 161 | #define RSA_FLAG_THREAD_SAFE 0x10 |
162 | /* This flag means the private key operations will be handled by rsa_mod_exp | ||
163 | * and that they do not depend on the private key components being present: | ||
164 | * for example a key stored in external hardware. Without this flag bn_mod_exp | ||
165 | * gets called when private key components are absent. | ||
166 | */ | ||
167 | #define RSA_FLAG_EXT_PKEY 0x20 | ||
168 | |||
169 | /* This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify functions. | ||
170 | */ | ||
171 | #define RSA_FLAG_SIGN_VER 0x40 | ||
121 | 172 | ||
122 | #define RSA_PKCS1_PADDING 1 | 173 | #define RSA_PKCS1_PADDING 1 |
123 | #define RSA_SSLV23_PADDING 2 | 174 | #define RSA_SSLV23_PADDING 2 |
124 | #define RSA_NO_PADDING 3 | 175 | #define RSA_NO_PADDING 3 |
176 | #define RSA_PKCS1_OAEP_PADDING 4 | ||
125 | 177 | ||
126 | #define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,(char *)arg) | 178 | #define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) |
127 | #define RSA_get_app_data(s) RSA_get_ex_data(s,0) | 179 | #define RSA_get_app_data(s) RSA_get_ex_data(s,0) |
128 | 180 | ||
129 | #ifndef NOPROTO | ||
130 | RSA * RSA_new(void); | 181 | RSA * RSA_new(void); |
131 | RSA * RSA_new_method(RSA_METHOD *method); | 182 | RSA * RSA_new_method(ENGINE *engine); |
132 | int RSA_size(RSA *); | 183 | int RSA_size(const RSA *); |
133 | RSA * RSA_generate_key(int bits, unsigned long e,void | 184 | RSA * RSA_generate_key(int bits, unsigned long e,void |
134 | (*callback)(int,int,char *),char *cb_arg); | 185 | (*callback)(int,int,void *),void *cb_arg); |
186 | int RSA_check_key(const RSA *); | ||
135 | /* next 4 return -1 on error */ | 187 | /* next 4 return -1 on error */ |
136 | int RSA_public_encrypt(int flen, unsigned char *from, | 188 | int RSA_public_encrypt(int flen, const unsigned char *from, |
137 | unsigned char *to, RSA *rsa,int padding); | 189 | unsigned char *to, RSA *rsa,int padding); |
138 | int RSA_private_encrypt(int flen, unsigned char *from, | 190 | int RSA_private_encrypt(int flen, const unsigned char *from, |
139 | unsigned char *to, RSA *rsa,int padding); | 191 | unsigned char *to, RSA *rsa,int padding); |
140 | int RSA_public_decrypt(int flen, unsigned char *from, | 192 | int RSA_public_decrypt(int flen, const unsigned char *from, |
141 | unsigned char *to, RSA *rsa,int padding); | 193 | unsigned char *to, RSA *rsa,int padding); |
142 | int RSA_private_decrypt(int flen, unsigned char *from, | 194 | int RSA_private_decrypt(int flen, const unsigned char *from, |
143 | unsigned char *to, RSA *rsa,int padding); | 195 | unsigned char *to, RSA *rsa,int padding); |
144 | void RSA_free (RSA *r); | 196 | void RSA_free (RSA *r); |
197 | /* "up" the RSA object's reference count */ | ||
198 | int RSA_up_ref(RSA *r); | ||
145 | 199 | ||
146 | int RSA_flags(RSA *r); | 200 | int RSA_flags(const RSA *r); |
147 | 201 | ||
148 | void RSA_set_default_method(RSA_METHOD *meth); | 202 | void RSA_set_default_method(const RSA_METHOD *meth); |
203 | const RSA_METHOD *RSA_get_default_method(void); | ||
204 | const RSA_METHOD *RSA_get_method(const RSA *rsa); | ||
205 | int RSA_set_method(RSA *rsa, const RSA_METHOD *meth); | ||
149 | 206 | ||
150 | /* If you have RSAref compiled in. */ | 207 | /* This function needs the memory locking malloc callbacks to be installed */ |
151 | RSA_METHOD *RSA_PKCS1_RSAref(void); | 208 | int RSA_memory_lock(RSA *r); |
152 | 209 | ||
153 | /* these are the actual SSLeay RSA functions */ | 210 | /* these are the actual SSLeay RSA functions */ |
154 | RSA_METHOD *RSA_PKCS1_SSLeay(void); | 211 | const RSA_METHOD *RSA_PKCS1_SSLeay(void); |
212 | |||
213 | const RSA_METHOD *RSA_null_method(void); | ||
155 | 214 | ||
156 | void ERR_load_RSA_strings(void ); | 215 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) |
216 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) | ||
157 | 217 | ||
158 | RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); | 218 | #ifndef OPENSSL_NO_FP_API |
159 | int i2d_RSAPublicKey(RSA *a, unsigned char **pp); | 219 | int RSA_print_fp(FILE *fp, const RSA *r,int offset); |
160 | RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); | ||
161 | int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); | ||
162 | #ifndef NO_FP_API | ||
163 | int RSA_print_fp(FILE *fp, RSA *r,int offset); | ||
164 | #endif | 220 | #endif |
165 | 221 | ||
166 | #ifdef HEADER_BIO_H | 222 | #ifndef OPENSSL_NO_BIO |
167 | int RSA_print(BIO *bp, RSA *r,int offset); | 223 | int RSA_print(BIO *bp, const RSA *r,int offset); |
168 | #endif | 224 | #endif |
169 | 225 | ||
170 | int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); | 226 | int i2d_RSA_NET(const RSA *a, unsigned char **pp, int (*cb)(), int sgckey); |
171 | RSA *d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); | 227 | RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, int (*cb)(), int sgckey); |
172 | /* Naughty internal function required elsewhere, to handle a MS structure | 228 | |
173 | * that is the same as the netscape one :-) */ | 229 | int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, int (*cb)()); |
174 | RSA *d2i_Netscape_RSA_2(RSA **a, unsigned char **pp, long length, int (*cb)()); | 230 | RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, int (*cb)()); |
175 | 231 | ||
176 | /* The following 2 functions sign and verify a X509_SIG ASN1 object | 232 | /* The following 2 functions sign and verify a X509_SIG ASN1 object |
177 | * inside PKCS#1 padded RSA encryption */ | 233 | * inside PKCS#1 padded RSA encryption */ |
178 | int RSA_sign(int type, unsigned char *m, unsigned int m_len, | 234 | int RSA_sign(int type, const unsigned char *m, unsigned int m_length, |
179 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | 235 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); |
180 | int RSA_verify(int type, unsigned char *m, unsigned int m_len, | 236 | int RSA_verify(int type, const unsigned char *m, unsigned int m_length, |
181 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | 237 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); |
182 | 238 | ||
183 | /* The following 2 function sign and verify a ASN1_OCTET_STRING | 239 | /* The following 2 function sign and verify a ASN1_OCTET_STRING |
184 | * object inside PKCS#1 padded RSA encryption */ | 240 | * object inside PKCS#1 padded RSA encryption */ |
185 | int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len, | 241 | int RSA_sign_ASN1_OCTET_STRING(int type, |
242 | const unsigned char *m, unsigned int m_length, | ||
186 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | 243 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); |
187 | int RSA_verify_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len, | 244 | int RSA_verify_ASN1_OCTET_STRING(int type, |
245 | const unsigned char *m, unsigned int m_length, | ||
188 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | 246 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); |
189 | 247 | ||
190 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); | 248 | int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); |
191 | void RSA_blinding_off(RSA *rsa); | 249 | void RSA_blinding_off(RSA *rsa); |
192 | 250 | ||
193 | int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, | 251 | int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, |
194 | unsigned char *f,int fl); | 252 | const unsigned char *f,int fl); |
195 | int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, | 253 | int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, |
196 | unsigned char *f,int fl); | 254 | const unsigned char *f,int fl,int rsa_len); |
197 | int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, | 255 | int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, |
198 | unsigned char *f,int fl); | 256 | const unsigned char *f,int fl); |
199 | int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, | 257 | int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, |
200 | unsigned char *f,int fl); | 258 | const unsigned char *f,int fl,int rsa_len); |
259 | int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, | ||
260 | const unsigned char *f,int fl, | ||
261 | const unsigned char *p,int pl); | ||
262 | int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen, | ||
263 | const unsigned char *f,int fl,int rsa_len, | ||
264 | const unsigned char *p,int pl); | ||
201 | int RSA_padding_add_SSLv23(unsigned char *to,int tlen, | 265 | int RSA_padding_add_SSLv23(unsigned char *to,int tlen, |
202 | unsigned char *f,int fl); | 266 | const unsigned char *f,int fl); |
203 | int RSA_padding_check_SSLv23(unsigned char *to,int tlen, | 267 | int RSA_padding_check_SSLv23(unsigned char *to,int tlen, |
204 | unsigned char *f,int fl); | 268 | const unsigned char *f,int fl,int rsa_len); |
205 | int RSA_padding_add_none(unsigned char *to,int tlen, | 269 | int RSA_padding_add_none(unsigned char *to,int tlen, |
206 | unsigned char *f,int fl); | 270 | const unsigned char *f,int fl); |
207 | int RSA_padding_check_none(unsigned char *to,int tlen, | 271 | int RSA_padding_check_none(unsigned char *to,int tlen, |
208 | unsigned char *f,int fl); | 272 | const unsigned char *f,int fl,int rsa_len); |
209 | |||
210 | int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), | ||
211 | int (*dup_func)(), void (*free_func)()); | ||
212 | int RSA_set_ex_data(RSA *r,int idx,char *arg); | ||
213 | char *RSA_get_ex_data(RSA *r, int idx); | ||
214 | |||
215 | #else | ||
216 | |||
217 | RSA * RSA_new(); | ||
218 | RSA * RSA_new_method(); | ||
219 | int RSA_size(); | ||
220 | RSA * RSA_generate_key(); | ||
221 | int RSA_public_encrypt(); | ||
222 | int RSA_private_encrypt(); | ||
223 | int RSA_public_decrypt(); | ||
224 | int RSA_private_decrypt(); | ||
225 | void RSA_free (); | ||
226 | 273 | ||
227 | int RSA_flags(); | 274 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
228 | 275 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | |
229 | void RSA_set_default_method(); | 276 | int RSA_set_ex_data(RSA *r,int idx,void *arg); |
230 | 277 | void *RSA_get_ex_data(const RSA *r, int idx); | |
231 | /* RSA_METHOD *RSA_PKCS1_RSAref(); */ | ||
232 | RSA_METHOD *RSA_PKCS1_SSLeay(); | ||
233 | |||
234 | void ERR_load_RSA_strings(); | ||
235 | |||
236 | RSA * d2i_RSAPublicKey(); | ||
237 | int i2d_RSAPublicKey(); | ||
238 | RSA * d2i_RSAPrivateKey(); | ||
239 | int i2d_RSAPrivateKey(); | ||
240 | #ifndef NO_FP_API | ||
241 | int RSA_print_fp(); | ||
242 | #endif | ||
243 | |||
244 | int RSA_print(); | ||
245 | |||
246 | int i2d_Netscape_RSA(); | ||
247 | RSA *d2i_Netscape_RSA(); | ||
248 | RSA *d2i_Netscape_RSA_2(); | ||
249 | |||
250 | int RSA_sign(); | ||
251 | int RSA_verify(); | ||
252 | |||
253 | int RSA_sign_ASN1_OCTET_STRING(); | ||
254 | int RSA_verify_ASN1_OCTET_STRING(); | ||
255 | int RSA_blinding_on(); | ||
256 | void RSA_blinding_off(); | ||
257 | |||
258 | int RSA_padding_add_PKCS1_type_1(); | ||
259 | int RSA_padding_check_PKCS1_type_1(); | ||
260 | int RSA_padding_add_PKCS1_type_2(); | ||
261 | int RSA_padding_check_PKCS1_type_2(); | ||
262 | int RSA_padding_add_SSLv23(); | ||
263 | int RSA_padding_check_SSLv23(); | ||
264 | int RSA_padding_add_none(); | ||
265 | int RSA_padding_check_none(); | ||
266 | |||
267 | int RSA_get_ex_new_index(); | ||
268 | int RSA_set_ex_data(); | ||
269 | char *RSA_get_ex_data(); | ||
270 | |||
271 | #endif | ||
272 | 278 | ||
273 | /* BEGIN ERROR CODES */ | 279 | /* BEGIN ERROR CODES */ |
280 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
281 | * made after this point may be overwritten when the script is next run. | ||
282 | */ | ||
283 | void ERR_load_RSA_strings(void); | ||
284 | |||
274 | /* Error codes for the RSA functions. */ | 285 | /* Error codes for the RSA functions. */ |
275 | 286 | ||
276 | /* Function codes. */ | 287 | /* Function codes. */ |
277 | #define RSA_F_RSA_EAY_PRIVATE_DECRYPT 100 | 288 | #define RSA_F_MEMORY_LOCK 100 |
278 | #define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 101 | 289 | #define RSA_F_RSA_CHECK_KEY 123 |
279 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 102 | 290 | #define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 |
280 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 103 | 291 | #define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 |
281 | #define RSA_F_RSA_GENERATE_KEY 104 | 292 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 |
282 | #define RSA_F_RSA_NEW_METHOD 105 | 293 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 |
283 | #define RSA_F_RSA_PADDING_ADD_NONE 106 | 294 | #define RSA_F_RSA_GENERATE_KEY 105 |
284 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 107 | 295 | #define RSA_F_RSA_NEW_METHOD 106 |
285 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 108 | 296 | #define RSA_F_RSA_NULL 124 |
286 | #define RSA_F_RSA_PADDING_ADD_SSLV23 109 | 297 | #define RSA_F_RSA_PADDING_ADD_NONE 107 |
287 | #define RSA_F_RSA_PADDING_CHECK_NONE 110 | 298 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 |
288 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 111 | 299 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 |
289 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 112 | 300 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 |
290 | #define RSA_F_RSA_PADDING_CHECK_SSLV23 113 | 301 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 |
291 | #define RSA_F_RSA_PRINT 114 | 302 | #define RSA_F_RSA_PADDING_CHECK_NONE 111 |
292 | #define RSA_F_RSA_PRINT_FP 115 | 303 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP 122 |
293 | #define RSA_F_RSA_SIGN 116 | 304 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1 112 |
294 | #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 117 | 305 | #define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2 113 |
295 | #define RSA_F_RSA_VERIFY 118 | 306 | #define RSA_F_RSA_PADDING_CHECK_SSLV23 114 |
296 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 119 | 307 | #define RSA_F_RSA_PRINT 115 |
308 | #define RSA_F_RSA_PRINT_FP 116 | ||
309 | #define RSA_F_RSA_SIGN 117 | ||
310 | #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 | ||
311 | #define RSA_F_RSA_VERIFY 119 | ||
312 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 | ||
297 | 313 | ||
298 | /* Reason codes. */ | 314 | /* Reason codes. */ |
299 | #define RSA_R_ALGORITHM_MISMATCH 100 | 315 | #define RSA_R_ALGORITHM_MISMATCH 100 |
@@ -301,24 +317,35 @@ char *RSA_get_ex_data(); | |||
301 | #define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 | 317 | #define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 |
302 | #define RSA_R_BAD_PAD_BYTE_COUNT 103 | 318 | #define RSA_R_BAD_PAD_BYTE_COUNT 103 |
303 | #define RSA_R_BAD_SIGNATURE 104 | 319 | #define RSA_R_BAD_SIGNATURE 104 |
304 | #define RSA_R_BAD_ZERO_BYTE 105 | ||
305 | #define RSA_R_BLOCK_TYPE_IS_NOT_01 106 | 320 | #define RSA_R_BLOCK_TYPE_IS_NOT_01 106 |
306 | #define RSA_R_BLOCK_TYPE_IS_NOT_02 107 | 321 | #define RSA_R_BLOCK_TYPE_IS_NOT_02 107 |
307 | #define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 | 322 | #define RSA_R_DATA_GREATER_THAN_MOD_LEN 108 |
308 | #define RSA_R_DATA_TOO_LARGE 109 | 323 | #define RSA_R_DATA_TOO_LARGE 109 |
309 | #define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 | 324 | #define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 110 |
325 | #define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 132 | ||
310 | #define RSA_R_DATA_TOO_SMALL 111 | 326 | #define RSA_R_DATA_TOO_SMALL 111 |
327 | #define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 122 | ||
311 | #define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 | 328 | #define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 112 |
329 | #define RSA_R_DMP1_NOT_CONGRUENT_TO_D 124 | ||
330 | #define RSA_R_DMQ1_NOT_CONGRUENT_TO_D 125 | ||
331 | #define RSA_R_D_E_NOT_CONGRUENT_TO_1 123 | ||
332 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 | ||
333 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 | ||
334 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 | ||
312 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 | 335 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 |
336 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 | ||
337 | #define RSA_R_OAEP_DECODING_ERROR 121 | ||
313 | #define RSA_R_PADDING_CHECK_FAILED 114 | 338 | #define RSA_R_PADDING_CHECK_FAILED 114 |
339 | #define RSA_R_P_NOT_PRIME 128 | ||
340 | #define RSA_R_Q_NOT_PRIME 129 | ||
341 | #define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED 130 | ||
314 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 | 342 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 |
315 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 | 343 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 |
316 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 | 344 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 |
317 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 | 345 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 |
318 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 | 346 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 |
319 | 347 | ||
320 | #ifdef __cplusplus | 348 | #ifdef __cplusplus |
321 | } | 349 | } |
322 | #endif | 350 | #endif |
323 | #endif | 351 | #endif |
324 | |||