From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH 08/11] cipher: Update for current kernel akcipher interface
Date: Tue, 07 Jun 2016 17:23:58 -0500 [thread overview]
Message-ID: <5757497E.8060409@gmail.com> (raw)
In-Reply-To: <CAOq732K5dAJJg3Z9n61tzNUJWbsqpwPFeqoec7BVgn8p93KX9A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2089 bytes --]
Hi Andrew,
>
> I believe the "rsa" cipher does not include padding and
> "pkcs1pad(rsa)" does and now there's also a "pkcs1pad(rsa, <hash
> type>)" that could save as a little more work in the TLS code if we
> only supported TLS 1.2 but can't be used for < 1.2.
I wonder if keyctl can expose the hash for us as well. Either way, we
should take advantage of this if possible.
>
>>
>
>>> @@ -943,19 +943,9 @@ static bool tls_rsa_sign(struct l_tls *tls, uint8_t
>>> **out,
>>> return false;
>>> }
>>>
>>> - privkey_short = extract_rsakey(privkey, key_size, &short_size);
>>> - tls_free_key(privkey, key_size);
>>> -
>>> - if (!privkey_short) {
>>> - tls_disconnect(tls, TLS_ALERT_INTERNAL_ERROR,
>>> - TLS_ALERT_BAD_CERT);
>>> -
>>> - return false;
>>> - }
>>> -
>>> rsa_privkey = l_asymmetric_cipher_new(L_CIPHER_RSA_PKCS1_V1_5,
>>> - privkey_short,
>>> short_size);
>>> - tls_free_key(privkey_short, short_size);
>>> + privkey, key_size);
>>> + tls_free_key(privkey, key_size);
>>>
>>> if (!rsa_privkey) {
>>> tls_disconnect(tls, TLS_ALERT_INTERNAL_ERROR, 0);
>>
>>
>> Should we be reporting BAD_CERT here?
>
> I'm not sure if you mean BAD_CERT as the second or third parameter but
Third parameter. Mat took out the code that returned BAD_CERT if
extract_rsakey failed. So now if the asymmetric cipher creation fails,
we have to assume that the certificate is bad (or a configuration issue).
> I don't think we should do either. Passing BAD_CERT to the remote end
> implies it that it has supplied a bad certificate and the disconnect
> is their fault. Passing BAD_CERT to our higher layer will imply that
> our certificate is wrong. In reality the problem here is most likely
> kernel configuration.
Or that the remote has given us a bad certificate :)
Regards,
-Denis
next prev parent reply other threads:[~2016-06-07 22:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 20:54 [PATCH 01/11] gitignore: Add unit/test-dbus-message-fds Mat Martineau
2016-06-06 20:54 ` [PATCH 02/11] main: Fix comment typo Mat Martineau
2016-06-06 20:54 ` [PATCH 03/11] unit: Free all memory allocated during the DH test Mat Martineau
2016-06-06 20:54 ` [PATCH 04/11] unit: Script and config file for creating test certificates Mat Martineau
2016-06-06 20:54 ` [PATCH 05/11] unit: New set of " Mat Martineau
2016-06-06 20:54 ` [PATCH 06/11] key: Add keyring APIs Mat Martineau
2016-06-06 20:54 ` [PATCH 07/11] unit: Keyring tests Mat Martineau
2016-06-06 20:54 ` [PATCH 08/11] cipher: Update for current kernel akcipher interface Mat Martineau
2016-06-06 23:55 ` Denis Kenzior
2016-06-07 17:51 ` Denis Kenzior
2016-06-07 19:10 ` Mat Martineau
2016-06-07 19:32 ` Denis Kenzior
2016-06-08 0:18 ` Mat Martineau
2016-06-09 20:20 ` Mat Martineau
2016-06-09 21:06 ` Denis Kenzior
2016-06-09 21:18 ` Mat Martineau
2016-06-09 21:20 ` Andrzej Zaborowski
2016-06-07 21:47 ` Andrzej Zaborowski
2016-06-07 22:23 ` Denis Kenzior [this message]
2016-06-07 22:43 ` Andrzej Zaborowski
2016-06-06 20:54 ` [PATCH 09/11] unit: Update for akcipher changes Mat Martineau
2016-06-06 20:54 ` [PATCH 10/11] cipher: Return result length from asymmetric cipher operations Mat Martineau
2016-06-06 20:54 ` [PATCH 11/11] tls: Free cert memory after sending cert Mat Martineau
2016-06-07 17:54 ` [PATCH 01/11] gitignore: Add unit/test-dbus-message-fds Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5757497E.8060409@gmail.com \
--to=denkenz@gmail.com \
--cc=ell@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.