summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2005-12-08 15:11:24 +0000
committerSimon Josefsson <simon@josefsson.org>2005-12-08 15:11:24 +0000
commitad60fa11825b900131a113e4674abf76be951979 (patch)
tree4e0077c641e4205e241aa1493d17b86b22c56713
parentdaa38a6c315a3e346ca80aff46175425403402f0 (diff)
downloadgnutls-ad60fa11825b900131a113e4674abf76be951979.tar.gz
(gnutls_x509_privkey_import_pkcs8): Handle unencrypted PEM keys.
Remove unused "encrypted" variable.
-rw-r--r--lib/x509/privkey_pkcs8.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c
index 31516f4d1e..90158670f3 100644
--- a/lib/x509/privkey_pkcs8.c
+++ b/lib/x509/privkey_pkcs8.c
@@ -891,7 +891,6 @@ gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
{
int result = 0, need_free = 0;
gnutls_datum_t _data;
- int encrypted;
if (key == NULL)
{
@@ -915,7 +914,6 @@ gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
result =
_gnutls_fbase64_decode (PEM_UNENCRYPTED_PKCS8,
data->data, data->size, &out);
- encrypted = 0;
if (result < 0)
{ /* Try the encrypted header
@@ -930,9 +928,9 @@ gnutls_x509_privkey_import_pkcs8 (gnutls_x509_privkey_t key,
gnutls_assert ();
return result;
}
-
- encrypted = 1;
}
+ else if (flags == 0)
+ flags |= GNUTLS_PKCS_PLAIN;
_data.data = out;
_data.size = result;