summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2014-07-09 19:51:31 +0000
committerjsing <>2014-07-09 19:51:31 +0000
commit5155b53399b3cd5c9947109652d415d6dcc6ce1d (patch)
tree02ea283e18c2b893acc7bb60207533687e5b4146 /src
parent6b9a0f99def5b0e95e23f0456bdac32ba04e517d (diff)
downloadopenbsd-5155b53399b3cd5c9947109652d415d6dcc6ce1d.tar.gz
openbsd-5155b53399b3cd5c9947109652d415d6dcc6ce1d.tar.bz2
openbsd-5155b53399b3cd5c9947109652d415d6dcc6ce1d.zip
KNF.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/rsa/rsa.h222
-rw-r--r--src/lib/libcrypto/rsa/rsa_locl.h9
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa.h222
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_locl.h9
4 files changed, 216 insertions, 246 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h
index daea33ff60..f51a807c3c 100644
--- a/src/lib/libcrypto/rsa/rsa.h
+++ b/src/lib/libcrypto/rsa/rsa.h
@@ -1,25 +1,25 @@
1/* $OpenBSD: rsa.h,v 1.20 2014/07/09 08:55:32 miod Exp $ */ 1/* $OpenBSD: rsa.h,v 1.21 2014/07/09 19:51:31 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA, 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms 13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 * 15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed. 17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution 18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used. 19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or 20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package. 21 * in documentation (online or textual) provided with the package.
22 * 22 *
23 * Redistribution and use in source and binary forms, with or without 23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions 24 * modification, are permitted provided that the following conditions
25 * are met: 25 * are met:
@@ -34,10 +34,10 @@
34 * Eric Young (eay@cryptsoft.com)" 34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library 35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-). 36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement: 38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 * 40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
@@ -82,25 +82,20 @@ extern "C" {
82/* typedef struct rsa_st RSA; */ 82/* typedef struct rsa_st RSA; */
83/* typedef struct rsa_meth_st RSA_METHOD; */ 83/* typedef struct rsa_meth_st RSA_METHOD; */
84 84
85struct rsa_meth_st 85struct rsa_meth_st {
86 {
87 const char *name; 86 const char *name;
88 int (*rsa_pub_enc)(int flen,const unsigned char *from, 87 int (*rsa_pub_enc)(int flen, const unsigned char *from,
89 unsigned char *to, 88 unsigned char *to, RSA *rsa, int padding);
90 RSA *rsa,int padding); 89 int (*rsa_pub_dec)(int flen, const unsigned char *from,
91 int (*rsa_pub_dec)(int flen,const unsigned char *from, 90 unsigned char *to, RSA *rsa, int padding);
92 unsigned char *to, 91 int (*rsa_priv_enc)(int flen, const unsigned char *from,
93 RSA *rsa,int padding); 92 unsigned char *to, RSA *rsa, int padding);
94 int (*rsa_priv_enc)(int flen,const unsigned char *from, 93 int (*rsa_priv_dec)(int flen, const unsigned char *from,
95 unsigned char *to, 94 unsigned char *to, RSA *rsa, int padding);
96 RSA *rsa,int padding); 95 int (*rsa_mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
97 int (*rsa_priv_dec)(int flen,const unsigned char *from, 96 BN_CTX *ctx); /* Can be null */
98 unsigned char *to,
99 RSA *rsa,int padding);
100 int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
101 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 97 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
102 const BIGNUM *m, BN_CTX *ctx, 98 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); /* Can be null */
103 BN_MONT_CTX *m_ctx); /* Can be null */
104 int (*init)(RSA *rsa); /* called at new */ 99 int (*init)(RSA *rsa); /* called at new */
105 int (*finish)(RSA *rsa); /* called at free */ 100 int (*finish)(RSA *rsa); /* called at free */
106 int flags; /* RSA_METHOD_FLAG_* things */ 101 int flags; /* RSA_METHOD_FLAG_* things */
@@ -112,22 +107,19 @@ struct rsa_meth_st
112 * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER 107 * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
113 * option is set in 'flags'. 108 * option is set in 'flags'.
114 */ 109 */
115 int (*rsa_sign)(int type, 110 int (*rsa_sign)(int type, const unsigned char *m, unsigned int m_length,
116 const unsigned char *m, unsigned int m_length, 111 unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
117 unsigned char *sigret, unsigned int *siglen, const RSA *rsa); 112 int (*rsa_verify)(int dtype, const unsigned char *m,
118 int (*rsa_verify)(int dtype, 113 unsigned int m_length, const unsigned char *sigbuf,
119 const unsigned char *m, unsigned int m_length, 114 unsigned int siglen, const RSA *rsa);
120 const unsigned char *sigbuf, unsigned int siglen,
121 const RSA *rsa);
122/* If this callback is NULL, the builtin software RSA key-gen will be used. This 115/* If this callback is NULL, the builtin software RSA key-gen will be used. This
123 * is for behavioural compatibility whilst the code gets rewired, but one day 116 * is for behavioural compatibility whilst the code gets rewired, but one day
124 * it would be nice to assume there are no such things as "builtin software" 117 * it would be nice to assume there are no such things as "builtin software"
125 * implementations. */ 118 * implementations. */
126 int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 119 int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
127 }; 120};
128 121
129struct rsa_st 122struct rsa_st {
130 {
131 /* The first parameter is used to pickup errors where 123 /* The first parameter is used to pickup errors where
132 * this is passed instead of aEVP_PKEY, it is set to 0 */ 124 * this is passed instead of aEVP_PKEY, it is set to 0 */
133 int pad; 125 int pad;
@@ -157,7 +149,7 @@ struct rsa_st
157 * NULL */ 149 * NULL */
158 BN_BLINDING *blinding; 150 BN_BLINDING *blinding;
159 BN_BLINDING *mt_blinding; 151 BN_BLINDING *mt_blinding;
160 }; 152};
161 153
162#ifndef OPENSSL_RSA_MAX_MODULUS_BITS 154#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
163# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 155# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
@@ -198,13 +190,13 @@ struct rsa_st
198#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA 190#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA
199 * implementation now uses constant time 191 * implementation now uses constant time
200 * operations by default in private key operations, 192 * operations by default in private key operations,
201 * e.g., constant time modular exponentiation, 193 * e.g., constant time modular exponentiation,
202 * modular inverse without leaking branches, 194 * modular inverse without leaking branches,
203 * division without leaking branches. This 195 * division without leaking branches. This
204 * flag disables these constant time 196 * flag disables these constant time
205 * operations and results in faster RSA 197 * operations and results in faster RSA
206 * private key operations. 198 * private key operations.
207 */ 199 */
208#ifndef OPENSSL_NO_DEPRECATED 200#ifndef OPENSSL_NO_DEPRECATED
209#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/ 201#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/
210 /* new with 0.9.7h; the built-in RSA 202 /* new with 0.9.7h; the built-in RSA
@@ -277,34 +269,34 @@ struct rsa_st
277#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) 269#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
278#define RSA_get_app_data(s) RSA_get_ex_data(s,0) 270#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
279 271
280RSA * RSA_new(void); 272RSA *RSA_new(void);
281RSA * RSA_new_method(ENGINE *engine); 273RSA *RSA_new_method(ENGINE *engine);
282int RSA_size(const RSA *rsa); 274int RSA_size(const RSA *rsa);
283 275
284/* Deprecated version */ 276/* Deprecated version */
285#ifndef OPENSSL_NO_DEPRECATED 277#ifndef OPENSSL_NO_DEPRECATED
286RSA * RSA_generate_key(int bits, unsigned long e,void 278RSA *RSA_generate_key(int bits, unsigned long e,
287 (*callback)(int,int,void *),void *cb_arg); 279 void (*callback)(int, int, void *), void *cb_arg);
288#endif /* !defined(OPENSSL_NO_DEPRECATED) */ 280#endif /* !defined(OPENSSL_NO_DEPRECATED) */
289 281
290/* New version */ 282/* New version */
291int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 283int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
292 284
293int RSA_check_key(const RSA *); 285int RSA_check_key(const RSA *);
294 /* next 4 return -1 on error */ 286/* next 4 return -1 on error */
295int RSA_public_encrypt(int flen, const unsigned char *from, 287int RSA_public_encrypt(int flen, const unsigned char *from,
296 unsigned char *to, RSA *rsa,int padding); 288 unsigned char *to, RSA *rsa, int padding);
297int RSA_private_encrypt(int flen, const unsigned char *from, 289int RSA_private_encrypt(int flen, const unsigned char *from,
298 unsigned char *to, RSA *rsa,int padding); 290 unsigned char *to, RSA *rsa, int padding);
299int RSA_public_decrypt(int flen, const unsigned char *from, 291int RSA_public_decrypt(int flen, const unsigned char *from,
300 unsigned char *to, RSA *rsa,int padding); 292 unsigned char *to, RSA *rsa, int padding);
301int RSA_private_decrypt(int flen, const unsigned char *from, 293int RSA_private_decrypt(int flen, const unsigned char *from,
302 unsigned char *to, RSA *rsa,int padding); 294 unsigned char *to, RSA *rsa, int padding);
303void RSA_free (RSA *r); 295void RSA_free (RSA *r);
304/* "up" the RSA object's reference count */ 296/* "up" the RSA object's reference count */
305int RSA_up_ref(RSA *r); 297int RSA_up_ref(RSA *r);
306 298
307int RSA_flags(const RSA *r); 299int RSA_flags(const RSA *r);
308 300
309void RSA_set_default_method(const RSA_METHOD *meth); 301void RSA_set_default_method(const RSA_METHOD *meth);
310const RSA_METHOD *RSA_get_default_method(void); 302const RSA_METHOD *RSA_get_default_method(void);
@@ -319,105 +311,99 @@ const RSA_METHOD *RSA_null_method(void);
319DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) 311DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
320DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) 312DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
321 313
322typedef struct rsa_pss_params_st 314typedef struct rsa_pss_params_st {
323 {
324 X509_ALGOR *hashAlgorithm; 315 X509_ALGOR *hashAlgorithm;
325 X509_ALGOR *maskGenAlgorithm; 316 X509_ALGOR *maskGenAlgorithm;
326 ASN1_INTEGER *saltLength; 317 ASN1_INTEGER *saltLength;
327 ASN1_INTEGER *trailerField; 318 ASN1_INTEGER *trailerField;
328 } RSA_PSS_PARAMS; 319} RSA_PSS_PARAMS;
329 320
330DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) 321DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
331 322
332int RSA_print_fp(FILE *fp, const RSA *r,int offset); 323int RSA_print_fp(FILE *fp, const RSA *r, int offset);
333 324
334#ifndef OPENSSL_NO_BIO 325#ifndef OPENSSL_NO_BIO
335int RSA_print(BIO *bp, const RSA *r,int offset); 326int RSA_print(BIO *bp, const RSA *r, int offset);
336#endif 327#endif
337 328
338#ifndef OPENSSL_NO_RC4 329#ifndef OPENSSL_NO_RC4
339int i2d_RSA_NET(const RSA *a, unsigned char **pp, 330int i2d_RSA_NET(const RSA *a, unsigned char **pp,
340 int (*cb)(char *buf, int len, const char *prompt, int verify), 331 int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
341 int sgckey);
342RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, 332RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
343 int (*cb)(char *buf, int len, const char *prompt, int verify), 333 int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
344 int sgckey);
345 334
346int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, 335int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
347 int (*cb)(char *buf, int len, const char *prompt, 336 int (*cb)(char *buf, int len, const char *prompt, int verify));
348 int verify));
349RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, 337RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
350 int (*cb)(char *buf, int len, const char *prompt, 338 int (*cb)(char *buf, int len, const char *prompt, int verify));
351 int verify));
352#endif 339#endif
353 340
354/* The following 2 functions sign and verify a X509_SIG ASN1 object 341/* The following 2 functions sign and verify a X509_SIG ASN1 object
355 * inside PKCS#1 padded RSA encryption */ 342 * inside PKCS#1 padded RSA encryption */
356int RSA_sign(int type, const unsigned char *m, unsigned int m_length, 343int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
357 unsigned char *sigret, unsigned int *siglen, RSA *rsa); 344 unsigned char *sigret, unsigned int *siglen, RSA *rsa);
358int RSA_verify(int type, const unsigned char *m, unsigned int m_length, 345int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
359 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 346 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
360 347
361/* The following 2 function sign and verify a ASN1_OCTET_STRING 348/* The following 2 function sign and verify a ASN1_OCTET_STRING
362 * object inside PKCS#1 padded RSA encryption */ 349 * object inside PKCS#1 padded RSA encryption */
363int RSA_sign_ASN1_OCTET_STRING(int type, 350int RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m,
364 const unsigned char *m, unsigned int m_length, 351 unsigned int m_length, unsigned char *sigret, unsigned int *siglen,
365 unsigned char *sigret, unsigned int *siglen, RSA *rsa); 352 RSA *rsa);
366int RSA_verify_ASN1_OCTET_STRING(int type, 353int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
367 const unsigned char *m, unsigned int m_length, 354 unsigned int m_length, unsigned char *sigbuf, unsigned int siglen,
368 unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 355 RSA *rsa);
369 356
370int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 357int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
371void RSA_blinding_off(RSA *rsa); 358void RSA_blinding_off(RSA *rsa);
372BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); 359BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
373 360
374int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, 361int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
375 const unsigned char *f,int fl); 362 const unsigned char *f, int fl);
376int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, 363int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
377 const unsigned char *f,int fl,int rsa_len); 364 const unsigned char *f, int fl, int rsa_len);
378int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, 365int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
379 const unsigned char *f,int fl); 366 const unsigned char *f, int fl);
380int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, 367int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
381 const unsigned char *f,int fl,int rsa_len); 368 const unsigned char *f, int fl, int rsa_len);
382int PKCS1_MGF1(unsigned char *mask, long len, 369int PKCS1_MGF1(unsigned char *mask, long len,
383 const unsigned char *seed, long seedlen, const EVP_MD *dgst); 370 const unsigned char *seed, long seedlen, const EVP_MD *dgst);
384int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, 371int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
385 const unsigned char *f,int fl, 372 const unsigned char *f, int fl,
386 const unsigned char *p,int pl); 373 const unsigned char *p, int pl);
387int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen, 374int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
388 const unsigned char *f,int fl,int rsa_len, 375 const unsigned char *f, int fl, int rsa_len,
389 const unsigned char *p,int pl); 376 const unsigned char *p, int pl);
390int RSA_padding_add_SSLv23(unsigned char *to,int tlen, 377int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
391 const unsigned char *f,int fl); 378 const unsigned char *f, int fl);
392int RSA_padding_check_SSLv23(unsigned char *to,int tlen, 379int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
393 const unsigned char *f,int fl,int rsa_len); 380 const unsigned char *f, int fl, int rsa_len);
394int RSA_padding_add_none(unsigned char *to,int tlen, 381int RSA_padding_add_none(unsigned char *to, int tlen,
395 const unsigned char *f,int fl); 382 const unsigned char *f, int fl);
396int RSA_padding_check_none(unsigned char *to,int tlen, 383int RSA_padding_check_none(unsigned char *to, int tlen,
397 const unsigned char *f,int fl,int rsa_len); 384 const unsigned char *f, int fl, int rsa_len);
398int RSA_padding_add_X931(unsigned char *to,int tlen, 385int RSA_padding_add_X931(unsigned char *to, int tlen,
399 const unsigned char *f,int fl); 386 const unsigned char *f, int fl);
400int RSA_padding_check_X931(unsigned char *to,int tlen, 387int RSA_padding_check_X931(unsigned char *to, int tlen,
401 const unsigned char *f,int fl,int rsa_len); 388 const unsigned char *f, int fl, int rsa_len);
402int RSA_X931_hash_id(int nid); 389int RSA_X931_hash_id(int nid);
403 390
404int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, 391int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
405 const EVP_MD *Hash, const unsigned char *EM, int sLen); 392 const EVP_MD *Hash, const unsigned char *EM, int sLen);
406int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, 393int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
407 const unsigned char *mHash, 394 const unsigned char *mHash, const EVP_MD *Hash, int sLen);
408 const EVP_MD *Hash, int sLen);
409 395
410int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, 396int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
411 const EVP_MD *Hash, const EVP_MD *mgf1Hash, 397 const EVP_MD *Hash, const EVP_MD *mgf1Hash, const unsigned char *EM,
412 const unsigned char *EM, int sLen); 398 int sLen);
413 399
414int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, 400int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
415 const unsigned char *mHash, 401 const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash,
416 const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLen); 402 int sLen);
417 403
418int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 404int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
419 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 405 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
420int RSA_set_ex_data(RSA *r,int idx,void *arg); 406int RSA_set_ex_data(RSA *r, int idx, void *arg);
421void *RSA_get_ex_data(const RSA *r, int idx); 407void *RSA_get_ex_data(const RSA *r, int idx);
422 408
423RSA *RSAPublicKey_dup(RSA *rsa); 409RSA *RSAPublicKey_dup(RSA *rsa);
diff --git a/src/lib/libcrypto/rsa/rsa_locl.h b/src/lib/libcrypto/rsa/rsa_locl.h
index 3c2de4826d..24da0dc179 100644
--- a/src/lib/libcrypto/rsa/rsa_locl.h
+++ b/src/lib/libcrypto/rsa/rsa_locl.h
@@ -1,5 +1,4 @@
1/* $OpenBSD: rsa_locl.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: rsa_locl.h,v 1.3 2014/07/09 19:51:31 jsing Exp $ */
2extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, 2extern int int_rsa_verify(int dtype, const unsigned char *m,
3 unsigned char *rm, size_t *prm_len, 3 unsigned int m_len, unsigned char *rm, size_t *prm_len,
4 const unsigned char *sigbuf, size_t siglen, 4 const unsigned char *sigbuf, size_t siglen, RSA *rsa);
5 RSA *rsa);
diff --git a/src/lib/libssl/src/crypto/rsa/rsa.h b/src/lib/libssl/src/crypto/rsa/rsa.h
index daea33ff60..f51a807c3c 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa.h
+++ b/src/lib/libssl/src/crypto/rsa/rsa.h
@@ -1,25 +1,25 @@
1/* $OpenBSD: rsa.h,v 1.20 2014/07/09 08:55:32 miod Exp $ */ 1/* $OpenBSD: rsa.h,v 1.21 2014/07/09 19:51:31 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA, 11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation 12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms 13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com). 14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 * 15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in 16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed. 17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution 18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used. 19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or 20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package. 21 * in documentation (online or textual) provided with the package.
22 * 22 *
23 * Redistribution and use in source and binary forms, with or without 23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions 24 * modification, are permitted provided that the following conditions
25 * are met: 25 * are met:
@@ -34,10 +34,10 @@
34 * Eric Young (eay@cryptsoft.com)" 34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library 35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-). 36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from 37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement: 38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" 39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 * 40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND 41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -49,7 +49,7 @@
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
@@ -82,25 +82,20 @@ extern "C" {
82/* typedef struct rsa_st RSA; */ 82/* typedef struct rsa_st RSA; */
83/* typedef struct rsa_meth_st RSA_METHOD; */ 83/* typedef struct rsa_meth_st RSA_METHOD; */
84 84
85struct rsa_meth_st 85struct rsa_meth_st {
86 {
87 const char *name; 86 const char *name;
88 int (*rsa_pub_enc)(int flen,const unsigned char *from, 87 int (*rsa_pub_enc)(int flen, const unsigned char *from,
89 unsigned char *to, 88 unsigned char *to, RSA *rsa, int padding);
90 RSA *rsa,int padding); 89 int (*rsa_pub_dec)(int flen, const unsigned char *from,
91 int (*rsa_pub_dec)(int flen,const unsigned char *from, 90 unsigned char *to, RSA *rsa, int padding);
92 unsigned char *to, 91 int (*rsa_priv_enc)(int flen, const unsigned char *from,
93 RSA *rsa,int padding); 92 unsigned char *to, RSA *rsa, int padding);
94 int (*rsa_priv_enc)(int flen,const unsigned char *from, 93 int (*rsa_priv_dec)(int flen, const unsigned char *from,
95 unsigned char *to, 94 unsigned char *to, RSA *rsa, int padding);
96 RSA *rsa,int padding); 95 int (*rsa_mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa,
97 int (*rsa_priv_dec)(int flen,const unsigned char *from, 96 BN_CTX *ctx); /* Can be null */
98 unsigned char *to,
99 RSA *rsa,int padding);
100 int (*rsa_mod_exp)(BIGNUM *r0,const BIGNUM *I,RSA *rsa,BN_CTX *ctx); /* Can be null */
101 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 97 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
102 const BIGNUM *m, BN_CTX *ctx, 98 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); /* Can be null */
103 BN_MONT_CTX *m_ctx); /* Can be null */
104 int (*init)(RSA *rsa); /* called at new */ 99 int (*init)(RSA *rsa); /* called at new */
105 int (*finish)(RSA *rsa); /* called at free */ 100 int (*finish)(RSA *rsa); /* called at free */
106 int flags; /* RSA_METHOD_FLAG_* things */ 101 int flags; /* RSA_METHOD_FLAG_* things */
@@ -112,22 +107,19 @@ struct rsa_meth_st
112 * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER 107 * compatibility this functionality is only enabled if the RSA_FLAG_SIGN_VER
113 * option is set in 'flags'. 108 * option is set in 'flags'.
114 */ 109 */
115 int (*rsa_sign)(int type, 110 int (*rsa_sign)(int type, const unsigned char *m, unsigned int m_length,
116 const unsigned char *m, unsigned int m_length, 111 unsigned char *sigret, unsigned int *siglen, const RSA *rsa);
117 unsigned char *sigret, unsigned int *siglen, const RSA *rsa); 112 int (*rsa_verify)(int dtype, const unsigned char *m,
118 int (*rsa_verify)(int dtype, 113 unsigned int m_length, const unsigned char *sigbuf,
119 const unsigned char *m, unsigned int m_length, 114 unsigned int siglen, const RSA *rsa);
120 const unsigned char *sigbuf, unsigned int siglen,
121 const RSA *rsa);
122/* If this callback is NULL, the builtin software RSA key-gen will be used. This 115/* If this callback is NULL, the builtin software RSA key-gen will be used. This
123 * is for behavioural compatibility whilst the code gets rewired, but one day 116 * is for behavioural compatibility whilst the code gets rewired, but one day
124 * it would be nice to assume there are no such things as "builtin software" 117 * it would be nice to assume there are no such things as "builtin software"
125 * implementations. */ 118 * implementations. */
126 int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 119 int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
127 }; 120};
128 121
129struct rsa_st 122struct rsa_st {
130 {
131 /* The first parameter is used to pickup errors where 123 /* The first parameter is used to pickup errors where
132 * this is passed instead of aEVP_PKEY, it is set to 0 */ 124 * this is passed instead of aEVP_PKEY, it is set to 0 */
133 int pad; 125 int pad;
@@ -157,7 +149,7 @@ struct rsa_st
157 * NULL */ 149 * NULL */
158 BN_BLINDING *blinding; 150 BN_BLINDING *blinding;
159 BN_BLINDING *mt_blinding; 151 BN_BLINDING *mt_blinding;
160 }; 152};
161 153
162#ifndef OPENSSL_RSA_MAX_MODULUS_BITS 154#ifndef OPENSSL_RSA_MAX_MODULUS_BITS
163# define OPENSSL_RSA_MAX_MODULUS_BITS 16384 155# define OPENSSL_RSA_MAX_MODULUS_BITS 16384
@@ -198,13 +190,13 @@ struct rsa_st
198#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA 190#define RSA_FLAG_NO_CONSTTIME 0x0100 /* new with 0.9.8f; the built-in RSA
199 * implementation now uses constant time 191 * implementation now uses constant time
200 * operations by default in private key operations, 192 * operations by default in private key operations,
201 * e.g., constant time modular exponentiation, 193 * e.g., constant time modular exponentiation,
202 * modular inverse without leaking branches, 194 * modular inverse without leaking branches,
203 * division without leaking branches. This 195 * division without leaking branches. This
204 * flag disables these constant time 196 * flag disables these constant time
205 * operations and results in faster RSA 197 * operations and results in faster RSA
206 * private key operations. 198 * private key operations.
207 */ 199 */
208#ifndef OPENSSL_NO_DEPRECATED 200#ifndef OPENSSL_NO_DEPRECATED
209#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/ 201#define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME /* deprecated name for the flag*/
210 /* new with 0.9.7h; the built-in RSA 202 /* new with 0.9.7h; the built-in RSA
@@ -277,34 +269,34 @@ struct rsa_st
277#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg) 269#define RSA_set_app_data(s,arg) RSA_set_ex_data(s,0,arg)
278#define RSA_get_app_data(s) RSA_get_ex_data(s,0) 270#define RSA_get_app_data(s) RSA_get_ex_data(s,0)
279 271
280RSA * RSA_new(void); 272RSA *RSA_new(void);
281RSA * RSA_new_method(ENGINE *engine); 273RSA *RSA_new_method(ENGINE *engine);
282int RSA_size(const RSA *rsa); 274int RSA_size(const RSA *rsa);
283 275
284/* Deprecated version */ 276/* Deprecated version */
285#ifndef OPENSSL_NO_DEPRECATED 277#ifndef OPENSSL_NO_DEPRECATED
286RSA * RSA_generate_key(int bits, unsigned long e,void 278RSA *RSA_generate_key(int bits, unsigned long e,
287 (*callback)(int,int,void *),void *cb_arg); 279 void (*callback)(int, int, void *), void *cb_arg);
288#endif /* !defined(OPENSSL_NO_DEPRECATED) */ 280#endif /* !defined(OPENSSL_NO_DEPRECATED) */
289 281
290/* New version */ 282/* New version */
291int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); 283int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
292 284
293int RSA_check_key(const RSA *); 285int RSA_check_key(const RSA *);
294 /* next 4 return -1 on error */ 286/* next 4 return -1 on error */
295int RSA_public_encrypt(int flen, const unsigned char *from, 287int RSA_public_encrypt(int flen, const unsigned char *from,
296 unsigned char *to, RSA *rsa,int padding); 288 unsigned char *to, RSA *rsa, int padding);
297int RSA_private_encrypt(int flen, const unsigned char *from, 289int RSA_private_encrypt(int flen, const unsigned char *from,
298 unsigned char *to, RSA *rsa,int padding); 290 unsigned char *to, RSA *rsa, int padding);
299int RSA_public_decrypt(int flen, const unsigned char *from, 291int RSA_public_decrypt(int flen, const unsigned char *from,
300 unsigned char *to, RSA *rsa,int padding); 292 unsigned char *to, RSA *rsa, int padding);
301int RSA_private_decrypt(int flen, const unsigned char *from, 293int RSA_private_decrypt(int flen, const unsigned char *from,
302 unsigned char *to, RSA *rsa,int padding); 294 unsigned char *to, RSA *rsa, int padding);
303void RSA_free (RSA *r); 295void RSA_free (RSA *r);
304/* "up" the RSA object's reference count */ 296/* "up" the RSA object's reference count */
305int RSA_up_ref(RSA *r); 297int RSA_up_ref(RSA *r);
306 298
307int RSA_flags(const RSA *r); 299int RSA_flags(const RSA *r);
308 300
309void RSA_set_default_method(const RSA_METHOD *meth); 301void RSA_set_default_method(const RSA_METHOD *meth);
310const RSA_METHOD *RSA_get_default_method(void); 302const RSA_METHOD *RSA_get_default_method(void);
@@ -319,105 +311,99 @@ const RSA_METHOD *RSA_null_method(void);
319DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) 311DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)
320DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) 312DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)
321 313
322typedef struct rsa_pss_params_st 314typedef struct rsa_pss_params_st {
323 {
324 X509_ALGOR *hashAlgorithm; 315 X509_ALGOR *hashAlgorithm;
325 X509_ALGOR *maskGenAlgorithm; 316 X509_ALGOR *maskGenAlgorithm;
326 ASN1_INTEGER *saltLength; 317 ASN1_INTEGER *saltLength;
327 ASN1_INTEGER *trailerField; 318 ASN1_INTEGER *trailerField;
328 } RSA_PSS_PARAMS; 319} RSA_PSS_PARAMS;
329 320
330DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) 321DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
331 322
332int RSA_print_fp(FILE *fp, const RSA *r,int offset); 323int RSA_print_fp(FILE *fp, const RSA *r, int offset);
333 324
334#ifndef OPENSSL_NO_BIO 325#ifndef OPENSSL_NO_BIO
335int RSA_print(BIO *bp, const RSA *r,int offset); 326int RSA_print(BIO *bp, const RSA *r, int offset);
336#endif 327#endif
337 328
338#ifndef OPENSSL_NO_RC4 329#ifndef OPENSSL_NO_RC4
339int i2d_RSA_NET(const RSA *a, unsigned char **pp, 330int i2d_RSA_NET(const RSA *a, unsigned char **pp,
340 int (*cb)(char *buf, int len, const char *prompt, int verify), 331 int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
341 int sgckey);
342RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, 332RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,
343 int (*cb)(char *buf, int len, const char *prompt, int verify), 333 int (*cb)(char *buf, int len, const char *prompt, int verify), int sgckey);
344 int sgckey);
345 334
346int i2d_Netscape_RSA(const RSA *a, unsigned char **pp, 335int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
347 int (*cb)(char *buf, int len, const char *prompt, 336 int (*cb)(char *buf, int len, const char *prompt, int verify));
348 int verify));
349RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, 337RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
350 int (*cb)(char *buf, int len, const char *prompt, 338 int (*cb)(char *buf, int len, const char *prompt, int verify));
351 int verify));
352#endif 339#endif
353 340
354/* The following 2 functions sign and verify a X509_SIG ASN1 object 341/* The following 2 functions sign and verify a X509_SIG ASN1 object
355 * inside PKCS#1 padded RSA encryption */ 342 * inside PKCS#1 padded RSA encryption */
356int RSA_sign(int type, const unsigned char *m, unsigned int m_length, 343int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
357 unsigned char *sigret, unsigned int *siglen, RSA *rsa); 344 unsigned char *sigret, unsigned int *siglen, RSA *rsa);
358int RSA_verify(int type, const unsigned char *m, unsigned int m_length, 345int RSA_verify(int type, const unsigned char *m, unsigned int m_length,
359 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 346 const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);
360 347
361/* The following 2 function sign and verify a ASN1_OCTET_STRING 348/* The following 2 function sign and verify a ASN1_OCTET_STRING
362 * object inside PKCS#1 padded RSA encryption */ 349 * object inside PKCS#1 padded RSA encryption */
363int RSA_sign_ASN1_OCTET_STRING(int type, 350int RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m,
364 const unsigned char *m, unsigned int m_length, 351 unsigned int m_length, unsigned char *sigret, unsigned int *siglen,
365 unsigned char *sigret, unsigned int *siglen, RSA *rsa); 352 RSA *rsa);
366int RSA_verify_ASN1_OCTET_STRING(int type, 353int RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,
367 const unsigned char *m, unsigned int m_length, 354 unsigned int m_length, unsigned char *sigbuf, unsigned int siglen,
368 unsigned char *sigbuf, unsigned int siglen, RSA *rsa); 355 RSA *rsa);
369 356
370int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); 357int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
371void RSA_blinding_off(RSA *rsa); 358void RSA_blinding_off(RSA *rsa);
372BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); 359BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
373 360
374int RSA_padding_add_PKCS1_type_1(unsigned char *to,int tlen, 361int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
375 const unsigned char *f,int fl); 362 const unsigned char *f, int fl);
376int RSA_padding_check_PKCS1_type_1(unsigned char *to,int tlen, 363int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
377 const unsigned char *f,int fl,int rsa_len); 364 const unsigned char *f, int fl, int rsa_len);
378int RSA_padding_add_PKCS1_type_2(unsigned char *to,int tlen, 365int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
379 const unsigned char *f,int fl); 366 const unsigned char *f, int fl);
380int RSA_padding_check_PKCS1_type_2(unsigned char *to,int tlen, 367int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
381 const unsigned char *f,int fl,int rsa_len); 368 const unsigned char *f, int fl, int rsa_len);
382int PKCS1_MGF1(unsigned char *mask, long len, 369int PKCS1_MGF1(unsigned char *mask, long len,
383 const unsigned char *seed, long seedlen, const EVP_MD *dgst); 370 const unsigned char *seed, long seedlen, const EVP_MD *dgst);
384int RSA_padding_add_PKCS1_OAEP(unsigned char *to,int tlen, 371int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
385 const unsigned char *f,int fl, 372 const unsigned char *f, int fl,
386 const unsigned char *p,int pl); 373 const unsigned char *p, int pl);
387int RSA_padding_check_PKCS1_OAEP(unsigned char *to,int tlen, 374int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
388 const unsigned char *f,int fl,int rsa_len, 375 const unsigned char *f, int fl, int rsa_len,
389 const unsigned char *p,int pl); 376 const unsigned char *p, int pl);
390int RSA_padding_add_SSLv23(unsigned char *to,int tlen, 377int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
391 const unsigned char *f,int fl); 378 const unsigned char *f, int fl);
392int RSA_padding_check_SSLv23(unsigned char *to,int tlen, 379int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
393 const unsigned char *f,int fl,int rsa_len); 380 const unsigned char *f, int fl, int rsa_len);
394int RSA_padding_add_none(unsigned char *to,int tlen, 381int RSA_padding_add_none(unsigned char *to, int tlen,
395 const unsigned char *f,int fl); 382 const unsigned char *f, int fl);
396int RSA_padding_check_none(unsigned char *to,int tlen, 383int RSA_padding_check_none(unsigned char *to, int tlen,
397 const unsigned char *f,int fl,int rsa_len); 384 const unsigned char *f, int fl, int rsa_len);
398int RSA_padding_add_X931(unsigned char *to,int tlen, 385int RSA_padding_add_X931(unsigned char *to, int tlen,
399 const unsigned char *f,int fl); 386 const unsigned char *f, int fl);
400int RSA_padding_check_X931(unsigned char *to,int tlen, 387int RSA_padding_check_X931(unsigned char *to, int tlen,
401 const unsigned char *f,int fl,int rsa_len); 388 const unsigned char *f, int fl, int rsa_len);
402int RSA_X931_hash_id(int nid); 389int RSA_X931_hash_id(int nid);
403 390
404int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash, 391int RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,
405 const EVP_MD *Hash, const unsigned char *EM, int sLen); 392 const EVP_MD *Hash, const unsigned char *EM, int sLen);
406int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, 393int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,
407 const unsigned char *mHash, 394 const unsigned char *mHash, const EVP_MD *Hash, int sLen);
408 const EVP_MD *Hash, int sLen);
409 395
410int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, 396int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,
411 const EVP_MD *Hash, const EVP_MD *mgf1Hash, 397 const EVP_MD *Hash, const EVP_MD *mgf1Hash, const unsigned char *EM,
412 const unsigned char *EM, int sLen); 398 int sLen);
413 399
414int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, 400int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
415 const unsigned char *mHash, 401 const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash,
416 const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLen); 402 int sLen);
417 403
418int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 404int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
419 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 405 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
420int RSA_set_ex_data(RSA *r,int idx,void *arg); 406int RSA_set_ex_data(RSA *r, int idx, void *arg);
421void *RSA_get_ex_data(const RSA *r, int idx); 407void *RSA_get_ex_data(const RSA *r, int idx);
422 408
423RSA *RSAPublicKey_dup(RSA *rsa); 409RSA *RSAPublicKey_dup(RSA *rsa);
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_locl.h b/src/lib/libssl/src/crypto/rsa/rsa_locl.h
index 3c2de4826d..24da0dc179 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_locl.h
+++ b/src/lib/libssl/src/crypto/rsa/rsa_locl.h
@@ -1,5 +1,4 @@
1/* $OpenBSD: rsa_locl.h,v 1.2 2014/06/12 15:49:30 deraadt Exp $ */ 1/* $OpenBSD: rsa_locl.h,v 1.3 2014/07/09 19:51:31 jsing Exp $ */
2extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, 2extern int int_rsa_verify(int dtype, const unsigned char *m,
3 unsigned char *rm, size_t *prm_len, 3 unsigned int m_len, unsigned char *rm, size_t *prm_len,
4 const unsigned char *sigbuf, size_t siglen, 4 const unsigned char *sigbuf, size_t siglen, RSA *rsa);
5 RSA *rsa);