Configurable token hash algorithm

Tokens were always hashed with MD5. This change allows tokens to
be hashed with SHA256 (or any other algorithm supported by the
keystoneclient token hash function). This is for security
hardening.

There's a new configuration option 'hash_algorithm' in the [token]
section. This is the algorithm to use for hashing PKI tokens, so is
used

a) when storing the token in the db
b) as the hash in the revocation list

hash_algorithm defaults to 'md5' for backwards compatibility.

SecurityImpact
DocImpact
Closes-Bug: #1174499

Change-Id: Iafe3c975d59818c8f362647f7ea5149a03deee47
Code which gets elements of tree in ldap moved to a common method

Code which uses 'search_s' in ldap backends moved
to a new method to remove duplication of code.

Change-Id: I5b9b89d452d6031b54ccb15cdbd9129939d29f7f
Merge "Code which gets elements of tree in ldap moved to a common method"
Merge "Configurable token hash algorithm"