[gnutls-devel] GnuTLS | support non-NULL-terminated PSKs (!917)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Tue Oct 8 17:03:52 CEST 2019




Ander Juaristi commented on a discussion: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_227571269

Yes, I saw that, but had no idea how to proceed. Thank you for helping me unblock this.

> Is the error case you have in mind to test supposed to trigger an alert or not?

No, (if my assumptions are correct) it should test for `GNUTLS_E_PUSH_ERROR`. The original test already tests that (see psk-file.c, [line 413](https://gitlab.com/gnutls/gnutls/blob/master/tests/psk-file.c#L413)):

```
/* try without server credentials */
run_test3("NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+DHE-PSK", NULL, "jas", &key, 1, 0, 0, GNUTLS_E_PUSH_ERROR, GNUTLS_E_INSUFFICIENT_CREDENTIALS);
```

The new test just extends that failure case to binary users, as I assume behavior should be the same regardless of whether the user is binary or not:

```
/* try without server credentials */
run_test3("NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+DHE-PSK", NULL, &user_jas, &key, 1, 0, 0, GNUTLS_E_PUSH_ERROR, GNUTLS_E_INSUFFICIENT_CREDENTIALS, 0);
run_test3("NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+DHE-PSK", NULL, &user_hex, &key, 1, 0, 0, GNUTLS_E_PUSH_ERROR, GNUTLS_E_INSUFFICIENT_CREDENTIALS, 1);
run_test3("NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+DHE-PSK", NULL, &user_null_1, &key, 1, 0, 0, GNUTLS_E_PUSH_ERROR, GNUTLS_E_INSUFFICIENT_CREDENTIALS, 1);
run_test3("NORMAL:-VERS-ALL:+VERS-TLS1.3:+PSK:+DHE-PSK", NULL, &user_null_2, &key, 1, 0, 0, GNUTLS_E_PUSH_ERROR, GNUTLS_E_INSUFFICIENT_CREDENTIALS, 1);
```

Any idea how should we proceed?

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/917#note_227571269
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/20191008/151b46e0/attachment-0001.html>


More information about the Gnutls-devel mailing list