# NGINX 1.0.3 compile error: src/core/ngx crypt.c: In function ‘ngx crypt apr1’

**URL:** <https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518>\
**Category:** NGINX\
**Created:** [May 27, 2011, 11:30am UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518 "2011-05-27T11:30:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 27, 2011, 11:30am UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/1 "2011-05-27T11:30:41Z")

</div>

Hi,

i’m having problems compiling the latest stable source 1.0.3.

How to reproduce:

cd   
./configure  
make

make output is attached in log.txt

I do not have any problems compiling stable source 1.0.2

Is suspect this issue beeing a bug. Can somebody confirm this?

Thanks in advance!

Cheers,  
DJ

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Tupalo.com - Phone, Map, Review for Restaurants, Cafes, Salons, Shops](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo.com

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 11:57am UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/2 "2011-05-27T11:57:57Z")

</div>

On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor J. wrote:

> make output is attached in log.txt
> 
> I do not have any problems compiling stable source 1.0.2
> 
> Is suspect this issue beeing a bug. Can somebody confirm this?

> gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I src/core -I  
> src/event -I src/event/modules -I src/os/unix -I objs   
> -o objs/src/core/ngx\_crypt.o   
> src/core/ngx\_crypt.c  
> cc1: warnings being treated as errors  
> src/core/ngx\_crypt.c: In function ‘ngx\_crypt\_apr1’:  
> src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument 2 of  
> ‘ngx\_md5\_update’ differ in signedness

Thank you for the report.  
The attached patch should fix the issue.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 2:08pm UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/3 "2011-05-27T14:08:30Z")

</div>

Hello!

On Fri, May 27, 2011 at 01:57:45PM +0400, Igor S. wrote:

> > cc1: warnings being treated as errors  
> > src/core/ngx\_crypt.c: In function ‘ngx\_crypt\_apr1’:  
> > src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument 2 of  
> > ‘ngx\_md5\_update’ differ in signedness
> 
> Thank you for the report.  
> The attached patch should fix the issue.
> 
> –  
> Igor S.

> # Index: src/core/ngx\_md5.c
> 
> — src/core/ngx\_md5.c (revision 3927)  
> +++ src/core/ngx\_md5.c (working copy)  
> @@ -32,7 +32,7 @@
> 
> void  
> -ngx\_md5\_update(ngx\_md5\_t \*ctx, const u\_char \*data, size\_t size)  
> +ngx\_md5\_update(ngx\_md5\_t \*ctx, const void \*data, size\_t size)

$ grep MD5Update /usr/include/sys/md5.h  
void MD5Update (MD5\_CTX \*, const unsigned char \*, unsigned int);

So this is required anyway:

diff --git a/src/core/ngx\_crypt.c b/src/core/ngx\_crypt.c  
— a/src/core/ngx\_crypt.c  
+++ b/src/core/ngx\_crypt.c  
@@ -74,7 +74,7 @@ ngx\_crypt\_apr1(ngx\_pool\_t \*pool, u\_char

```
 ngx_md5_init(&md5);
 ngx_md5_update(&md5, key, keylen);

```

- ngx\_md5\_update(&md5, “$apr1$”, sizeof(“$apr1$”) - 1);

- ngx\_md5\_update(&md5, (u\_char \*) “$apr1$”, sizeof(“$apr1$”) - 1);  
ngx\_md5\_update(&md5, salt, saltlen);

Sorry for the breakage. BTW, it’s probably good idea to finally  
branch stable-1.0 and start releasing 1.1.\*.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 12:39pm UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/4 "2011-05-27T12:39:27Z")

</div>

Hi,

that patch fixed the issue. Many thanks for the very fast support!

Regards,  
DJ

> > > Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 5/27/2011 11:57 \>\>\>  
> > > On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor J. wrote:  
> > > make output is attached in log.txt
> 
> I do not have any problems compiling stable source 1.0.2
> 
> Is suspect this issue beeing a bug. Can somebody confirm this?

> gcc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter  
> -Wunused-function -Wunused-variable -Wunused-value -Werror -g -I  
> src/core -I  
> src/event -I src/event/modules -I src/os/unix -I objs   
> -o objs/src/core/ngx\_crypt.o   
> src/core/ngx\_crypt.c  
> cc1: warnings being treated as errors  
> src/core/ngx\_crypt.c: In function Б─≤ngx\_crypt\_apr1Б─≥:  
> src/core/ngx\_crypt.c:76: warning: pointer targets in passing argument  
> 2 of Б─≤ngx\_md5\_updateБ─≥ differ in signedness

