Setting token hashing to greater than sha256 will not work with the SQL token backend

Bug #1329554 reported by Morgan Fainberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Won't Fix
Wishlist
Unassigned

Bug Description

The SQL Token backend sets the ID of the token to a 64 column. sha512 will generate a 128 character (byte) string.

>>> a =hashlib.sha512('test').hexdigest()
>>> a
'ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff'
>>> len(a)
128
>>>

Changed in keystone:
importance: Undecided → Medium
summary: - Setting token hashing to sha512 will not work with the SQL token backend
+ Setting token hashing to greater than sha256 will not work with the SQL
+ token backend
Revision history for this message
Adam Young (ayoung) wrote :

Is there anything wrong with letting end users somehow migtrate the table size to be larger than 64 characters? Ideally, the token ID would not be stored in database tables anywhere but in keystone. We could realistically max out the table size to (I think) 255 chars long without any negative impact.

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

The only real concern about migrating the token table (at all) due to the size of it in many places (tons and tons and tons and tons of rows).

I don't disagree that we could go to 255 easily.

Revision history for this message
Dolph Mathews (dolph) wrote :

How is this a bug and not just a wishlist item? (support for SHA512)

As mentioned, this would require a very expensive migration (or to truncate the token table first), which doesn't seem desirable in the face of non-persistent PKI tokens.

Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

The fix is actually probably a KSC bug and limiting the hashtypes to SHA256. The move to support 'any hash that hashlib can do' is the real culprit here.

Changed in keystone:
importance: Medium → Wishlist
Changed in keystone:
status: New → Triaged
Changed in keystone:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.