summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-11-24 18:51:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2017-01-08 01:42:46 +0000
commit6745a1ff3268f3e3598df3ec3c34b08b369ed1bf (patch)
treec6f2ba36b562b49c5c91805e3bdfb3c737d6e5dd /include
parent3b72dcd5fb4d2c756a830dba1fc34f4a7ae61b73 (diff)
Cache maskHash parameter
Store hash algorithm used for MGF1 masks in PSS and OAEP modes in PSS and OAEP parameter structure: this avoids the need to decode part of the ASN.1 structure every time it is used. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2177)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/rsa.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
index d97d6e075a..5d4ab4ef2d 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -239,6 +239,8 @@ typedef struct rsa_pss_params_st {
X509_ALGOR *maskGenAlgorithm;
ASN1_INTEGER *saltLength;
ASN1_INTEGER *trailerField;
+ /* Decoded hash algorithm from maskGenAlgorithm */
+ X509_ALGOR *maskHash;
} RSA_PSS_PARAMS;
DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)
@@ -247,6 +249,8 @@ typedef struct rsa_oaep_params_st {
X509_ALGOR *hashFunc;
X509_ALGOR *maskGenFunc;
X509_ALGOR *pSourceFunc;
+ /* Decoded hash algorithm from maskGenFunc */
+ X509_ALGOR *maskHash;
} RSA_OAEP_PARAMS;
DECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)