diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-10-12 10:07:00 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2005-10-12 10:07:00 +0000 |
commit | cb9328de6d563ae06ee04aa2180416bb8967145b (patch) | |
tree | 6ae13a9fb0f2e57f408ba0a933190546cb8a10c0 /src | |
parent | cc38ddbf11c08a9edf41726005623b2061397411 (diff) |
Generate an error if the third argument to ${prvs is not a single digit.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/expand.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/src/expand.c b/src/src/expand.c index 739f5e854..cd8032a40 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.43 2005/09/28 10:46:48 ph10 Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.44 2005/10/12 10:07:00 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -3360,15 +3360,24 @@ while (*s != 0) domain = Ustrrchr(sub_arg[0],'@'); if ( (domain == NULL) || (domain == sub_arg[0]) || (Ustrlen(domain) == 1) ) { - expand_string_message = US"first parameter must be a qualified email address"; + expand_string_message = US"prvs first argument must be a qualified email address"; + goto EXPAND_FAILED; + } + + /* Calculate the hash. The second argument must be a single-digit + key number, or unset. */ + + if (sub_arg[2] != NULL && + (!isdigit(sub_arg[2][0]) || sub_arg[2][1] != 0)) + { + expand_string_message = US"prvs second argument must be a single digit"; goto EXPAND_FAILED; } - /* Calculate the hash */ p = prvs_hmac_sha1(sub_arg[0],sub_arg[1],sub_arg[2],prvs_daystamp(7)); if (p == NULL) { - expand_string_message = US"hmac-sha1 conversion failed"; + expand_string_message = US"prvs hmac-sha1 conversion failed"; goto EXPAND_FAILED; } |