diff options
author | Krzysztof Jackiewicz <k.jackiewicz@samsung.com> | 2019-09-18 11:44:24 +0200 |
---|---|---|
committer | Krzysztof Jackiewicz <k.jackiewicz@samsung.com> | 2019-09-18 12:17:16 +0200 |
commit | c68cb02a89bc062c6b99af42d69cbb749240cf65 (patch) | |
tree | 8af455c91e5e221020fbbbd280be5e829cacb78b /crypto/rsa | |
parent | a47da67cfe68e4a7b1c0b546bdcf71004ba703b1 (diff) | |
parent | 7e25cb9bea3993135aa8154a98032fd30fc16e1c (diff) | |
download | openssl-submit/tizen_base/20191001.092458.tar.gz openssl-submit/tizen_base/20191001.092458.tar.bz2 openssl-submit/tizen_base/20191001.092458.zip |
Merge branch 'upstream' into tizen_basetizen_5.5.m2_releasesubmit/tizen_base/20191001.092458submit/tizen_5.5_base_mobile_hotfix/20201023.171501submit/tizen_5.5_base/20191030.000001accepted/tizen/base/20191008.101335accepted/tizen/5.5/base/mobile/hotfix/20201023.085356accepted/tizen/5.5/base/20191030.083643tizen_5.5_tvtizen_5.5_base_mobile_hotfixaccepted/tizen_5.5_base_mobile_hotfix
Change-Id: I052187c6bd9cc55d587fd63c000608ead364e629
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_chk.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/rsa/rsa_chk.c b/crypto/rsa/rsa_chk.c index 475dfc5..fb62c35 100644 --- a/crypto/rsa/rsa_chk.c +++ b/crypto/rsa/rsa_chk.c @@ -1,6 +1,6 @@ /* crypto/rsa/rsa_chk.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2019 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -63,6 +63,10 @@ int RSA_check_key(const RSA *key) return 0; } + /* Set consant-time flag on private parameters */ + BN_set_flags(key->p, BN_FLG_CONSTTIME); + BN_set_flags(key->q, BN_FLG_CONSTTIME); + BN_set_flags(key->d, BN_FLG_CONSTTIME); i = BN_new(); j = BN_new(); k = BN_new(); @@ -141,6 +145,10 @@ int RSA_check_key(const RSA *key) } if (key->dmp1 != NULL && key->dmq1 != NULL && key->iqmp != NULL) { + /* Set consant-time flag on CRT parameters */ + BN_set_flags(key->dmp1, BN_FLG_CONSTTIME); + BN_set_flags(key->dmq1, BN_FLG_CONSTTIME); + BN_set_flags(key->iqmp, BN_FLG_CONSTTIME); /* dmp1 = d mod (p-1)? */ if (!BN_sub(i, key->p, BN_value_one())) { ret = -1; |