Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 69662 invoked from network); 21 Dec 2009 16:07:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Dec 2009 16:07:55 -0000 Received: (qmail 31046 invoked by uid 500); 21 Dec 2009 16:07:54 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 30956 invoked by uid 500); 21 Dec 2009 16:07:54 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 30947 invoked by uid 99); 21 Dec 2009 16:07:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 16:07:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of n.deepak@gmail.com designates 209.85.160.45 as permitted sender) Received: from [209.85.160.45] (HELO mail-pw0-f45.google.com) (209.85.160.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Dec 2009 16:07:46 +0000 Received: by pwj1 with SMTP id 1so3348516pwj.24 for ; Mon, 21 Dec 2009 08:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=O4XwaUazo7j2EO9PohYrkhcxCMTsuWEkIWXVfM5aNR0=; b=sbOijVnSf7kw3HUmDD2xjepftOl8PQtmXEnVEY6zfH4oS3ikFiwVM8h+mP05SIDGeX XvBfKKwg9lhjXO/gyOaXR/42vpuqbjTrVdSb6EWjW2Ohnqmakn2JoPnossCD7SYExCrM d2b93BMoidJVx+fm0ClKFgmQsfZF9Q8nMyWs8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YaL3H6eD9HKF3ybEauS4vMXbdUmKHcgNm8+CawppH4+dTQHtyCFlnCrWJZIJLk3733 wL2JNctPA3gRqoq0CzyvBEeLwOVZsN6fN4VUiuUbroCmcVEetkUYFDC8NF9PD11kF4qj oX9Ihp+ZgpEjhSixuVfeLLq67ZP8+jZXSsGFU= MIME-Version: 1.0 Received: by 10.142.249.40 with SMTP id w40mr4878059wfh.344.1261411645474; Mon, 21 Dec 2009 08:07:25 -0800 (PST) In-Reply-To: References: Date: Mon, 21 Dec 2009 21:37:25 +0530 Message-ID: Subject: Re: network byte ordering in "ContentDigest"? From: Deepak Nagaraj To: dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Dec 21, 2009 at 8:03 PM, Olaf van der Spek w= rote: > On Mon, Dec 21, 2009 at 3:07 PM, Deepak Nagaraj wrot= e: >>> It's 16 bytes, what reordering did you want to do? Byte order only >>> applies to stuff larger than individual bytes. >>> >> The RFC considers it as a 128-bit "digest" (=3Dnumber). =A0It can be >> divided into 16 bytes in either host order or network order. =A0Because >> the RFC says "when viewed in network order", it implies that we need >> to do host-to-network conversion. =A0This is the conversion I'm >> referring to. > > AFAIK that really doesn't apply. It's not an int, it's a 16-byte > 'array' that shouldn't be reordered. > You're right about MD5. I checked the MD5-algorithm RFC (1321). It specifies that the digest is generated in little-endian order. """ The message digest produced as output is A, B, C, D. That is, we begin with the low-order byte of A, and end with the high-order byte of D. """ So as long as the generator and verifier both follow the MD5 algorithm as per its RFC, we should be OK. But on the other hand, HTTP "Content-MD5" header RFC (1864) explicitly mentions network byte ordering as I originally quoted. Being a standards-compliant HTTP server, IMO, we should be doing whatever the RFC says, even if it's a nuance. Thanks, -deepak