Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin.baulig@xamarin.com>2016-10-04 16:54:54 +0300
committerMartin Baulig <martin.baulig@xamarin.com>2016-10-04 16:55:41 +0300
commitac52e8869135c01cf1b4f53f38cef19786c9ec2a (patch)
tree2a6668b6840504a24e09ea5eb7b2f80562e491aa
parent432738a3c938b4f751307301c6aa07f2027a8864 (diff)
[PKCS8]: Distinguish between no password and an empty string.
-rw-r--r--crypto/pkcs8/pkcs8.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/pkcs8/pkcs8.c b/crypto/pkcs8/pkcs8.c
index 175a8855..85af2063 100644
--- a/crypto/pkcs8/pkcs8.c
+++ b/crypto/pkcs8/pkcs8.c
@@ -83,6 +83,12 @@ static int ascii_to_ucs2(const char *ascii, size_t ascii_len,
uint8_t *unitmp;
size_t ulen, i;
+ if (!ascii) {
+ *out = NULL;
+ *out_len = 0;
+ return 1;
+ }
+
ulen = ascii_len * 2 + 2;
if (ulen < ascii_len) {
return 0;