diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa.h')
-rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index 4814a2fc15..cf74343657 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
@@ -222,22 +222,12 @@ struct rsa_st | |||
222 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ | 222 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \ |
223 | pad, NULL) | 223 | pad, NULL) |
224 | 224 | ||
225 | #define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \ | ||
226 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \ | ||
227 | EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad) | ||
228 | |||
229 | #define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ | 225 | #define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \ |
230 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ | 226 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ |
231 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ | 227 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ |
232 | EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ | 228 | EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \ |
233 | len, NULL) | 229 | len, NULL) |
234 | 230 | ||
235 | #define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \ | ||
236 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \ | ||
237 | (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \ | ||
238 | EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \ | ||
239 | 0, plen) | ||
240 | |||
241 | #define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ | 231 | #define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \ |
242 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ | 232 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ |
243 | EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) | 233 | EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL) |
@@ -246,24 +236,11 @@ struct rsa_st | |||
246 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ | 236 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \ |
247 | EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) | 237 | EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp) |
248 | 238 | ||
249 | #define EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md) \ | ||
250 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ | ||
251 | EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md) | ||
252 | |||
253 | #define EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \ | ||
254 | EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_SIG, \ | ||
255 | EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd) | ||
256 | |||
257 | #define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) | 239 | #define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) |
258 | #define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) | 240 | #define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 2) |
259 | 241 | ||
260 | #define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) | 242 | #define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 3) |
261 | #define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) | 243 | #define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4) |
262 | #define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 5) | ||
263 | |||
264 | #define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 6) | ||
265 | #define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 7) | ||
266 | #define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 8) | ||
267 | 244 | ||
268 | #define RSA_PKCS1_PADDING 1 | 245 | #define RSA_PKCS1_PADDING 1 |
269 | #define RSA_SSLV23_PADDING 2 | 246 | #define RSA_SSLV23_PADDING 2 |
@@ -323,16 +300,6 @@ const RSA_METHOD *RSA_null_method(void); | |||
323 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) | 300 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey) |
324 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) | 301 | DECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey) |
325 | 302 | ||
326 | typedef struct rsa_pss_params_st | ||
327 | { | ||
328 | X509_ALGOR *hashAlgorithm; | ||
329 | X509_ALGOR *maskGenAlgorithm; | ||
330 | ASN1_INTEGER *saltLength; | ||
331 | ASN1_INTEGER *trailerField; | ||
332 | } RSA_PSS_PARAMS; | ||
333 | |||
334 | DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) | ||
335 | |||
336 | #ifndef OPENSSL_NO_FP_API | 303 | #ifndef OPENSSL_NO_FP_API |
337 | int RSA_print_fp(FILE *fp, const RSA *r,int offset); | 304 | int RSA_print_fp(FILE *fp, const RSA *r,int offset); |
338 | #endif | 305 | #endif |
@@ -413,14 +380,6 @@ int RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM, | |||
413 | const unsigned char *mHash, | 380 | const unsigned char *mHash, |
414 | const EVP_MD *Hash, int sLen); | 381 | const EVP_MD *Hash, int sLen); |
415 | 382 | ||
416 | int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash, | ||
417 | const EVP_MD *Hash, const EVP_MD *mgf1Hash, | ||
418 | const unsigned char *EM, int sLen); | ||
419 | |||
420 | int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, | ||
421 | const unsigned char *mHash, | ||
422 | const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLen); | ||
423 | |||
424 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, | 383 | int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, |
425 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); | 384 | CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); |
426 | int RSA_set_ex_data(RSA *r,int idx,void *arg); | 385 | int RSA_set_ex_data(RSA *r,int idx,void *arg); |
@@ -429,25 +388,6 @@ void *RSA_get_ex_data(const RSA *r, int idx); | |||
429 | RSA *RSAPublicKey_dup(RSA *rsa); | 388 | RSA *RSAPublicKey_dup(RSA *rsa); |
430 | RSA *RSAPrivateKey_dup(RSA *rsa); | 389 | RSA *RSAPrivateKey_dup(RSA *rsa); |
431 | 390 | ||
432 | /* If this flag is set the RSA method is FIPS compliant and can be used | ||
433 | * in FIPS mode. This is set in the validated module method. If an | ||
434 | * application sets this flag in its own methods it is its responsibility | ||
435 | * to ensure the result is compliant. | ||
436 | */ | ||
437 | |||
438 | #define RSA_FLAG_FIPS_METHOD 0x0400 | ||
439 | |||
440 | /* If this flag is set the operations normally disabled in FIPS mode are | ||
441 | * permitted it is then the applications responsibility to ensure that the | ||
442 | * usage is compliant. | ||
443 | */ | ||
444 | |||
445 | #define RSA_FLAG_NON_FIPS_ALLOW 0x0400 | ||
446 | /* Application has decided PRNG is good enough to generate a key: don't | ||
447 | * check. | ||
448 | */ | ||
449 | #define RSA_FLAG_CHECKED 0x0800 | ||
450 | |||
451 | /* BEGIN ERROR CODES */ | 391 | /* BEGIN ERROR CODES */ |
452 | /* The following lines are auto generated by the script mkerr.pl. Any changes | 392 | /* The following lines are auto generated by the script mkerr.pl. Any changes |
453 | * made after this point may be overwritten when the script is next run. | 393 | * made after this point may be overwritten when the script is next run. |
@@ -465,7 +405,6 @@ void ERR_load_RSA_strings(void); | |||
465 | #define RSA_F_PKEY_RSA_CTRL 143 | 405 | #define RSA_F_PKEY_RSA_CTRL 143 |
466 | #define RSA_F_PKEY_RSA_CTRL_STR 144 | 406 | #define RSA_F_PKEY_RSA_CTRL_STR 144 |
467 | #define RSA_F_PKEY_RSA_SIGN 142 | 407 | #define RSA_F_PKEY_RSA_SIGN 142 |
468 | #define RSA_F_PKEY_RSA_VERIFY 154 | ||
469 | #define RSA_F_PKEY_RSA_VERIFYRECOVER 141 | 408 | #define RSA_F_PKEY_RSA_VERIFYRECOVER 141 |
470 | #define RSA_F_RSA_BUILTIN_KEYGEN 129 | 409 | #define RSA_F_RSA_BUILTIN_KEYGEN 129 |
471 | #define RSA_F_RSA_CHECK_KEY 123 | 410 | #define RSA_F_RSA_CHECK_KEY 123 |
@@ -474,8 +413,6 @@ void ERR_load_RSA_strings(void); | |||
474 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 | 413 | #define RSA_F_RSA_EAY_PUBLIC_DECRYPT 103 |
475 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 | 414 | #define RSA_F_RSA_EAY_PUBLIC_ENCRYPT 104 |
476 | #define RSA_F_RSA_GENERATE_KEY 105 | 415 | #define RSA_F_RSA_GENERATE_KEY 105 |
477 | #define RSA_F_RSA_GENERATE_KEY_EX 155 | ||
478 | #define RSA_F_RSA_ITEM_VERIFY 156 | ||
479 | #define RSA_F_RSA_MEMORY_LOCK 130 | 416 | #define RSA_F_RSA_MEMORY_LOCK 130 |
480 | #define RSA_F_RSA_NEW_METHOD 106 | 417 | #define RSA_F_RSA_NEW_METHOD 106 |
481 | #define RSA_F_RSA_NULL 124 | 418 | #define RSA_F_RSA_NULL 124 |
@@ -487,7 +424,6 @@ void ERR_load_RSA_strings(void); | |||
487 | #define RSA_F_RSA_PADDING_ADD_NONE 107 | 424 | #define RSA_F_RSA_PADDING_ADD_NONE 107 |
488 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 | 425 | #define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP 121 |
489 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 | 426 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS 125 |
490 | #define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1 148 | ||
491 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 | 427 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1 108 |
492 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 | 428 | #define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2 109 |
493 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 | 429 | #define RSA_F_RSA_PADDING_ADD_SSLV23 110 |
@@ -500,12 +436,8 @@ void ERR_load_RSA_strings(void); | |||
500 | #define RSA_F_RSA_PADDING_CHECK_X931 128 | 436 | #define RSA_F_RSA_PADDING_CHECK_X931 128 |
501 | #define RSA_F_RSA_PRINT 115 | 437 | #define RSA_F_RSA_PRINT 115 |
502 | #define RSA_F_RSA_PRINT_FP 116 | 438 | #define RSA_F_RSA_PRINT_FP 116 |
503 | #define RSA_F_RSA_PRIVATE_DECRYPT 150 | ||
504 | #define RSA_F_RSA_PRIVATE_ENCRYPT 151 | ||
505 | #define RSA_F_RSA_PRIV_DECODE 137 | 439 | #define RSA_F_RSA_PRIV_DECODE 137 |
506 | #define RSA_F_RSA_PRIV_ENCODE 138 | 440 | #define RSA_F_RSA_PRIV_ENCODE 138 |
507 | #define RSA_F_RSA_PUBLIC_DECRYPT 152 | ||
508 | #define RSA_F_RSA_PUBLIC_ENCRYPT 153 | ||
509 | #define RSA_F_RSA_PUB_DECODE 139 | 441 | #define RSA_F_RSA_PUB_DECODE 139 |
510 | #define RSA_F_RSA_SETUP_BLINDING 136 | 442 | #define RSA_F_RSA_SETUP_BLINDING 136 |
511 | #define RSA_F_RSA_SIGN 117 | 443 | #define RSA_F_RSA_SIGN 117 |
@@ -513,7 +445,6 @@ void ERR_load_RSA_strings(void); | |||
513 | #define RSA_F_RSA_VERIFY 119 | 445 | #define RSA_F_RSA_VERIFY 119 |
514 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 | 446 | #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 |
515 | #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 | 447 | #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 |
516 | #define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1 149 | ||
517 | 448 | ||
518 | /* Reason codes. */ | 449 | /* Reason codes. */ |
519 | #define RSA_R_ALGORITHM_MISMATCH 100 | 450 | #define RSA_R_ALGORITHM_MISMATCH 100 |
@@ -539,24 +470,19 @@ void ERR_load_RSA_strings(void); | |||
539 | #define RSA_R_INVALID_HEADER 137 | 470 | #define RSA_R_INVALID_HEADER 137 |
540 | #define RSA_R_INVALID_KEYBITS 145 | 471 | #define RSA_R_INVALID_KEYBITS 145 |
541 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 | 472 | #define RSA_R_INVALID_MESSAGE_LENGTH 131 |
542 | #define RSA_R_INVALID_MGF1_MD 156 | ||
543 | #define RSA_R_INVALID_PADDING 138 | 473 | #define RSA_R_INVALID_PADDING 138 |
544 | #define RSA_R_INVALID_PADDING_MODE 141 | 474 | #define RSA_R_INVALID_PADDING_MODE 141 |
545 | #define RSA_R_INVALID_PSS_PARAMETERS 149 | ||
546 | #define RSA_R_INVALID_PSS_SALTLEN 146 | 475 | #define RSA_R_INVALID_PSS_SALTLEN 146 |
547 | #define RSA_R_INVALID_SALT_LENGTH 150 | ||
548 | #define RSA_R_INVALID_TRAILER 139 | 476 | #define RSA_R_INVALID_TRAILER 139 |
549 | #define RSA_R_INVALID_X931_DIGEST 142 | 477 | #define RSA_R_INVALID_X931_DIGEST 142 |
550 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 | 478 | #define RSA_R_IQMP_NOT_INVERSE_OF_Q 126 |
551 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 | 479 | #define RSA_R_KEY_SIZE_TOO_SMALL 120 |
552 | #define RSA_R_LAST_OCTET_INVALID 134 | 480 | #define RSA_R_LAST_OCTET_INVALID 134 |
553 | #define RSA_R_MODULUS_TOO_LARGE 105 | 481 | #define RSA_R_MODULUS_TOO_LARGE 105 |
554 | #define RSA_R_NON_FIPS_RSA_METHOD 157 | ||
555 | #define RSA_R_NO_PUBLIC_EXPONENT 140 | 482 | #define RSA_R_NO_PUBLIC_EXPONENT 140 |
556 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 | 483 | #define RSA_R_NULL_BEFORE_BLOCK_MISSING 113 |
557 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 | 484 | #define RSA_R_N_DOES_NOT_EQUAL_P_Q 127 |
558 | #define RSA_R_OAEP_DECODING_ERROR 121 | 485 | #define RSA_R_OAEP_DECODING_ERROR 121 |
559 | #define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE 158 | ||
560 | #define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 | 486 | #define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 148 |
561 | #define RSA_R_PADDING_CHECK_FAILED 114 | 487 | #define RSA_R_PADDING_CHECK_FAILED 114 |
562 | #define RSA_R_P_NOT_PRIME 128 | 488 | #define RSA_R_P_NOT_PRIME 128 |
@@ -567,12 +493,7 @@ void ERR_load_RSA_strings(void); | |||
567 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 | 493 | #define RSA_R_SSLV3_ROLLBACK_ATTACK 115 |
568 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 | 494 | #define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116 |
569 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 | 495 | #define RSA_R_UNKNOWN_ALGORITHM_TYPE 117 |
570 | #define RSA_R_UNKNOWN_MASK_DIGEST 151 | ||
571 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 | 496 | #define RSA_R_UNKNOWN_PADDING_TYPE 118 |
572 | #define RSA_R_UNKNOWN_PSS_DIGEST 152 | ||
573 | #define RSA_R_UNSUPPORTED_MASK_ALGORITHM 153 | ||
574 | #define RSA_R_UNSUPPORTED_MASK_PARAMETER 154 | ||
575 | #define RSA_R_UNSUPPORTED_SIGNATURE_TYPE 155 | ||
576 | #define RSA_R_VALUE_MISSING 147 | 497 | #define RSA_R_VALUE_MISSING 147 |
577 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 | 498 | #define RSA_R_WRONG_SIGNATURE_LENGTH 119 |
578 | 499 | ||