From: XiaoyuX Lu Date: Wed, 29 May 2019 18:40:36 +0000 (+0000) Subject: CryptoPkg/OpensslLib: Add functions for upgrading OpenSSL1_1_1b X-Git-Tag: edk2-stable201905~20 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b739678918240d118f7be72ecf5098e729596e42;hp=b739678918240d118f7be72ecf5098e729596e42 CryptoPkg/OpensslLib: Add functions for upgrading OpenSSL1_1_1b REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1089 * From OpenSSL_1_1_0i(97c0959f27b294fe1eb10b547145ebef2524b896) to OpenSSL_1_1_1b(50eaac9f3337667259de725451f201e784599687), OpenSSL updated DRBG / RAND to request nonce and additional low entropy randomness from system(line 229 openssl/CHANGES). Since OpenSSL_1_1_1b doesn't fully implement rand pool functions for UEFI. We must provide a method to implenet these method. TSC is used as first entropy source if it's availabe otherwise fallback to TimerLib. But we are not sure the amount of randomness they provide. If you really care about the security, one choice is overrided it with hardware generator. Add rand_pool.c to implement these functions required by OpenSSL rand_pool_acquire_entropy rand_pool_add_nonce_data rand_pool_add_additional_data rand_pool_init rand_pool_cleanup rand_pool_keep_random_devices_open And add rand_pool_noise.* for getting entropy noise from different architecture. * We don't need ossl_store functions. We exclude relative files through process_files.pl. And ossl_store_cleanup_int was first added in crypto/init.c OpenSSL_1_1_1(71a5516d). So add a new file(ossl_store.c) to implement ossl_store_cleanup_int function. Cc: Jian J Wang Cc: Ting Ye Signed-off-by: Xiaoyu Lu Tested-by: Gary Lin Reviewed-by: Jian J Wang ---