From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 7D3191F462 for ; Wed, 22 May 2019 05:47:27 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 07F411209DD; Wed, 22 May 2019 14:47:22 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 70F3612095E for ; Wed, 22 May 2019 14:47:20 +0900 (JST) Received: by filter0036p3iad2.sendgrid.net with SMTP id filter0036p3iad2-19929-5CE4E269-8 2019-05-22 05:47:21.210852792 +0000 UTC m=+544129.236977334 Received: from herokuapp.com (unknown [3.81.19.97]) by ismtpd0021p1iad2.sendgrid.net (SG) with ESMTP id pm8sLIafTGqy8ywyuzE8IQ for ; Wed, 22 May 2019 05:47:21.193 +0000 (UTC) Date: Wed, 22 May 2019 05:47:21 +0000 (UTC) From: naruse@airemix.jp Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 68245 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 14915 X-Redmine-Issue-Author: jeremyevans0 X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?UqoG4vcRhHM9V1I4f4J7DhjzUfTg+8muXbMD6UD+LVRpwtTM4pjhcixAU=2FzPtS?= =?us-ascii?Q?DV+58H5+J3EJgCITo5db2If=2FzIh48IPm4FXrANk?= =?us-ascii?Q?ewfEmRAXwKVeKdAD4Vn3D4fGXGKxgJF33ssfRrs?= =?us-ascii?Q?RQRYtsTDxCe9YqhH9re4fbOp7kBWBMKcf4INcia?= =?us-ascii?Q?QayywfN88D3MbWO5qi=2FMzkDquTonBDt+gLA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 92760 Subject: [ruby-core:92760] [Ruby trunk Feature#14915] Deprecate String#crypt X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #14915 has been updated by naruse (Yui NARUSE). Just removing deprecated feature doesn't provide additional value. In this case UNIX crypt(3) is sometimes used as a basic building block. Removing a wrapper of such block may cause a compatibility issue. As usa says why OpenBSD still has `crypt(3)` is considered because of such reason. If OpenBSD's `crypt(3)` is removed, it can be a time to remove this feature. ---------------------------------------- Feature #14915: Deprecate String#crypt https://bugs.ruby-lang.org/issues/14915#change-78125 * Author: jeremyevans0 (Jeremy Evans) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- This method is system and implementation dependent, and the portable usage mentioned in the documentation is not truly portable (doesn't work on OpenBSD) and insecure as it uses DES. For systems that lack a crypt(3) implementation, Ruby will happily substitute a version that only supports DES. It's 2018, using DES should be avoided if at all possible. The only internal usage of String#crypt in Ruby is in Webrick, where it uses DES for basic authentication with an htpasswd file. That could and should be changed to use a more secure hash by default (bcrypt since that's the most secure htpasswd format), or at least allow the user to customize Webrick's authentication. I expect there are few if any users actively using Webrick's htpasswd support. This moves the String#crypt implementation to the string/crypt extension, but leaves the String#crypt core method. The core method prints a deprecation warning, then loads the string/crypt extension. The string/crypt extension undefines the String#crypt core method, then defines the previous implementation. Because extensions use extconf.rb instead of configure for their configuration, this ports the related configure.ac code to extconf.rb. I'm not sure that is done correctly and works on all platforms, it will need testing. For systems that lack a crypt(3) implementation, this modifies the fallback code to only define crypt_r, since that is the only function that String#crypt will call in that case. While the patch just deprecates String#crypt, I think we should plan to remove support from ruby: 2.6: core method deprecated 2.7: core method removed, string/crypt extension ships with ruby 2.8: string/crypt extension moves to external gem, not shipped ---Files-------------------------------- 0001-Deprecate-String-crypt-move-implementation-to-string.patch (20.5 KB) 0001-Deprecate-String-crypt.patch (7.48 KB) 0001-Deprecate-String-crypt.patch (7.35 KB) 0001-Deprecate-String-crypt.patch (7.43 KB) deprecate-string-crypt.patch (6.7 KB) -- https://bugs.ruby-lang.org/