heat/heat/tests/openstack/heat
Zane Bitter a08893dc86 Fix entropy problems with OS::Random::String
When generating a random string, once we had selected from the various
required pools, we continued by selecting a pool at random and then
selecting a character from that pool at random. This did not take into
account the differing sizes of the available pools, nor the fact that the
same character could appear in multiple pools, which resulted in a
non-uniform probability distribution of characters. Since users mostly make
use of this feature to generate default passwords for services they are
deploying, this would result in the generated passwords having slightly
less entropy than expected (and pathological cases were possible).

Rectify this by always selecting non-constrained characters from a single
combined pool, and by ensuring that each character appears only once in any
pool we're selecting from.

Since we also want to use this method to generate passwords for OpenStack
Users, the new implementation is in a separate module in heat.common rather
than mixed in with the resource's logic. Also, use a StringIO object to
collect the characters rather than repeatedly appending to a string.

Change-Id: Ia7b63e72c1e3c0649290caf4fea8a32f7f89560b
Closes-Bug: #1757300
Related-Bug: #1666129
Related-Bug: #1444429
(cherry picked from commit 6e16c051ba)
2018-04-05 12:43:13 -04:00
..
__init__.py Change namespace for Heat resources and tests 2015-11-27 01:37:07 +08:00
test_cloud_config.py Add one general testing of resource_mapping 2016-02-25 02:52:34 -05:00
test_cloudwatch.py No need to check if resource not created 2017-02-15 06:14:45 +00:00
test_cw_alarm.py Begin move of UpdateReplace back to its rightful location 2016-08-18 12:57:54 -04:00
test_deployed_server.py To merge the occ data for OS::Heat::DeployedServer 2017-07-21 02:50:18 +00:00
test_instance_group.py Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
test_instance_group_update_policy.py Use more specific asserts in tests 2016-11-22 08:12:35 +01:00
test_multi_part.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
test_none_resource.py Update StackDefinition resource data when getting outputs 2017-07-21 10:30:34 -04:00
test_random_string.py Fix entropy problems with OS::Random::String 2018-04-05 12:43:13 -04:00
test_remote_stack.py Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
test_resource_chain.py Fix nested template genearation when attribute path is not string 2018-01-20 04:14:14 +00:00
test_resource_group.py Include outputs in rolling update of ResourceGroup 2018-02-07 14:31:10 -05:00
test_restarter.py Unit tests: make tests more realistic 2017-07-21 10:30:34 -04:00
test_software_component.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
test_software_config.py Use exception_filter in RPC client 2017-03-27 14:38:53 -04:00
test_software_deployment.py Merge "Implement handle_<action>_cancel for SoftwareDeployment" 2017-08-10 17:38:48 +00:00
test_structured_config.py Validate the input/output configs in Software Config 2016-08-10 11:01:35 -04:00
test_swiftsignal.py Use StackDefinition in intrinsic functions for resolving data 2017-07-21 10:30:34 -04:00
test_value.py Update StackDefinition resource data when getting outputs 2017-07-21 10:30:34 -04:00
test_waitcondition.py Correct validation of wait conditon 2017-06-08 06:46:16 +00:00