Re: [PATCH 4/9] tls: Support peer certificates that use ECDSA
Denis Kenzior <[email protected]>
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
Hi Mat,
> default:
Indeed.
> here to get it to build. Details below.
>
>> + TLS_DISCONNECT(TLS_ALERT_INTERNAL_ERROR, 0,
>> + "Unknown public key type");
>> + return;
>> + }
>> +
>> + if (!l_key_get_info(tls->peer_pubkey, format_type, checksum_type,
>> + &tls->peer_pubkey_size, &dummy)) {
>
> The ell (standalone, bootstrap-configure) build fails here with gcc12/Fedora36:
>
> ell/tls.c:2061:14: error: 'checksum_type' may be used uninitialized
> [-Werror=maybe-uninitialized]
> ell/tls.c:2061:14: error: 'format_type' may be used uninitialized
> [-Werror=maybe-uninitialized]
>
> Apparently gcc12 can't track that -Werror=switch-enum is in use in combination
> with -Werror=maybe-uninitialized, and doesn't understand that the switch
> statement above does guarantee initialization.
>
GCC seems a bit silly here. Not sure adding 'default:' is any better since we
use these warnings defensively in case a new enumeration is added and not handled.
Anyhow, I fixed this slightly differently in v2 out shortly. Thanks for testing.
Regards,
-Denis