July 07, 2011 11:14AM
Maxim Dounin Wrote:
-------------------------------------------------------
> 1. Does Nginx support SHA encryption for the basic web authentication?
> When I use -s switch with htpasswd command I can't log in...

I ran into this issue just the other day with htpasswd -s. I noticed that if I modified the output of htpasswd from {SHA} to {SSHA} I was able to use the generated password with nginx 1.0.4.

I wonder if it is feasible to add the following to ngx_crypt.c to be more compatible with the output of htpasswd? Please note, I'm no cryptologist and barely a programmer, but I do sleep in Holiday Inns.

--- ngx_crypt.c.orig 2011-07-07 08:10:36.814068671 -0700
+++ ngx_crypt.c 2011-07-07 08:11:26.670068063 -0700
@@ -42,6 +42,8 @@
#if (NGX_HAVE_SHA1)
} else if (ngx_strncmp(salt, "{SSHA}", sizeof("{SSHA}") - 1) == 0) {
return ngx_crypt_ssha(pool, key, salt, encrypted);
+ } else if (ngx_strncmp(salt, "{SHA}", sizeof("{SHA}") - 1) == 0) {
+ return ngx_crypt_ssha(pool, key, salt, encrypted);
#endif
}


45,46d44
< } else if (ngx_strncmp(salt, "{SHA}", sizeof("{SHA}") - 1) == 0) {
< return ngx_crypt_ssha(pool, key, salt, encrypted);
Subject Author Posted

Error pages/Web Authentication

HTF June 09, 2011 10:17AM

Re: Error pages/Web Authentication

Maxim Dounin June 09, 2011 12:18PM

Re: Error pages/Web Authentication

HTF June 09, 2011 01:01PM

Re: Error pages/Web Authentication

Maxim Dounin June 09, 2011 02:00PM

Re: Error pages/Web Authentication

HTF June 09, 2011 05:43PM

Re: Error pages/Web Authentication

António P. P. Almeida June 10, 2011 01:32PM

Re: Error pages/Web Authentication

HTF June 10, 2011 01:48PM

Re: Error pages/Web Authentication

HTF June 10, 2011 01:59PM

Re: Error pages/Web Authentication

António P. P. Almeida June 10, 2011 02:00PM

Re: Error pages/Web Authentication

tsaavik July 07, 2011 11:14AM

Re: Error pages/Web Authentication

Maxim Dounin July 07, 2011 01:24PM

Re: Error pages/Web Authentication

HTF June 10, 2011 02:13PM

Re: Error pages/Web Authentication

HTF June 11, 2011 04:55AM

Re: Error pages/Web Authentication

Maxim Dounin June 11, 2011 06:30AM

Re: Error pages/Web Authentication

HTF June 14, 2011 11:21PM

Re: Error pages/Web Authentication

Maxim Dounin June 15, 2011 04:06AM

Re: Error pages/Web Authentication

HTF June 15, 2011 08:34AM

Re: Error pages/Web Authentication

Maxim Dounin June 15, 2011 03:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 178
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready