aboutsummaryrefslogtreecommitdiffstats
path: root/Source/lib/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'Source/lib/crypto')
-rw-r--r--Source/lib/crypto/rsa/rsa_private_key.c1
-rwxr-xr-xSource/lib/crypto/x509.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/lib/crypto/rsa/rsa_private_key.c b/Source/lib/crypto/rsa/rsa_private_key.c
index 8286612a9..358653f0e 100644
--- a/Source/lib/crypto/rsa/rsa_private_key.c
+++ b/Source/lib/crypto/rsa/rsa_private_key.c
@@ -327,7 +327,6 @@ static status_t build_emsa_pkcs1_signature(private_rsa_private_key_t *this, hash
memcpy(em.ptr + em.len - hash.len, hash.ptr, hash.len);
/* set oid */
memcpy(em.ptr + em.len - hash.len - oid.len, oid.ptr, oid.len);
-
/* build signature */
*signature = this->rsasp1(this, em);
diff --git a/Source/lib/crypto/x509.c b/Source/lib/crypto/x509.c
index 28e7d1898..86a595618 100755
--- a/Source/lib/crypto/x509.c
+++ b/Source/lib/crypto/x509.c
@@ -883,7 +883,8 @@ x509_t *x509_create_from_chunk(chunk_t chunk)
/* we do not use a per-instance logger right now, since its not always accessible */
logger = logger_manager->get_logger(logger_manager, ASN1);
- if (!parse_x509cert(chunk, 0, this))
+ if (!is_asn1(chunk) ||
+ !parse_x509cert(chunk, 0, this))
{
destroy(this);
return NULL;