From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.01.org
Subject: Re: [PATCH 06/13] pkcs5: Add the PKCS#12 KDF
Date: Fri, 11 Dec 2020 15:50:33 +0000 [thread overview]
Message-ID: <481d483e-22b3-9604-40c4-4cbc58a2ba2c@gmail.com> (raw)
In-Reply-To: <CAOq732J+dz7SEh9sV9x=SZE0ii1KGAWBYvZj2_RGMcyp1BqZTw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 988 bytes --]
Hi Andrew,
>> So is this just a UCS2BE conversion? If so, then using l_utf8_to_ucs2be might
>> be clearer.
>
> Basically yes. But with l_utf8_to_ucs2be this will look something like:
>
> uint8_t *usc2;
>
> if (!l_utf8_validate(utf))
> return false;
You'll potentially need this step in either version actually.
utf8_get_codepoint isn't really enough to tell whether the entire string is
valid utf8. Where is the password coming from?
Also, I would think you'd pre-validate utf8 validity before ever getting to this
point?
>
> ucs2 = l_utf8_to_ucs2be(utf, out_len);
> if (!str)
> return false;
>
> memcpy(out_buf, ucs2, *out_len);
> explicit_bzero(ucs2);
> l_free(ucs2);
>
> I can do that but it seems we're doing less work without using
> l_utf8_to_ucs2be here.
You could add an own buffer version of utf8_to_ucs2be. But even this memcpy
version seems to be cleaner than open-coding it.
Regards,
-Denis
next prev parent reply other threads:[~2020-12-11 15:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-10 19:31 [PATCH 01/13] pem: Wipe more memory in PKCS#1 private key decoding Andrew Zaborowski
2020-12-10 19:31 ` [PATCH 02/13] pem: Factor out the PKCS#8 decoding code Andrew Zaborowski
2020-12-10 19:31 ` [PATCH 03/13] cipher: Add an RC2 implementation Andrew Zaborowski
2020-12-10 19:31 ` [PATCH 04/13] cipher: Add ARC4 implementation Andrew Zaborowski
2020-12-10 22:46 ` Denis Kenzior
2020-12-10 19:31 ` [PATCH 05/13] pem: Don't expect padding with stream ciphers Andrew Zaborowski
2020-12-10 19:31 ` [PATCH 06/13] pkcs5: Add the PKCS#12 KDF Andrew Zaborowski
2020-12-10 22:51 ` Denis Kenzior
2020-12-11 10:34 ` Andrew Zaborowski
2020-12-11 15:50 ` Denis Kenzior [this message]
2020-12-12 0:06 ` Andrew Zaborowski
2020-12-10 19:32 ` [PATCH 07/13] pkcs5: Add PKCS#12 algorithms in pkcs5_cipher_from_alg_id Andrew Zaborowski
2020-12-10 19:32 ` [PATCH 08/13] pem: Add l_pem_load_container_file Andrew Zaborowski
2020-12-10 19:32 ` [PATCH 09/13] pem: Add PKCS#12 parsing Andrew Zaborowski
2020-12-10 22:47 ` [PATCH 01/13] pem: Wipe more memory in PKCS#1 private key decoding 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=481d483e-22b3-9604-40c4-4cbc58a2ba2c@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.