summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-10-27 06:01:20 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-10-27 06:01:20 +0000
commitdaaf159a9735f67cffe4f9c6a5edb3932c6b3729 (patch)
tree1550a7d505e5de2ac7c0b122d3ecf7438853bd4e
parent3ad2942bcf9dadb84e6c1f11a5e14bb65aed4c13 (diff)
downloadgnutls-daaf159a9735f67cffe4f9c6a5edb3932c6b3729.tar.gz
*** empty log message ***
-rw-r--r--lib/x509/pkcs12_encr.c2
-rw-r--r--lib/x509/privkey_pkcs8.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/x509/pkcs12_encr.c b/lib/x509/pkcs12_encr.c
index e378a22e12..4de8a227c7 100644
--- a/lib/x509/pkcs12_encr.c
+++ b/lib/x509/pkcs12_encr.c
@@ -70,7 +70,7 @@ _pkcs12_string_to_key(unsigned int id, const opaque * salt,
cur_keylen = 0;
pwlen = strlen(pw);
- if (pwlen > 63 / 2) {
+ if (pwlen==0 || pwlen > 63 / 2) {
gnutls_assert();
return GNUTLS_E_INVALID_REQUEST;
}
diff --git a/lib/x509/privkey_pkcs8.c b/lib/x509/privkey_pkcs8.c
index d4ff0e65c7..e416161145 100644
--- a/lib/x509/privkey_pkcs8.c
+++ b/lib/x509/privkey_pkcs8.c
@@ -474,9 +474,9 @@ int gnutls_x509_privkey_export_pkcs8(gnutls_x509_privkey_t key,
*/
static
int read_pkcs_schema_params(schema_id schema, const char *password,
- const opaque * data, int data_size,
- struct pbkdf2_params *kdf_params,
- struct pbe_enc_params *enc_params)
+ const opaque * data, int data_size,
+ struct pbkdf2_params *kdf_params,
+ struct pbe_enc_params *enc_params)
{
ASN1_TYPE pbes2_asn = ASN1_TYPE_EMPTY;
int result;
@@ -822,10 +822,8 @@ int decode_private_key_info(const gnutls_datum_t * der,
*
**/
int gnutls_x509_privkey_import_pkcs8(gnutls_x509_privkey_t key,
- const gnutls_datum_t * data,
- gnutls_x509_crt_fmt_t format,
- const char *password,
- unsigned int flags)
+ const gnutls_datum_t * data, gnutls_x509_crt_fmt_t format,
+ const char *password, unsigned int flags)
{
int result = 0, need_free = 0;
gnutls_datum_t _data;