diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-05-25 18:15:20 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2000-05-25 18:15:20 +0000 |
commit | 9e252fdd23c62b0b51a0537d3565590877bd9cd8 (patch) | |
tree | 77a9d9b6382da871ced8a9fadc1624fc9483b5f5 /lib | |
parent | fff5640543eb750e0fea86b078ca23ef816b4072 (diff) | |
download | libapr-9e252fdd23c62b0b51a0537d3565590877bd9cd8.tar.gz |
When translation is performed during MD5 digest calculation, verify in
ap_MD5SetXlate() that translation is single-byte-only. The translation
logic does not currently handle other types of translation.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60098 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apr_md5.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/apr_md5.c b/lib/apr_md5.c index 8e70113ef..a6b6c897b 100644 --- a/lib/apr_md5.c +++ b/lib/apr_md5.c @@ -204,9 +204,20 @@ API_EXPORT(ap_status_t) ap_MD5Init(ap_md5_ctx_t *context) * to be used for translating the content before calculating the * digest. */ - API_EXPORT(ap_status_t) ap_MD5SetXlate(ap_md5_ctx_t *context, ap_xlate_t *xlate) { + ap_status_t rv; + int is_sb; + + /* TODO: remove the single-byte-only restriction from this code + */ + rv = ap_xlate_get_sb(xlate, &is_sb); + if (rv != APR_SUCCESS) { + return rv; + } + if (!is_sb) { + return APR_EINVAL; + } context->xlate = xlate; return APR_SUCCESS; } |