Skip to content

Commit 9cfbaa8

Browse files
committed
mostly remove MAX_RSA_SIZE
1 parent ab02d2e commit 9cfbaa8

5 files changed

Lines changed: 2 additions & 19 deletions

File tree

src/headers/tomcrypt_custom.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,6 @@
438438
#endif
439439
#endif
440440

441-
/* in cases where you want ASN.1/DER functionality, but no
442-
* RSA, you can define this externally if 1024 is not enough
443-
*/
444-
#if defined(LTC_MRSA)
445-
#define LTC_DER_MAX_PUBKEY_SIZE MAX_RSA_SIZE
446-
#elif !defined(LTC_DER_MAX_PUBKEY_SIZE)
447-
/* this includes DSA */
448-
#define LTC_DER_MAX_PUBKEY_SIZE 1024
449-
#endif
450-
451-
452441
/* PKCS #1 (RSA) and #5 (Password Handling) stuff */
453442
#ifndef LTC_NO_PKCS
454443

src/misc/crypt/crypt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,6 @@ const char *crypt_build_settings =
399399
#if defined(LTC_DER)
400400
" DER "
401401
#endif
402-
#if defined(LTC_DER_MAX_PUBKEY_SIZE)
403-
" " NAME_VALUE(LTC_DER_MAX_PUBKEY_SIZE) " "
404-
#endif
405402
#if defined(LTC_PKCS_1)
406403
" PKCS#1 "
407404
#endif

src/misc/crypt/crypt_constants.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ static const crypt_constant _crypt_constants[] = {
107107
{"LTC_MDSA", 0},
108108
#endif
109109

110-
#ifdef LTC_DER_MAX_PUBKEY_SIZE
111-
_C_STRINGIFY(LTC_DER_MAX_PUBKEY_SIZE),
112-
#endif
113110
#ifdef LTC_MILLER_RABIN_REPS
114111
_C_STRINGIFY(LTC_MILLER_RABIN_REPS),
115112
#endif

src/pk/dsa/dsa_import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key)
9090
key->type = PK_PRIVATE;
9191
} else { /* public */
9292
ltc_asn1_list params[3];
93-
unsigned long tmpbuf_len = LTC_DER_MAX_PUBKEY_SIZE*8;
93+
unsigned long tmpbuf_len = inlen;
9494

9595
LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL);
9696
LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL);

src/pk/rsa/rsa_import_x509.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key)
3939
return err;
4040
}
4141

42-
tmpbuf_len = MAX_RSA_SIZE * 8;
42+
tmpbuf_len = inlen;
4343
tmpbuf = XCALLOC(1, tmpbuf_len);
4444
if (tmpbuf == NULL) {
4545
err = CRYPT_MEM;

0 commit comments

Comments
 (0)