so calling smtp_write_command(), which uses big_buffer, is OK. */
buffer[0] = 0;
-if (smtp_write_command(sx, SCMD_FLUSH, "%s\r\n", b64encode(big_buffer,
+if (smtp_write_command(sx, SCMD_FLUSH, "%s\r\n", b64encode(CUS big_buffer,
p - big_buffer)) < 0) return FAIL_SEND;
return smtp_read_response(sx, US buffer, buffsize, '2', timeout)
*/
int
-auth_get_data(uschar **aptr, uschar *challenge, int challen)
+auth_get_data(uschar **aptr, const uschar * challenge, int challen)
{
int c;
int p = 0;
US"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
uschar *
-b64encode(uschar *clear, int len)
+b64encode(const uschar * clear, int len)
{
uschar *code = store_get(4*((len+2)/3) + 1);
uschar *p = code;
if (sublen == 24)
{
- uschar *coded = b64encode(digest, 16);
+ uschar *coded = b64encode(CUS digest, 16);
DEBUG(D_auth) debug_printf("crypteq: using MD5+B64 hashing\n"
" subject=%s\n crypted=%s\n", coded, sub[1]+5);
tempcond = (Ustrcmp(coded, sub[1]+5) == 0);
if (sublen == 28)
{
- uschar *coded = b64encode(digest, 20);
+ uschar *coded = b64encode(CUS digest, 20);
DEBUG(D_auth) debug_printf("crypteq: using SHA1+B64 hashing\n"
" subject=%s\n crypted=%s\n", coded, sub[1]+6);
tempcond = (Ustrcmp(coded, sub[1]+6) == 0);
}
}
- enc = b64encode(sub, out - sub);
+ enc = b64encode(CUS sub, out - sub);
yield = string_cat(yield, enc);
continue;
}
#ifdef SUPPORT_TLS
uschar * s = vp && *(void **)vp->value
? tls_cert_der_b64(*(void **)vp->value)
- : b64encode(sub, Ustrlen(sub));
+ : b64encode(CUS sub, Ustrlen(sub));
#else
- uschar * s = b64encode(sub, Ustrlen(sub));
+ uschar * s = b64encode(CUS sub, Ustrlen(sub));
#endif
yield = string_cat(yield, s);
continue;
extern int auth_check_some_cond(auth_instance *, uschar *, uschar *, int);
-extern int auth_get_data(uschar **, uschar *, int);
+extern int auth_get_data(uschar **, const uschar *, int);
extern int auth_get_no64_data(uschar **, uschar *);
extern void auth_show_supported(FILE *);
extern uschar *auth_xtextencode(uschar *, int);
extern gstring *authres_spf(gstring *);
#endif
-extern uschar *b64encode(uschar *, int);
+extern uschar *b64encode(const uschar *, int);
extern int b64decode(const uschar *, uschar **);
extern int bdat_getc(unsigned);
extern uschar *bdat_getbuf(unsigned *);
*/
uschar *
-lss_b64encode(uschar *clear, int len)
+lss_b64encode(uschar * clear, int len)
{
-return b64encode(clear, len);
+return b64encode(CUS clear, len);
}
/*
uschar *
pdkim_encode_base64(blob * b)
{
-return b64encode(b->data, b->len);
+return b64encode(CUS b->data, b->len);
}
#ifdef HAVE_GNUTLS_SESSION_CHANNEL_BINDING
channel.data = NULL;
channel.size = 0;
-rc = gnutls_session_channel_binding(state->session, GNUTLS_CB_TLS_UNIQUE, &channel);
-if (rc) {
- DEBUG(D_tls) debug_printf("Channel binding error: %s\n", gnutls_strerror(rc));
-} else {
+if ((rc = gnutls_session_channel_binding(state->session, GNUTLS_CB_TLS_UNIQUE, &channel)))
+ { DEBUG(D_tls) debug_printf("Channel binding error: %s\n", gnutls_strerror(rc)); }
+else
+ {
old_pool = store_pool;
store_pool = POOL_PERM;
- tls_channelbinding_b64 = b64encode(channel.data, (int)channel.size);
+ tls_channelbinding_b64 = b64encode(CUS channel.data, (int)channel.size);
store_pool = old_pool;
DEBUG(D_tls) debug_printf("Have channel bindings cached for possible auth usage.\n");
-}
+ }
#endif
/* peercert is set in peer_status() */
gnutls_strerror(fail));
return NULL;
}
-return b64encode(cp, (int)len);
+return b64encode(CUS cp, (int)len);
}
else
{
long len = BIO_get_mem_data(bp, &cp);
- cp = b64encode(cp, (int)len);
+ cp = b64encode(CUS cp, (int)len);
}
BIO_free(bp);