aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-12-01 11:52:11 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-12-01 11:52:11 +0800
commitae4b9b15b54ca28bbb3707a24204277e91a4b9ee (patch)
treef375742936c7824c0c007f98c8f00e7b91bedbd2
parent7f793b912853b340fd2e3d12c26d0452f55227c5 (diff)
downloadgsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar.gz
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar.bz2
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar.lz
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar.xz
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.tar.zst
gsoc2013-evolution-ae4b9b15b54ca28bbb3707a24204277e91a4b9ee.zip
** See bug #69615.
2004-11-23 Not Zed <NotZed@Ximian.com> ** See bug #69615. * camel-smime-context.c (sm_get_passwd): removed. All callers that passed it now pass NULL. This is so we don't override the password function set by e-cert-db. Seems to work ok, I think. 2004-11-22 Not Zed <NotZed@Ximian.com> ** See bug #69109. * providers/smtp/camel-smtp-transport.c (smtp_helo): if we have ipv6 address and it is numeric, prefix it with "IPv6:" svn path=/trunk/; revision=28025
-rw-r--r--camel/ChangeLog15
-rw-r--r--camel/camel-service.c4
-rw-r--r--camel/camel-smime-context.c43
-rw-r--r--camel/providers/smtp/camel-smtp-transport.c16
4 files changed, 33 insertions, 45 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 5eb5b00bbd..3114bcf35c 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,18 @@
+2004-11-23 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #69615.
+
+ * camel-smime-context.c (sm_get_passwd): removed. All callers
+ that passed it now pass NULL. This is so we don't override the
+ password function set by e-cert-db. Seems to work ok, I think.
+
+2004-11-22 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #69109.
+
+ * providers/smtp/camel-smtp-transport.c (smtp_helo): if we have
+ ipv6 address and it is numeric, prefix it with "IPv6:"
+
2004-11-30 Not Zed <NotZed@Ximian.com>
* providers/nntp/camel-nntp-stream.c (CAMEL_NNTP_STREAM_LINE):
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 81bb9c85e6..b916d5c05a 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -969,15 +969,13 @@ cs_getnameinfo(void *data)
if (msg->host) {
g_free(msg->host);
- msg->host = NULL;
if (msg->result == 0 && h.h_name && h.h_name[0]) {
msg->host = g_strdup(h.h_name);
- } else if ((msg->flags & NI_NAMEREQD) == 0) {
+ } else {
unsigned char *in = (unsigned char *)&sin->sin_addr;
/* sin_addr is always network order which is big-endian */
msg->host = g_strdup_printf("%u.%u.%u.%u", in[0], in[1], in[2], in[3]);
- msg->result = 0;
}
}
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index 1a2ba00090..9e5cc241dc 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -86,37 +86,6 @@ sm_decrypt_key(void *arg, SECAlgorithmID *algid)
return (PK11SymKey *)arg;
}
-static char *
-sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg)
-{
- CamelSMIMEContext *context = arg;
- char *pass, *nsspass = NULL;
- char *prompt;
- CamelException *ex;
-
- ex = camel_exception_new();
-
- /* we got a password, but its asking again, the password we had was wrong */
- if (context->priv->password_tries > 0) {
- camel_session_forget_password(((CamelCipherContext *)context)->session, NULL, NULL, PK11_GetTokenName(info), NULL);
- context->priv->password_tries = 0;
- }
-
- prompt = g_strdup_printf(_("Enter security pass-phrase for `%s'"), PK11_GetTokenName(info));
- pass = camel_session_get_password(((CamelCipherContext *)context)->session, NULL, NULL, prompt,
- PK11_GetTokenName(info), CAMEL_SESSION_PASSWORD_SECRET|CAMEL_SESSION_PASSWORD_STATIC, ex);
- camel_exception_free(ex);
- g_free(prompt);
- if (pass) {
- nsspass = PORT_Strdup(pass);
- memset(pass, 0, strlen(pass));
- g_free(pass);
- context->priv->password_tries++;
- }
-
- return nsspass;
-}
-
/**
* camel_smime_context_new:
* @session: session
@@ -185,7 +154,7 @@ camel_smime_context_describe_part(CamelSMIMEContext *context, CamelMimePart *par
dec = NSS_CMSDecoder_Start(NULL,
NULL, NULL,
- sm_get_passwd, context, /* password callback */
+ NULL, NULL, /* password callback */
NULL, NULL); /* decrypt key callback */
NSS_CMSDecoder_Update(dec, istream->buffer->data, istream->buffer->len);
@@ -423,8 +392,8 @@ sm_sign(CamelCipherContext *context, const char *userid, CamelCipherHash hash, C
enc = NSS_CMSEncoder_Start(cmsg,
sm_write_stream, ostream, /* DER output callback */
- NULL, NULL, /* destination storage */
- sm_get_passwd, context, /* password callback */
+ NULL, NULL, /* destination storage */
+ NULL, NULL, /* password callback */
NULL, NULL, /* decrypt key callback */
NULL, NULL ); /* detached digests */
if (!enc) {
@@ -744,7 +713,7 @@ sm_verify(CamelCipherContext *context, CamelMimePart *ipart, CamelException *ex)
dec = NSS_CMSDecoder_Start(NULL,
NULL, NULL, /* content callback */
- sm_get_passwd, context, /* password callback */
+ NULL, NULL, /* password callback */
NULL, NULL); /* decrypt key callback */
camel_data_wrapper_decode_to_stream(camel_medium_get_content_object((CamelMedium *)sigpart), (CamelStream *)mem);
@@ -872,7 +841,7 @@ sm_encrypt(CamelCipherContext *context, const char *userid, GPtrArray *recipient
enc = NSS_CMSEncoder_Start(cmsg,
sm_write_stream, ostream,
NULL, NULL,
- sm_get_passwd, context,
+ NULL, NULL,
sm_decrypt_key, bulkkey,
NULL, NULL);
if (enc == NULL) {
@@ -964,7 +933,7 @@ sm_decrypt(CamelCipherContext *context, CamelMimePart *ipart, CamelMimePart *opa
dec = NSS_CMSDecoder_Start(NULL,
sm_write_stream, ostream, /* content callback */
- sm_get_passwd, context, /* password callback */
+ NULL, NULL,
NULL, NULL); /* decrypt key callback */
if (NSS_CMSDecoder_Update(dec, istream->buffer->data, istream->buffer->len) != SECSuccess) {
diff --git a/camel/providers/smtp/camel-smtp-transport.c b/camel/providers/smtp/camel-smtp-transport.c
index 0e1a175d6a..542f8c6b72 100644
--- a/camel/providers/smtp/camel-smtp-transport.c
+++ b/camel/providers/smtp/camel-smtp-transport.c
@@ -867,8 +867,7 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
{
/* say hello to the server */
char *name = NULL, *cmdbuf = NULL, *respbuf = NULL;
- const char *token;
- int numeric = FALSE;
+ const char *token, *numeric = NULL;
/* these are flags that we set, so unset them in case we
are being called a second time (ie, after a STARTTLS) */
@@ -888,13 +887,20 @@ smtp_helo (CamelSmtpTransport *transport, CamelException *ex)
if (camel_getnameinfo(transport->localaddr, transport->localaddrlen, &name, NULL, NI_NAMEREQD, NULL) != 0) {
if (camel_getnameinfo(transport->localaddr, transport->localaddrlen, &name, NULL, NI_NUMERICHOST, NULL) != 0)
name = g_strdup("localhost.localdomain");
- else
- numeric = TRUE;
+ else {
+ if (transport->localaddr->sa_family == AF_INET6)
+ numeric = "IPv6:";
+ else
+ numeric = "";
+ }
}
/* hiya server! how are you today? */
token = (transport->flags & CAMEL_SMTP_TRANSPORT_IS_ESMTP) ? "EHLO" : "HELO";
- cmdbuf = g_strdup_printf(numeric ? "%s [%s]\r\n" : "%s %s\r\n", token, name);
+ if (numeric)
+ cmdbuf = g_strdup_printf("%s [%s%s]\r\n", token, numeric, name);
+ else
+ cmdbuf = g_strdup_printf("%s %s\r\n", token, name);
g_free (name);
d(fprintf (stderr, "sending : %s", cmdbuf));