Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/headers/tomcrypt_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,22 @@
#define LTC_PBES
#endif

#if defined(LTC_PBES) && !defined(LTC_PKCS_5)
#error LTC_PBES requires LTC_PKCS_5
#endif

#if defined(LTC_PBES) && !defined(LTC_PKCS_12)
#error LTC_PBES requires LTC_PKCS_12
#endif

#if defined(LTC_PKCS_5) && !defined(LTC_HMAC)
#error LTC_PKCS_5 requires LTC_HMAC
#endif

#if defined(LTC_PKCS_5) && !defined(LTC_HASH_HELPERS)
#error LTC_PKCS_5 requires LTC_HASH_HELPERS
#endif

#if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL)
#error Pelican-MAC requires LTC_RIJNDAEL
#endif
Expand Down
7 changes: 4 additions & 3 deletions src/pk/asn1/x509/x509_decode_public_key_from_certificate.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ int x509_decode_public_key_from_certificate(const unsigned char *in, unsigned lo
unsigned long tmpbuf_len, tmp_inlen;
ltc_asn1_list *decoded_list = NULL, *l;

LTC_ARGCHK(in != NULL);
LTC_ARGCHK(inlen != 0);
LTC_ARGCHK(in != NULL);
LTC_ARGCHK(inlen != 0);
LTC_ARGCHK(callback != NULL);

tmpbuf_len = inlen;
tmpbuf = XCALLOC(1, tmpbuf_len);
Expand Down Expand Up @@ -81,7 +82,7 @@ int x509_decode_public_key_from_certificate(const unsigned char *in, unsigned lo
&& (l->data != NULL)
&& LOOKS_LIKE_SPKI(l->child)) {
if (algorithm == PKA_EC) {
err = ecc_import_subject_public_key_info(l->data, l->size, ctx);
err = callback(l->data, l->size, ctx);
} else {
err = x509_decode_subject_public_key_info(l->data, l->size,
algorithm, tmpbuf, &tmpbuf_len,
Expand Down
5 changes: 4 additions & 1 deletion src/pk/ecc/ecc_import_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ int ecc_import_subject_public_key_info(const unsigned char *in, unsigned long in
*/
int ecc_import_x509(const unsigned char *in, unsigned long inlen, ecc_key *key)
{
return x509_decode_public_key_from_certificate(in, inlen, PKA_EC, LTC_ASN1_EOL, NULL, NULL, NULL, key);
return x509_decode_public_key_from_certificate(in, inlen,
PKA_EC,
LTC_ASN1_EOL, NULL, NULL,
(public_key_decode_cb)ecc_import_subject_public_key_info, key);
}

#endif /* LTC_MECC */
Expand Down
3 changes: 3 additions & 0 deletions src/pk/ecc/ecc_ssh_ecdsa_encode_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Russ Williams
*/

#ifdef LTC_SSH

/**
Curve/OID to SSH+ECDSA name string mapping
@param buffer [out] The destination for the name
Expand Down Expand Up @@ -60,3 +62,4 @@ int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key
return err;
}

#endif