diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-03-02 02:01:27 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-03-02 02:01:27 +0800 |
commit | 1cd06b6bfb6edc61ddadcf0bfee555cb4b7c60ad (patch) | |
tree | 6a1f1dff0208a23c2e26133b49697760f919b9b1 | |
parent | 89ec4e5af666be612fe572082e539ebe7ae0efb3 (diff) | |
download | gsoc2013-evolution-1cd06b6bfb6edc61ddadcf0bfee555cb4b7c60ad.tar.gz gsoc2013-evolution-1cd06b6bfb6edc61ddadcf0bfee555cb4b7c60ad.tar.zst gsoc2013-evolution-1cd06b6bfb6edc61ddadcf0bfee555cb4b7c60ad.zip |
Don't base64 encode the data, leave that up to the provider to do if it
2001-03-01 Jeffrey Stedfast <fejj@ximian.com>
* camel-sasl-anonymous.c (anon_challenge): Don't base64 encode the
data, leave that up to the provider to do if it needs to. Also
save on some memory allocations and stuff.
* camel-sasl-cram-md5.c (cram_md5_challenge): Same here.
svn path=/trunk/; revision=8454
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/camel-sasl-anonymous.c | 7 | ||||
-rw-r--r-- | camel/camel-sasl-cram-md5.c | 8 |
3 files changed, 14 insertions, 9 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 9f85cf2203..a4ee3f173b 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2001-03-01 Jeffrey Stedfast <fejj@ximian.com> + + * camel-sasl-anonymous.c (anon_challenge): Don't base64 encode the + data, leave that up to the provider to do if it needs to. Also + save on some memory allocations and stuff. + + * camel-sasl-cram-md5.c (cram_md5_challenge): Same here. + 2001-03-02 Not Zed <NotZed@Ximian.com> * camel-mime-utils.c (rfc2047_encode_word, rfc2047_decode_word): diff --git a/camel/camel-sasl-anonymous.c b/camel/camel-sasl-anonymous.c index 0429fa8a94..08ff8e0933 100644 --- a/camel/camel-sasl-anonymous.c +++ b/camel/camel-sasl-anonymous.c @@ -126,7 +126,7 @@ anon_challenge (CamelSasl *sasl, const char *token, CamelException *ex) return NULL; } camel_object_unref (CAMEL_OBJECT (cia)); - buf = base64_encode_simple (sasl_anon->trace_info, strlen (sasl_anon->trace_info)); + buf = sasl_anon->trace_info; break; case CAMEL_SASL_ANON_TRACE_OPAQUE: if (strchr (sasl_anon->trace_info, '@')) { @@ -135,10 +135,10 @@ anon_challenge (CamelSasl *sasl, const char *token, CamelException *ex) sasl_anon->trace_info); return NULL; } - buf = base64_encode_simple (sasl_anon->trace_info, strlen (sasl_anon->trace_info)); + buf = sasl_anon->trace_info; break; case CAMEL_SASL_ANON_TRACE_EMPTY: - buf = g_strdup ("="); + buf = ""; break; default: camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE, @@ -158,7 +158,6 @@ anon_challenge (CamelSasl *sasl, const char *token, CamelException *ex) if (buf) { ret = g_byte_array_new (); g_byte_array_append (ret, buf, strlen (buf)); - g_free (buf); } return ret; diff --git a/camel/camel-sasl-cram-md5.c b/camel/camel-sasl-cram-md5.c index 66d42aca92..863a2ed39f 100644 --- a/camel/camel-sasl-cram-md5.c +++ b/camel/camel-sasl-cram-md5.c @@ -115,8 +115,8 @@ cram_md5_challenge (CamelSasl *sasl, const char *token, CamelException *ex) { CamelSaslCramMd5 *sasl_cram = CAMEL_SASL_CRAM_MD5 (sasl); struct _CamelSaslCramMd5Private *priv = sasl_cram->priv; - char *timestamp, *passwd, *buf, *enc; guchar digest[16], md5asc[33], *s, *p; + char *timestamp, *passwd, *buf; GByteArray *ret = NULL; guchar ipad[64]; guchar opad[64]; @@ -163,12 +163,10 @@ cram_md5_challenge (CamelSasl *sasl, const char *token, CamelException *ex) sprintf (p, "%.2x", *s); buf = g_strdup_printf ("%s %s", sasl_cram->username, md5asc); - enc = base64_encode_simple (buf, strlen (buf)); - g_free (buf); ret = g_byte_array_new (); - g_byte_array_append (ret, enc, strlen (enc)); - g_free (enc); + g_byte_array_append (ret, buf, strlen (buf)); + g_free (buf); break; case STATE_FINAL: |