From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 557273858407 for ; Thu, 4 Aug 2022 14:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 557273858407 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-479-Kii0S3csOUGDaBrxX6dT4w-1; Thu, 04 Aug 2022 10:44:23 -0400 X-MC-Unique: Kii0S3csOUGDaBrxX6dT4w-1 Received: by mail-qk1-f197.google.com with SMTP id q20-20020a05620a0d9400b006b6540e8d79so16121369qkl.14 for ; Thu, 04 Aug 2022 07:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:organization:in-reply-to :content-transfer-encoding; bh=4oI7/QhbiTXZ2ZMVLiScAmPVy0x3JaDtD0pKG3snm94=; b=u8v1LRJFKrX9IkzBhGUbuY+63kiqzXWAGrPJDZi3KRLUXIdJtYIoih6fnefBSAnbd6 61Wm7Oj9aLxNwXXhVPMGV03oVoxo63bKx9Ozpn0EXYmYwCdS+0NwaGqOMJQlWa7MvKqD L+T7ZNYdKD5Hv+aLRmRYIBY5fbYzsIMMbkYSUyv4MPfSZIQHojWll/j42C46GO43HRKP 9nB0TQTO9REQZfVyD476eyai198WLHZtyJz4L939qoy+GTwuHXwGyGwCAcehkaOl4yTU Ychqcwfnwcop5U6iPXn5cvYxudKvKWfH5832njdBD/LgxZdilB8e0lS/fsK2yl8F1qxH 53zw== X-Gm-Message-State: ACgBeo2dSe/N1XhWwN5qBs4IRJ9zzgqHbVg7HE915Ueu1BBL5u81J/aj mDKbkBsnlwbFojURgT/7qAbUwRsd/ph4aI5Y6b8HQVa0YQb2cO23v1VUyc3n4Zc6mOm0zVaH8vB nAyu5s+9OIOt052OZLnmr X-Received: by 2002:a0c:b31a:0:b0:473:8062:b1b4 with SMTP id s26-20020a0cb31a000000b004738062b1b4mr1844517qve.85.1659624262575; Thu, 04 Aug 2022 07:44:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5iaiWZtclCbpBAqD9kKgpQ5/di/PVeFFw2ZVOK7ufi9zWx6i3EnEKQCaXA5pqXmvJGScv+JA== X-Received: by 2002:a0c:b31a:0:b0:473:8062:b1b4 with SMTP id s26-20020a0cb31a000000b004738062b1b4mr1844492qve.85.1659624262243; Thu, 04 Aug 2022 07:44:22 -0700 (PDT) Received: from [192.168.0.241] (192-0-145-146.cpe.teksavvy.com. [192.0.145.146]) by smtp.gmail.com with ESMTPSA id m20-20020a05620a24d400b006a787380a5csm844695qkn.67.2022.08.04.07.44.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Aug 2022 07:44:21 -0700 (PDT) Message-ID: <994e108f-38fe-38ed-0b04-80010f96c588@redhat.com> Date: Thu, 4 Aug 2022 10:44:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] feat: crypt support sm3 algorithm To: Mingjun Yang , libc-alpha@sourceware.org References: <20220801025359.1363-1-yangmingjun@uniontech.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <20220801025359.1363-1-yangmingjun@uniontech.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2022 14:44:26 -0000 On 7/31/22 22:53, Mingjun Yang wrote: > This patch aim to let crypt packet support SM3 algorithms, the > proccess of SM3 encryption is the same to this semi-formal > SHA-crypt document (https://www.akkadia.org/drepper/SHA-crypt.txt). > noted that this patch define that SM3 algorithms ID is 8. > > SM3 algorithm is defined in section 23 of ISO/IEC 10118-3:2018 > (https://www.iso.org/standard/67116.html) > SM3 is similar to SHA256, but its algorithm is more complex. > SM3 is much safer than SHA256 at the same bit size. > > Signed-off-by: Mingjun Yang What needs do you have that drive this requirement? I do not want to add any new algorithms to crypt in glibc. I would instead suggest using libxcrypt, which is an ABI-compatible drop-in replacement for crypt APIs. The community worked closely with libxcrypt upstream to ensure it could be used to provide all the functions required by applications. For example Fedora uses --disable-crypt to configure glibc and uses libxcrypt to provide the APIs. This change was done in 2018, and so for almost 4 years Fedora has been using libxcrypt [1]. If anything I think glibc should switch to disabling libcrypt by default and provide --enable-legacy-crypt (or something like this) to enable the legacy library is built and installed. This is similar to the transition we made with SunRPC to TIRPC [2]. -- Cheers, Carlos. [1] https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt [2] https://fedoraproject.org/wiki/Changes/SunRPCRemoval