Re: [PATCH] sm3: support to compile with libgcrypt

2017-11-20 Thread Jia Zhang
Hi Bruno, This fix looks good enough. Thanks, Jia 在 2017/11/21 上午7:11, Bruno Haible 写道: > The code in lib/gc-gnulib.c line 823 > sm3_finish_ctx (&ctx->sm3Context, ctx->hash); > passes a buffer of size 20 to a function which writes 32 bytes into it. > Thus provoking a buffer overrun. > > Thi

Re: link error with libgcrypt

2017-10-29 Thread Jia Zhang
于 2017/10/29 下午11:00, Bruno Haible 写道: > Hi Jia, > >> I will still have a link failure with crypto/gc-sm3 and even >> crypto/gc. >> >> In order to reproduce this link failure, I need to have a latest >> libgcrypt installed, and then configure gnulib in this way: >> >> $ ./gnulib-tool --create-te

Re: [PATCH] sm3: support to compile with libgcrypt

2017-10-29 Thread Jia Zhang
st-attribute=const] >> gc_hash_digest_length (Gc_hash hash) >> ^~~~~~~~~ > > No, this is wrong. As I tried to explain in the last mail, we must respect > the semantics of the 'const' attribute. As a rule of thumb, > - functions that take pointer a

[PATCH] sm3: support to compile with libgcrypt

2017-10-28 Thread Jia Zhang
nction might be candidate for attribute 'const' [-Werror=suggest-attribute=const] gc_done (void) ^~~ lib/gc-libgcrypt.c: In function 'gc_hash_digest_length': lib/gc-libgcrypt.c:368:1: error: function might be candidate for attribute 'const' [-Werror=suggest-attribut

Re: [V3 PATCH] Implement SM3 hash algorithm in gnulib

2017-10-28 Thread Jia Zhang
Hi Bruno, I sent a new submission based on the latest master branch for a clear review without sm3 basis. Plz refer to "[PATCH] sm3: support to compile with libgcrypt". Let's continue the discussion over it. Thanks, Jia 于 2017/10/29 上午9:54, Jia Zhang 写道: > > > 于

Re: [V3 PATCH] Implement SM3 hash algorithm in gnulib

2017-10-28 Thread Jia Zhang
于 2017/10/29 上午4:25, Bruno Haible 写道: > Hi Jia, > >> Here is the V3 changelog: >> >> - Correct @LIB_CRYPTO@ build issue in m4/sm3.m4. > > Thanks for the update. The module 'crypto/sm3' passes the test, so > I pushed that part of the patch in your name. > > The module 'crypto/gc-sm3' does not

[V3 PATCH] Implement SM3 hash algorithm in gnulib

2017-10-28 Thread Jia Zhang
:00 2001 From: Jia Zhang Date: Sat, 7 Oct 2017 04:31:27 -0400 Subject: [PATCH 1/4] New module: crypto/sm3 This new module can be used to compute SM3 message digest of files or memory blocks according to the specification GM/T 004-2012 Cryptographic Hash Algorithm SM3, published by State Cryptography

Re: [V2 PATCH] Implement SM3 hash algorithm in gnulib and the computing tool in coreutils.

2017-10-28 Thread Jia Zhang
于 2017/10/28 下午9:09, Bruno Haible 写道: > Jia Zhang wrote: >>> gcc: error: @LIB_CRYPTO@: No such file or directory >> >> Thanks for your comments. I fixed it and the test passes. I just >> feel strange that test-sm3 was built out without error if I >> com

Re: [V2 PATCH] Implement SM3 hash algorithm in gnulib and the computing tool in coreutils.

2017-10-28 Thread Jia Zhang
于 2017/10/28 下午8:44, Bruno Haible 写道: > [Dropping coreutils, since I'm replying only the gnulib part.] > > Hi Jia, > >> Plz refer to the following PRs for code review. >> >> - For the new gnulib module crypto/sm3 >> https://github.com/coreutils/gnulib/pull/3/commits > > Usually, on this mail

[V2 PATCH] Implement SM3 hash algorithm in gnulib and the computing tool in coreutils.

2017-10-28 Thread Jia Zhang
Hi Pádraig & Bruno, This is the V2 review request for SM3 hash algorithm. As promised, I have made SM3 hash algorithm available in the latest libgcrypt. See https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=4423bf3cc4432b9bfe801ff74cb05e6f0dd3eccd The V2 patch adds the support

Re: [PATCH] Implement SM3 hash algorithm in gnulib and the computing tool in coreutils.

2017-10-24 Thread Jia Zhang
于 2017/10/11 下午5:13, Bruno Haible 写道: > 张佳(乾越) wrote: >>> Currently, I only implement SM3 in gnulib. I will implement it >>> in libgcrypt and openssl later. > > Yes, for a crypto algorjthm to be widely usable in GNU, it needs > to be available both in GNUTLS (via libgcrypt) and openssl. > > Pád