GnuTLS | `gnutls_hash_output(..., NULL)` leads to SIGSEGV (#1769)

Read-only notification of GnuTLS library development activities <[email protected]>
Newsgroups gmane.comp.encryption.gpg.gnutls.devel
Message-ID <[email protected]>

Barnabás Pőcze created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1769



## Description of problem:

`gnutls_hash_output(..., NULL)` can lead to SIGSEGV


## Version of gnutls used:

* 3.8.11

## Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)

* Arch Linux


## How reproducible:

Steps to Reproduce:

 * just doing the call triggers it every time (at least on my machine)

## Actual results:

```
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd3fcd in _nettle_write_be32 (length=<optimized out>, dst=0x0, src=0x5555555c0d40) at /usr/src/debug/nettle/nettle-3.10.2/write-be32.c:54
54	    WRITE_UINT32(dst, src[i]);
(gdb) bt full
#0  0x00007ffff7bd3fcd in _nettle_write_be32 (length=<optimized out>, dst=0x0, src=0x5555555c0d40) at /usr/src/debug/nettle/nettle-3.10.2/write-be32.c:54
        i = <optimized out>
        words = 8
        leftover = 0
#1  0x00007ffff7bd7f25 in nettle_sha256_digest (ctx=0x5555555c0d40, length=<optimized out>, digest=<optimized out>) at /usr/src/debug/nettle/nettle-3.10.2/sha256.c:156
No locals.
#2  0x00007ffff6b491fa in wrap_x86_hash_output (src_ctx=<optimized out>, digest=<optimized out>, digestsize=<optimized out>) at accelerated/x86/sha-x86-ssse3.c:329
        ctx = <optimized out>
        __func__ = "wrap_x86_hash_output"
[...]
```



## Expected results:

The hash state is reset as indicated in the documentation.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1769
You're receiving this email because of your account on gitlab.com.

_______________________________________________
Gnutls-devel mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.