Skip to content

Commit 3f1b687

Browse files
authored
Merge pull request #541 from pattop/fixes
Minor dependency cleanups
2 parents 40eea67 + 93ae347 commit 3f1b687

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

src/headers/tomcrypt_custom.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,22 @@
585585
#define LTC_PBES
586586
#endif
587587

588+
#if defined(LTC_PBES) && !defined(LTC_PKCS_5)
589+
#error LTC_PBES requires LTC_PKCS_5
590+
#endif
591+
592+
#if defined(LTC_PBES) && !defined(LTC_PKCS_12)
593+
#error LTC_PBES requires LTC_PKCS_12
594+
#endif
595+
596+
#if defined(LTC_PKCS_5) && !defined(LTC_HMAC)
597+
#error LTC_PKCS_5 requires LTC_HMAC
598+
#endif
599+
600+
#if defined(LTC_PKCS_5) && !defined(LTC_HASH_HELPERS)
601+
#error LTC_PKCS_5 requires LTC_HASH_HELPERS
602+
#endif
603+
588604
#if defined(LTC_PELICAN) && !defined(LTC_RIJNDAEL)
589605
#error Pelican-MAC requires LTC_RIJNDAEL
590606
#endif

src/pk/asn1/x509/x509_decode_public_key_from_certificate.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ int x509_decode_public_key_from_certificate(const unsigned char *in, unsigned lo
3939
unsigned long tmpbuf_len, tmp_inlen;
4040
ltc_asn1_list *decoded_list = NULL, *l;
4141

42-
LTC_ARGCHK(in != NULL);
43-
LTC_ARGCHK(inlen != 0);
42+
LTC_ARGCHK(in != NULL);
43+
LTC_ARGCHK(inlen != 0);
44+
LTC_ARGCHK(callback != NULL);
4445

4546
tmpbuf_len = inlen;
4647
tmpbuf = XCALLOC(1, tmpbuf_len);
@@ -81,7 +82,7 @@ int x509_decode_public_key_from_certificate(const unsigned char *in, unsigned lo
8182
&& (l->data != NULL)
8283
&& LOOKS_LIKE_SPKI(l->child)) {
8384
if (algorithm == PKA_EC) {
84-
err = ecc_import_subject_public_key_info(l->data, l->size, ctx);
85+
err = callback(l->data, l->size, ctx);
8586
} else {
8687
err = x509_decode_subject_public_key_info(l->data, l->size,
8788
algorithm, tmpbuf, &tmpbuf_len,

src/pk/ecc/ecc_import_x509.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ int ecc_import_subject_public_key_info(const unsigned char *in, unsigned long in
106106
*/
107107
int ecc_import_x509(const unsigned char *in, unsigned long inlen, ecc_key *key)
108108
{
109-
return x509_decode_public_key_from_certificate(in, inlen, PKA_EC, LTC_ASN1_EOL, NULL, NULL, NULL, key);
109+
return x509_decode_public_key_from_certificate(in, inlen,
110+
PKA_EC,
111+
LTC_ASN1_EOL, NULL, NULL,
112+
(public_key_decode_cb)ecc_import_subject_public_key_info, key);
110113
}
111114

112115
#endif /* LTC_MECC */

src/pk/ecc/ecc_ssh_ecdsa_encode_name.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
Russ Williams
99
*/
1010

11+
#ifdef LTC_SSH
12+
1113
/**
1214
Curve/OID to SSH+ECDSA name string mapping
1315
@param buffer [out] The destination for the name
@@ -60,3 +62,4 @@ int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key
6062
return err;
6163
}
6264

65+
#endif

0 commit comments

Comments
 (0)