diff options
| author | jsing <> | 2019-11-04 12:30:56 +0000 |
|---|---|---|
| committer | jsing <> | 2019-11-04 12:30:56 +0000 |
| commit | d02c1c5541c2a19b1c5162995183b2c4ca0c074e (patch) | |
| tree | c73ef3fc14686af3ad303db7c42a3e154a56d43c /src | |
| parent | ac8ecd083e8f20178b9b32fb6bd6d49f4b983994 (diff) | |
| download | openbsd-d02c1c5541c2a19b1c5162995183b2c4ca0c074e.tar.gz openbsd-d02c1c5541c2a19b1c5162995183b2c4ca0c074e.tar.bz2 openbsd-d02c1c5541c2a19b1c5162995183b2c4ca0c074e.zip | |
Reshuffle RSA_PSS_PARAMS and RSA_OAEP_PARAMS to avoid duplicate typedef.
Issue spotted by bcook@
ok bcook@ inoguchi@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa.h | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h index 9859c5f420..78ac04cf96 100644 --- a/src/lib/libcrypto/rsa/rsa.h +++ b/src/lib/libcrypto/rsa/rsa.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa.h,v 1.50 2019/11/02 13:52:31 jsing Exp $ */ | 1 | /* $OpenBSD: rsa.h,v 1.51 2019/11/04 12:30:56 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 | * |
| @@ -84,7 +84,24 @@ extern "C" { | |||
| 84 | /* typedef struct rsa_st RSA; */ | 84 | /* typedef struct rsa_st RSA; */ |
| 85 | /* typedef struct rsa_meth_st RSA_METHOD; */ | 85 | /* typedef struct rsa_meth_st RSA_METHOD; */ |
| 86 | 86 | ||
| 87 | typedef struct rsa_pss_params_st RSA_PSS_PARAMS; | 87 | typedef struct rsa_pss_params_st { |
| 88 | X509_ALGOR *hashAlgorithm; | ||
| 89 | X509_ALGOR *maskGenAlgorithm; | ||
| 90 | ASN1_INTEGER *saltLength; | ||
| 91 | ASN1_INTEGER *trailerField; | ||
| 92 | |||
| 93 | /* Hash algorithm decoded from maskGenAlgorithm. */ | ||
| 94 | X509_ALGOR *maskHash; | ||
| 95 | } RSA_PSS_PARAMS; | ||
| 96 | |||
| 97 | typedef struct rsa_oaep_params_st { | ||
| 98 | X509_ALGOR *hashFunc; | ||
| 99 | X509_ALGOR *maskGenFunc; | ||
| 100 | X509_ALGOR *pSourceFunc; | ||
| 101 | |||
| 102 | /* Hash algorithm decoded from maskGenFunc. */ | ||
| 103 | X509_ALGOR *maskHash; | ||
| 104 | } RSA_OAEP_PARAMS; | ||
| 88 | 105 | ||
| 89 | struct rsa_meth_st { | 106 | struct rsa_meth_st { |
| 90 | const char *name; | 107 | const char *name; |
| @@ -345,31 +362,12 @@ RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **in, long len); | |||
| 345 | int i2d_RSAPrivateKey(const RSA *a, unsigned char **out); | 362 | int i2d_RSAPrivateKey(const RSA *a, unsigned char **out); |
| 346 | extern const ASN1_ITEM RSAPrivateKey_it; | 363 | extern const ASN1_ITEM RSAPrivateKey_it; |
| 347 | 364 | ||
| 348 | typedef struct rsa_pss_params_st { | ||
| 349 | X509_ALGOR *hashAlgorithm; | ||
| 350 | X509_ALGOR *maskGenAlgorithm; | ||
| 351 | ASN1_INTEGER *saltLength; | ||
| 352 | ASN1_INTEGER *trailerField; | ||
| 353 | |||
| 354 | /* Hash algorithm decoded from maskGenAlgorithm. */ | ||
| 355 | X509_ALGOR *maskHash; | ||
| 356 | } RSA_PSS_PARAMS; | ||
| 357 | |||
| 358 | RSA_PSS_PARAMS *RSA_PSS_PARAMS_new(void); | 365 | RSA_PSS_PARAMS *RSA_PSS_PARAMS_new(void); |
| 359 | void RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a); | 366 | void RSA_PSS_PARAMS_free(RSA_PSS_PARAMS *a); |
| 360 | RSA_PSS_PARAMS *d2i_RSA_PSS_PARAMS(RSA_PSS_PARAMS **a, const unsigned char **in, long len); | 367 | RSA_PSS_PARAMS *d2i_RSA_PSS_PARAMS(RSA_PSS_PARAMS **a, const unsigned char **in, long len); |
| 361 | int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out); | 368 | int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out); |
| 362 | extern const ASN1_ITEM RSA_PSS_PARAMS_it; | 369 | extern const ASN1_ITEM RSA_PSS_PARAMS_it; |
| 363 | 370 | ||
| 364 | typedef struct rsa_oaep_params_st { | ||
| 365 | X509_ALGOR *hashFunc; | ||
| 366 | X509_ALGOR *maskGenFunc; | ||
| 367 | X509_ALGOR *pSourceFunc; | ||
| 368 | |||
| 369 | /* Hash algorithm decoded from maskGenFunc. */ | ||
| 370 | X509_ALGOR *maskHash; | ||
| 371 | } RSA_OAEP_PARAMS; | ||
| 372 | |||
| 373 | RSA_OAEP_PARAMS *RSA_OAEP_PARAMS_new(void); | 371 | RSA_OAEP_PARAMS *RSA_OAEP_PARAMS_new(void); |
| 374 | void RSA_OAEP_PARAMS_free(RSA_OAEP_PARAMS *a); | 372 | void RSA_OAEP_PARAMS_free(RSA_OAEP_PARAMS *a); |
| 375 | RSA_OAEP_PARAMS *d2i_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS **a, const unsigned char **in, long len); | 373 | RSA_OAEP_PARAMS *d2i_RSA_OAEP_PARAMS(RSA_OAEP_PARAMS **a, const unsigned char **in, long len); |
