Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1623224

Summary: PEP8 test fails
Product: Red Hat OpenStack Reporter: Arie Bregman <abregman>
Component: openstack-octaviaAssignee: Carlos Goncalves <cgoncalves>
Status: CLOSED CURRENTRELEASE QA Contact: Alexander Stafeyev <astafeye>
Severity: medium Docs Contact:
Priority: medium    
Version: 13.0 (Queens)CC: cgoncalves, ihrachys, jschluet, lpeer, majopela, nyechiel
Target Milestone: zstreamKeywords: AutomationBlocker, Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-octavia-2.0.1-7.bb99c7fgit.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1629466 (view as bug list) Environment:
Last Closed: 2018-10-04 11:44:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1629466    

Description Arie Bregman 2018-08-28 19:17:37 UTC
Description of problem:

Test results:
>> Issue: [B303:blacklist] Use of insecure MD2, MD4, MD5, or SHA1 hash function.
   Severity: Medium   Confidence: High
   Location: octavia/common/tls_utils/cert_parser.py:364
   More Info: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5
363	    return data_models.TLSContainer(
364	        id=hashlib.sha1(cert.get_certificate()).hexdigest(),
365	        primary_cn=get_primary_cn(cert),

--------------------------------------------------
>> Issue: [B303:blacklist] Use of insecure MD2, MD4, MD5, or SHA1 hash function.
   Severity: Medium   Confidence: High
   Location: octavia/common/utils.py:41
   More Info: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5
40	def base64_sha1_string(string_to_hash):
41	    hash_str = hashlib.sha1(string_to_hash.encode('utf-8')).digest()
42	    b64_str = base64.b64encode(hash_str, str.encode('_-', 'ascii'))

Version-Release number of selected component (if applicable): Latest 10


How reproducible: 100%


Steps to Reproduce:
1. Clone repo
2. Checkout 13 branch and run 'tox -e pep8'

Comment 2 Carlos Goncalves 2018-08-28 19:26:43 UTC
Fixed in https://review.openstack.org/#/c/593112/

Queens 2.0.2 (pending release approval https://review.openstack.org/#/c/593954/) will include this fix.