diff options
author | Paul Selkirk <paul@psgd.org> | 2016-03-21 23:04:59 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-03-21 23:04:59 -0400 |
commit | 01f5452659c34e5232bcb534e14e45b0c430047e (patch) | |
tree | beff8a4f0bfadf551517063aa7f91cff6673e433 /asn1.c | |
parent | cdaf07d30bd440cf3ee2f6615d044634734047bd (diff) | |
parent | cf04c6c34994f545cbf509a6de4aed096e48aa61 (diff) |
Merge branch 'master' into rpc
Diffstat (limited to 'asn1.c')
-rw-r--r-- | asn1.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -161,7 +161,8 @@ hal_error_t hal_asn1_encode_spki(const uint8_t * const alg_oid, const size_t a const uint8_t * const pubkey, const size_t pubkey_len, uint8_t *der, size_t *der_len, const size_t der_max) { - if (alg_oid == NULL || alg_oid_len == 0 || pubkey == NULL || pubkey_len == 0 || (curve_oid == NULL && curve_oid_len != 0)) + if (alg_oid == NULL || alg_oid_len == 0 || pubkey_len == 0 || + (der != NULL && pubkey == NULL) || (curve_oid == NULL && curve_oid_len != 0)) return HAL_ERROR_BAD_ARGUMENTS; const uint8_t curve_oid_tag = curve_oid == NULL ? ASN1_NULL : ASN1_OBJECT_IDENTIFIER; |