]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Change CHAP secret default length
authorLucian Petrut <petrutlucian94@gmail.com>
Fri, 14 Nov 2014 16:22:04 +0000 (18:22 +0200)
committerPetrut Lucian <lpetrut@cloudbasesolutions.com>
Wed, 19 Nov 2014 16:36:50 +0000 (16:36 +0000)
Some of the iSCSI initiators have a limit regarding the maximum
CHAP secret length. For example, the MS iSCSI Initiator
does not allow CHAP secrets longer than 16 characters, smaller
than the actual default 20 characters length.

This patch simply changes the default length to 16 characters,
value which is already used by default by some of the volume
drivers. In fact, the iSCSI specs state that: "Implementations
MUST support use of up to 128 bit random CHAP secrets".

Change-Id: I0295fabd0c0048c93e1f452077d0f5d19af9784d
Closes-Bug: #1392792

cinder/volume/utils.py

index 24ccf6141dc22ec071922a2a0314f782d79b42c7..a1fd79c094f0faf62809d719de60e552249444d4 100644 (file)
@@ -411,7 +411,7 @@ DEFAULT_PASSWORD_SYMBOLS = ('23456789',  # Removed: 0,1
                             'abcdefghijkmnopqrstuvwxyz')  # Removed: l
 
 
-def generate_password(length=20, symbolgroups=DEFAULT_PASSWORD_SYMBOLS):
+def generate_password(length=16, symbolgroups=DEFAULT_PASSWORD_SYMBOLS):
     """Generate a random password from the supplied symbol groups.
 
     At least one symbol from each group will be included. Unpredictable