summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-05-25 18:15:20 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-05-25 18:15:20 +0000
commit9e252fdd23c62b0b51a0537d3565590877bd9cd8 (patch)
tree77a9d9b6382da871ced8a9fadc1624fc9483b5f5 /lib
parentfff5640543eb750e0fea86b078ca23ef816b4072 (diff)
downloadlibapr-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.c13
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;
}