You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/08/05 08:40:30 UTC

[GitHub] [couchdb] big-r81 commented on issue #4119: Make #4094 an opt-in config until we can swap it to opt-out in the next major release

big-r81 commented on issue #4119:
URL: https://github.com/apache/couchdb/issues/4119#issuecomment-1206197700

   Hi,
   
   i would like to continue the work on this topic. Some questions arise while thinking about this. I would like to do this:
   
   1. Introduce multiple config options in default.ini:
   ```
   ; Set the HMAC algorithm used by cookie and proxy authentication
   ; Possible values: sha,sha224,sha256,sha384,sha512,sha3_224,sha3_256,sha3_384,sha3_512,
   ;                  blake2b,blake2s,md4,md5,ripemd160
   ; Default: sha256
   ;hmac_algorithm = sha256
   ; The following algorithms are blacklisted and can't be used for the hash
   ; Default: [sha,md4,md5]
   ;hmac_algorithm_blacklist = [sha,md4,md5]
   ; If hmac_algorithm_use_legacy_sha = true then sha (sha1) is used for HMAC. It defaults to
   ; true in 3.x for BC-compatability and gets removed in 4.x. Setting this will override the
   ; used hash algorithm in hmac_algorithm and ignores the blacklisted sha value in
   ; hmac_algorithm_blacklist. If set to false, then the hash algorithm set by hash_algorithm
   ; is used.
   hmac_algorithm_use_legacy_sha = true
   ```
   So a user could switch explicitly to a new hash algorithm, but the default behavior remains as it is right now.
   If we get consensus about this. I would open a PR.
   
   My next question is, if we want to add code for internal upgrade of AuthSession to SHA256 like Bob suggest?
   A user can explicitly use new hash algorithms if `hmac_algorithm_use_legacy_sha` is set to false.
   > How about this;
   > 
   >     1. when we receive an AuthSession cookie we try to confirm it with HMAC-SHA256. If that is successful, we continue as usual.
   >     2. if unsuccessful we try to confirm it with HMAC-SHA1. If that is successful, we consider it expired and send a new one (which is HMAC-SHA256)
   >     3. an administrator can disable the fallback option. it is enabled by default in the first release and disabled by default in the release after that.
   > 
   > 
   > That is, after we merge this work couchdb only issues new HMAC-SHA256 cookies but will accept (and upgrade) SHA1's if the administrator allows.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org