[gnutls-devel] GnuTLS | Too small MAX_SEED_SIZE for PRF functions (#1013)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Wed Jun 3 10:49:47 CEST 2020



Ruslan Marchenko created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1013



## Description of problem:
Current implementation of PRF limits MAX_SEED_SIZE to 200 bytes, while this seed size includes 2x GNUTLS_RANDOM_SIZE (32) + 2 ctx_len (u16) + label + context.
That leaves Label + Context with only 134 bytes. At the same time Context is only validated to be below u16 boundary (65535).
The labels in IANA registry have avg size 24 bytes leaving only 110 bytes for the context.

Is there any particular reason to limit it to 200 bytes?

## Version of gnutls used:
3.6.13-2


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

## How reproducible:
ret = gnutls_prf_rfc5705 (priv->session,
    30, "EXPORTER-SCRAM-Channel-Binding",
    116, "n=user,r=rOprNGfwEbeRWgbNEkqO,r=rOprNGfwEbeRWgbNEkqO%hvYDpWUa2RaTCAfuxFIlj)hNlF$k0,s=W22ZaJ0SNY7soEsUEjb6gQ==,i=4096",
    32, out_buf);

## Actual results:
GNUTLS_E_INTERNAL_ERROR

## Expected results:
GNUTLS_E_SUCCESS

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200603/71003513/attachment-0001.html>


More information about the Gnutls-devel mailing list