From owner-freebsd-bugs@FreeBSD.ORG Sun Nov 14 06:10:05 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F11A106566C for ; Sun, 14 Nov 2010 06:10:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3598FC0A for ; Sun, 14 Nov 2010 06:10:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAE6A5IE098994 for ; Sun, 14 Nov 2010 06:10:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAE6A5Aq098993; Sun, 14 Nov 2010 06:10:05 GMT (envelope-from gnats) Resent-Date: Sun, 14 Nov 2010 06:10:05 GMT Resent-Message-Id: <201011140610.oAE6A5Aq098993@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Garrett Wollman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39A7106564A for ; Sun, 14 Nov 2010 06:06:57 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (hergotha.csail.mit.edu [66.92.79.170]) by mx1.freebsd.org (Postfix) with ESMTP id 57A798FC0A for ; Sun, 14 Nov 2010 06:06:57 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.4/8.14.4) with ESMTP id oAE5ifdP000515 for ; Sun, 14 Nov 2010 00:44:41 -0500 (EST) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.4/8.14.4/Submit) id oAE5ifbQ000514; Sun, 14 Nov 2010 00:44:41 -0500 (EST) (envelope-from wollman) Message-Id: <201011140544.oAE5ifbQ000514@hergotha.csail.mit.edu> Date: Sun, 14 Nov 2010 00:44:41 -0500 (EST) From: Garrett Wollman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/152229: b64decode(1)/b64_pton(3) should decode common variant of base64 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Wollman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2010 06:10:05 -0000 >Number: 152229 >Category: bin >Synopsis: b64decode(1)/b64_pton(3) should decode common variant of base64 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 14 06:10:04 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Garrett Wollman >Release: FreeBSD 8.1-RELEASE amd64 >Organization: >Environment: System: FreeBSD hergotha.csail.mit.edu 8.1-RELEASE FreeBSD 8.1-RELEASE #0 r212140M: Sat Sep 4 00:16:21 EDT 2010 wollman@hergotha.csail.mit.edu:/usr/obj/usr/src/sys/HERGOTHA amd64 >Description: A friend recently asked me to decode some text he had received, which was in a mutant version of the base64 encoding. A quick search led me to the O'Reilly book /Unicode Explained/, which describes a "URL/file-system-safe variant" of base64 which uses '-' and '_' in place of the standard '+' and '/', respectively. We should not generate this nonstandard form, but we should accept it, since it is unambiguous, in accordance with Postel's Robustness Principle. (The specific reference is on page 308, found in Google Books for the search 'base64 with hyphen'.) >How-To-Repeat: >Fix: I don't have a suggested fix (I hacked around it to answer the question at hand but the hack is not suitable for general use). I'm not sure if we should require a flag to be set (or a special version of b64_pton() to be called) to decode this version, or just treat it as normal base64. >Release-Note: >Audit-Trail: >Unformatted: