-/* $Cambridge: exim/src/src/dk.c,v 1.2 2005/03/08 16:57:28 ph10 Exp $ */
+/* $Cambridge: exim/src/src/dk.c,v 1.3 2005/06/20 11:20:41 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (dk_context != NULL) {
/* Send oldest byte */
if ((dkbuff[0] < 256) && (dk_internal_status == DK_STAT_OK)) {
- dk_internal_status = dk_message(dk_context, (char *)&dkbuff[0], 1);
+ dk_internal_status = dk_message(dk_context, CUS &dkbuff[0], 1);
if (dk_internal_status != DK_STAT_OK)
DEBUG(D_receive) debug_printf("DK: %s\n", DK_STAT_to_string(dk_internal_status));
}
/* Send remaining bytes from input which are still in the buffer. */
for (i=0;i<6;i++)
if (dkbuff[i] < 256)
- dk_internal_status = dk_message(dk_context, (char *)&dkbuff[i], 1);
+ dk_internal_status = dk_message(dk_context, CUS &dkbuff[i], 1);
/* Flag end-of-message. */
dk_internal_status = dk_end(dk_context, NULL);
/* Figure out what canonicalization to use. Unfortunately
we must do this BEFORE knowing which domain we sign for. */
if ((dk_canon != NULL) && (Ustrcmp(dk_canon, "nofws") == 0)) dk_canon_int = DK_CANON_NOFWS;
- else dk_canon = "simple";
+ else dk_canon = US "simple";
/* Initialize signing context. */
dk_context = dk_sign(dk_lib, &dk_internal_status, dk_canon_int);
if ((c == '.') && seen_lfdot) {
/* escaped dot, write "\n.", continue */
- dk_message(dk_context, "\n.", 2);
+ dk_message(dk_context, CUS "\n.", 2);
seen_lf = 0;
seen_lfdot = 0;
continue;
if (seen_lfdot) {
/* EOM, write "\n" and break */
- dk_message(dk_context, "\n", 1);
+ dk_message(dk_context, CUS "\n", 1);
break;
}
if (seen_lf) {
/* normal lf, just send it */
- dk_message(dk_context, "\n", 1);
+ dk_message(dk_context, CUS "\n", 1);
seen_lf = 0;
}
}
/* write the char */
- dk_message(dk_context, &c, 1);
+ dk_message(dk_context, CUS &c, 1);
}
/* Handle failed read above. */
/* Get domain to use, unless overridden. */
if (dk_domain == NULL) {
- dk_domain = dk_address(dk_context);
+ dk_domain = US dk_address(dk_context);
switch(dk_domain[0]) {
case 'N': dk_domain = NULL; break;
case 'F':
case 'S':
dk_domain++;
- dk_domain = strrchr(dk_domain,'@');
+ dk_domain = Ustrrchr(dk_domain,'@');
if (dk_domain != NULL) {
uschar *p;
dk_domain++;
DomainKey-Signature header. If there is no domain to sign for, we
can send the message anyway since the recipient has no policy to
apply ... */
- rc = "";
+ rc = US"";
goto CLEANUP;
}
}
(Ustrcmp(dk_private_key,"0") == 0) ||
(Ustrcmp(dk_private_key,"false") == 0) ) {
/* don't sign, but no error */
- rc = "";
+ rc = US"";
goto CLEANUP;
}
int privkey_fd = 0;
/* Looks like a filename, load the private key. */
memset(big_buffer,0,big_buffer_size);
- privkey_fd = open(dk_private_key,O_RDONLY);
+ privkey_fd = open(CS dk_private_key,O_RDONLY);
read(privkey_fd,big_buffer,16383);
close(privkey_fd);
dk_private_key = big_buffer;
rc = store_get(1024);
/* Build DomainKey-Signature header to return. */
- snprintf(rc, 1024, "DomainKey-Signature: a=rsa-sha1; q=dns; c=%s;\r\n"
+ snprintf(CS rc, 1024, "DomainKey-Signature: a=rsa-sha1; q=dns; c=%s;\r\n"
"\ts=%s; d=%s;\r\n"
"\tb=%s;\r\n", dk_canon, dk_selector, dk_domain, sig);
-/* $Cambridge: exim/src/src/expand.c,v 1.31 2005/06/20 10:28:33 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.32 2005/06/20 11:20:41 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (Ustrcmp(var_table[middle].name, "dk_sender_source") == 0)
switch(dk_verify_block->address_source) {
- case DK_EXIM_ADDRESS_NONE: s = "0"; break;
- case DK_EXIM_ADDRESS_FROM_FROM: s = "from"; break;
- case DK_EXIM_ADDRESS_FROM_SENDER: s = "sender"; break;
+ case DK_EXIM_ADDRESS_NONE: s = US"0"; break;
+ case DK_EXIM_ADDRESS_FROM_FROM: s = US"from"; break;
+ case DK_EXIM_ADDRESS_FROM_SENDER: s = US"sender"; break;
}
if (Ustrcmp(var_table[middle].name, "dk_status") == 0)
switch(dk_verify_block->result) {
- case DK_EXIM_RESULT_ERR: s = "error"; break;
- case DK_EXIM_RESULT_BAD_FORMAT: s = "bad format"; break;
- case DK_EXIM_RESULT_NO_KEY: s = "no key"; break;
- case DK_EXIM_RESULT_NO_SIGNATURE: s = "no signature"; break;
- case DK_EXIM_RESULT_REVOKED: s = "revoked"; break;
- case DK_EXIM_RESULT_NON_PARTICIPANT: s = "non-participant"; break;
- case DK_EXIM_RESULT_GOOD: s = "good"; break;
- case DK_EXIM_RESULT_BAD: s = "bad"; break;
+ case DK_EXIM_RESULT_ERR: s = US"error"; break;
+ case DK_EXIM_RESULT_BAD_FORMAT: s = US"bad format"; break;
+ case DK_EXIM_RESULT_NO_KEY: s = US"no key"; break;
+ case DK_EXIM_RESULT_NO_SIGNATURE: s = US"no signature"; break;
+ case DK_EXIM_RESULT_REVOKED: s = US"revoked"; break;
+ case DK_EXIM_RESULT_NON_PARTICIPANT: s = US"non-participant"; break;
+ case DK_EXIM_RESULT_GOOD: s = US"good"; break;
+ case DK_EXIM_RESULT_BAD: s = US"bad"; break;
}
if (Ustrcmp(var_table[middle].name, "dk_signsall") == 0)
- s = (dk_verify_block->signsall)? "1" : "0";
+ s = (dk_verify_block->signsall)? US"1" : US"0";
if (Ustrcmp(var_table[middle].name, "dk_testing") == 0)
- s = (dk_verify_block->testing)? "1" : "0";
+ s = (dk_verify_block->testing)? US"1" : US"0";
if (Ustrcmp(var_table[middle].name, "dk_is_signed") == 0)
- s = (dk_verify_block->is_signed)? "1" : "0";
+ s = (dk_verify_block->is_signed)? US"1" : US"0";
return (s == NULL)? US"" : s;
#endif
-/* $Cambridge: exim/src/src/transport.c,v 1.9 2005/05/24 14:56:27 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transport.c,v 1.10 2005/06/20 11:20:41 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *dk_strict_result = expand_string(dk_strict);
if (dk_strict_result != NULL)
{
- if ( (strcmpic(dk_strict,"1") == 0) ||
- (strcmpic(dk_strict,"true") == 0) )
+ if ( (strcmpic(dk_strict,US"1") == 0) ||
+ (strcmpic(dk_strict,US"true") == 0) )
{
save_errno = errno;
rc = FALSE;
/* write the chunk */
DK_WRITE:
#ifdef SUPPORT_TLS
- if (tls_active == fd) wwritten = tls_write(p, sread); else
+ if (tls_active == fd) wwritten = tls_write(US p, sread); else
#endif
wwritten = write(fd,p,sread);
if (wwritten == -1)