*************************************************/
/* Experimental ARC support for Exim
Copyright (c) Jeremy Harris 2018 - 2020
*************************************************/
/* Experimental ARC support for Exim
Copyright (c) Jeremy Harris 2018 - 2020
memcpy(al->rawsig_no_b_val.data, h->text, off); /* copy the header name blind */
r = al->rawsig_no_b_val.data + off;
al->rawsig_no_b_val.len = off;
memcpy(al->rawsig_no_b_val.data, h->text, off); /* copy the header name blind */
r = al->rawsig_no_b_val.data + off;
al->rawsig_no_b_val.len = off;
header_line * h = (header_line *)(al+1);
/* debug_printf("%s\n", __FUNCTION__); */
header_line * h = (header_line *)(al+1);
/* debug_printf("%s\n", __FUNCTION__); */
if (!arc_valid_id(selector))
{ s = US"selector"; goto bad_arg_ret; }
if (*privkey == '/' && !(privkey = expand_file_big_buffer(privkey)))
if (!arc_valid_id(selector))
{ s = US"selector"; goto bad_arg_ret; }
if (*privkey == '/' && !(privkey = expand_file_big_buffer(privkey)))
if ((opts = string_nextinlist(&signspec, &sep, NULL, 0)))
{
if ((opts = string_nextinlist(&signspec, &sep, NULL, 0)))
{
if (!(arc_sign_find_ar(headers, identity, &ar)))
{
log_write(0, LOG_MAIN, "ARC: no Authentication-Results header for signing");
if (!(arc_sign_find_ar(headers, identity, &ar)))
{
log_write(0, LOG_MAIN, "ARC: no Authentication-Results header for signing");
/* Finally, append the dkim headers and return the lot. */
if (sigheaders) g = string_catn(g, sigheaders->s, sigheaders->ptr);
/* Finally, append the dkim headers and return the lot. */
if (sigheaders) g = string_catn(g, sigheaders->s, sigheaders->ptr);
-(void) string_from_gstring(g);
-gstring_release_unused(g);
-return g;
+
+out:
+ if (!g) return string_get(1);
+ (void) string_from_gstring(g);
+ gstring_release_unused(g);
+ return g;
bad_arg_ret:
log_write(0, LOG_MAIN, "ARC: bad signing-specification (%s)", s);
bad_arg_ret:
log_write(0, LOG_MAIN, "ARC: bad signing-specification (%s)", s);