Kamil Dudka wrote:
> > However the libgcrypt part still seems to be broken.
Bad.
> Attached is my follow-up.
..
> diff --git a/src/libgcrypt.c b/src/libgcrypt.c
> index b06be42..84d708e 100644
> --- a/src/libgcrypt.c
> +++ b/src/libgcrypt.c
> @@ -435,7 +435,17 @@ _libssh2_dsa_sha1_sign(libssh2_dsa_ctx * dsactx,
> }
>
> tmp = gcry_sexp_nth_data(data, 1, &size);
> - if (!tmp || size < 1 || size > 20) {
> + if (!tmp) {
> + ret = -1;
> + goto out;
> + }
> +
> + if (tmp[0] == '\0') {
> + tmp++;
> + size--;
> + }
> +
> + if (size < 1 || size > 20) {
> ret = -1;
> goto out;
> }
Hm, this is how it looked before my patch. Do you know what is up
with that tmp[0] == '\0' thing?
Does this change make it work? It seems to me that the result would
be equivalent?
If size<20 then bytes are copied from tmp offset by (20-size), so if
size=19 and tmp is moved forward, or if size=20 and tmp[0]=0, should
be the same - right?
I like the error handling, but it didn't have a functional change,
right?
//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel