diff options
author | Rob Austein <sra@hactrn.net> | 2016-03-11 19:24:00 -0500 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-03-11 19:24:00 -0500 |
commit | 7e4d5d73cf1fdcbee10a06a307529955ad17919e (patch) | |
tree | 97a635c28724e4eacccc555f0bac027fd350f97c /asn1.c | |
parent | 0b8820c33421d5c23022af326ada1815fb5c742d (diff) |
First round of debugging based on RPC pkey tests: mostly ASN.1
silliness, with a bit of PKCS #1.5 padding silliness for desert.
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; |