mhenry07 / docker-apache2-utils

Alpine-based Docker image with apache2-utils package (htpasswd, etc.)
https://hub.docker.com/r/mhenry07/apache2-utils/
3 stars 1 forks source link

htpasswd giving errors for work factor ≥ 18 #1

Open mhenry07 opened 6 years ago

mhenry07 commented 6 years ago

Steps to reproduce:

Error message:

htpasswd: Unable to encode with bcrypt: Invalid argument

However, the following works with no problem (work factor of 4 to 17):

The htpasswd documentation claims that it supports work factors between 4 and 31, so it should support 18 to 31, but it's failing for some reason.

mhenry07 commented 6 years ago

The documentation appears to be inconsistent with the source, and therefore it appears Apache's implementation of bcrypt does not currently support work factor/cost greater than 17. Therefore this issue won't be fixed for this Docker image without an upstream fix.

Details:

_crypt_gensalt_blowfish_rn in crypt_blowfish.c has a condition which returns an error if count > 17.

Call stack:

mhenry07 commented 6 years ago

Apache bug report: https://bz.apache.org/bugzilla/show_bug.cgi?id=62078