Thank you for the report.  
The attached patch should fix the issue.

–  
Igor S.

HEROLD Business Data GmbH  
Guntramsdorfer Straße 105  
A-2340 Mödling

FN 233171z  
Landesgericht Wiener Neustadt

Besuchen Sie uns online und mobil www.herold.at!

Weitere Informationen zu unseren Produkten finden Sie unter:  
[http://mobile.herold.at](http://mobile.herold.at)  
[http://daten.herold.at](http://daten.herold.at)

Werden Sie Fan von HEROLD auf Facebook!

Bitte beachten Sie auch unsere Tochter- und Partner-Unternehmen:  
www.clearsense.at

> **[Welcome to Tupalo](http://www.tupalo.com)**
>
> Local business reviews and recommendations of Restaurants, Cafes, Shops, Salons, Plumbers and more at Tupalo

www.aboutmedia.at  
www.love.at  
www.reise-hero.at  
www.urlauburlaub.at

Diese E-Mail kann vertrauliche und/oder rechtlich geschützte  
Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder  
diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie  
die unbefugte Weitergabe dieser Mail sind nicht gestattet.

This e-mail may contain confidential and/or privileged information. If  
you are not the intended recipient (or have received this e-mail in  
error) please notify the sender immediately and delete this e-mail. Any  
unauthorized copying, disclosure or distribution of the material in this  
e-mail is strictly forbidden.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 2:34pm UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/5 "2011-05-27T14:34:28Z")

</div>

On Fri, May 27, 2011 at 04:18:30PM +0400, Igor S. wrote:

> > > -ngx\_md5\_update(ngx\_md5\_t \*ctx, const u\_char \*data, size\_t size)  
> > > […]  
> > > void MD5Update (MD5\_CTX \*, const void \*, unsigned int);  
> > > It seems you looked at FreeBSD prior to 7.0-CURRENT,  
> > > this has been changed on 17.01.2006.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 2:36pm UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/6 "2011-05-27T14:36:57Z")

</div>

Hello!

On Fri, May 27, 2011 at 04:18:30PM +0400, Igor S. wrote:

> > > -ngx\_md5\_update(ngx\_md5\_t \*ctx, const u\_char \*data, size\_t size)  
> > > +ngx\_md5\_update(ngx\_md5\_t \*ctx, const void \*data, size\_t size)
> > 
> > $ grep MD5Update /usr/include/sys/md5.h  
> > void MD5Update (MD5\_CTX \*, const unsigned char \*, unsigned int);
> 
> What OS ?

FreeBSD 6.

This was changed in 7+, see

> **[\[base\] Log of /head/sys/sys/md5.h](https://svnweb.freebsd.org/base/head/sys/sys/md5.h)**

Maxim D.

---

<div class="post-metadata">

**Author:** ![Dalibor\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/35a633/32.png) [@Dalibor\_J](https://www.ruby-forum.com/u/Dalibor_J)\
**Post date:** [May 27, 2011, 2:18pm UTC](https://www.ruby-forum.com/t/nginx-1-0-3-compile-error-src-core-ngx-crypt-c-in-function-ngx-crypt-apr1/207518/7 "2011-05-27T14:18:59Z")

</div>

On Fri, May 27, 2011 at 04:07:47PM +0400, Maxim D. wrote:

> $ grep MD5Update /usr/include/sys/md5.h  
> void MD5Update (MD5\_CTX \*, const unsigned char \*, unsigned int);

What OS ?

$ man 3 md5 (MacOSX 10.6)  
[…]  
#include \<openssl/md5.h\>  
[…]  
int MD5\_Update(MD5\_CTX \*c, const void \*data,  
unsigned long len);

$ man 3 md5 (FreeBSD 7-8)  
[…]  
#include \<md5.h\>  
[…]  
MD5Update(MD5\_CTX \*context, const void \*data, unsigned int len);

$ grep MD5Update /usr/include/sys/md5.h  
void MD5Update (MD5\_CTX \*, const void \*, unsigned int);

–  
Igor S.
