Mercurial > masqmail
comparison src/smtp_out.c @ 363:02bc0331e390
Removed support for openssl linking
It had been rarely used and could have caused legal problems.
For explanations, see this mail message:
Date: Sun, 04 Sep 2011 17:35:23 +0200
From: markus schnalke <meillo@marmaro.de>
To: masqmail@marmaro.de
Subject: [masqmail] RFC: Removal of configure options
Message-ID: <1R0EjD-4aX-00@serveme.home.schnalke.org>
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Wed, 14 Sep 2011 12:07:34 +0200 |
parents | 412385b57dc4 |
children | 41958685480d |
comparison
equal
deleted
inserted
replaced
362:9d49dffc3070 | 363:02bc0331e390 |
---|---|
29 #include "masqmail.h" | 29 #include "masqmail.h" |
30 #include "smtp_out.h" | 30 #include "smtp_out.h" |
31 #include "readsock.h" | 31 #include "readsock.h" |
32 | 32 |
33 #ifdef ENABLE_AUTH | 33 #ifdef ENABLE_AUTH |
34 | |
35 #ifdef USE_LIB_CRYPTO | |
36 #include <openssl/hmac.h> | |
37 #include <openssl/md5.h> | |
38 #include <openssl/evp.h> | |
39 #else | |
40 #include "md5/md5.h" | 34 #include "md5/md5.h" |
41 #include "md5/hmac_md5.h" | 35 #include "md5/hmac_md5.h" |
42 #endif | |
43 | |
44 #include "base64/base64.h" | 36 #include "base64/base64.h" |
45 #endif | 37 #endif |
46 | 38 |
47 void | 39 void |
48 destroy_smtpbase(smtp_base * psb) | 40 destroy_smtpbase(smtp_base * psb) |
565 gint chall_size; | 557 gint chall_size; |
566 gchar *chall = base64_decode(chall64, &chall_size); | 558 gchar *chall = base64_decode(chall64, &chall_size); |
567 guchar digest[16], *reply64, *reply; | 559 guchar digest[16], *reply64, *reply; |
568 gchar digest_string[33]; | 560 gchar digest_string[33]; |
569 gint i; | 561 gint i; |
570 #ifdef USE_LIB_CRYPTO | |
571 unsigned int digest_len; | |
572 #endif | |
573 | 562 |
574 DEBUG(5) debugf("smtp_out_auth_cram_md5():\n"); | 563 DEBUG(5) debugf("smtp_out_auth_cram_md5():\n"); |
575 DEBUG(5) debugf(" encoded challenge = %s\n", chall64); | 564 DEBUG(5) debugf(" encoded challenge = %s\n", chall64); |
576 DEBUG(5) debugf(" decoded challenge = %s, size = %d\n", chall, chall_size); | 565 DEBUG(5) debugf(" decoded challenge = %s, size = %d\n", chall, chall_size); |
577 DEBUG(5) debugf(" secret = %s\n", psb->auth_secret); | 566 DEBUG(5) debugf(" secret = %s\n", psb->auth_secret); |
578 | 567 |
579 #ifdef USE_LIB_CRYPTO | |
580 HMAC(EVP_md5(), psb->auth_secret, strlen(psb->auth_secret), chall, chall_size, digest, &digest_len); | |
581 #else | |
582 hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest); | 568 hmac_md5(chall, chall_size, psb->auth_secret, strlen(psb->auth_secret), digest); |
583 #endif | |
584 | |
585 for (i = 0; i < 16; i++) | 569 for (i = 0; i < 16; i++) |
586 sprintf(&(digest_string[i + i]), "%02x", (unsigned int) (digest[i])); | 570 sprintf(&(digest_string[i + i]), "%02x", (unsigned int) (digest[i])); |
587 digest_string[32] = '\0'; | 571 digest_string[32] = '\0'; |
588 | 572 |
589 DEBUG(5) debugf(" digest = %s\n", digest_string); | 573 DEBUG(5) debugf(" digest = %s\n", digest_string); |