Browse Source

mostly remove MAX_RSA_SIZE

Steffen Jaeckel 8 years ago
parent
commit
9cfbaa83a3

+ 0 - 11
src/headers/tomcrypt_custom.h

@@ -438,17 +438,6 @@
 #endif
 #endif
 #endif
 #endif
 
 
-/* in cases where you want ASN.1/DER functionality, but no
- * RSA, you can define this externally if 1024 is not enough
- */
-#if defined(LTC_MRSA)
-#define LTC_DER_MAX_PUBKEY_SIZE MAX_RSA_SIZE
-#elif !defined(LTC_DER_MAX_PUBKEY_SIZE)
-/* this includes DSA */
-#define LTC_DER_MAX_PUBKEY_SIZE 1024
-#endif
-
-
 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
 /* PKCS #1 (RSA) and #5 (Password Handling) stuff */
 #ifndef LTC_NO_PKCS
 #ifndef LTC_NO_PKCS
 
 

+ 0 - 3
src/misc/crypt/crypt.c

@@ -399,9 +399,6 @@ const char *crypt_build_settings =
 #if defined(LTC_DER)
 #if defined(LTC_DER)
     " DER "
     " DER "
 #endif
 #endif
-#if defined(LTC_DER_MAX_PUBKEY_SIZE)
-    " " NAME_VALUE(LTC_DER_MAX_PUBKEY_SIZE) " "
-#endif
 #if defined(LTC_PKCS_1)
 #if defined(LTC_PKCS_1)
     " PKCS#1 "
     " PKCS#1 "
 #endif
 #endif

+ 0 - 3
src/misc/crypt/crypt_constants.c

@@ -107,9 +107,6 @@ static const crypt_constant _crypt_constants[] = {
     {"LTC_MDSA", 0},
     {"LTC_MDSA", 0},
 #endif
 #endif
 
 
-#ifdef LTC_DER_MAX_PUBKEY_SIZE
-    _C_STRINGIFY(LTC_DER_MAX_PUBKEY_SIZE),
-#endif
 #ifdef LTC_MILLER_RABIN_REPS
 #ifdef LTC_MILLER_RABIN_REPS
     _C_STRINGIFY(LTC_MILLER_RABIN_REPS),
     _C_STRINGIFY(LTC_MILLER_RABIN_REPS),
 #endif
 #endif

+ 1 - 1
src/pk/dsa/dsa_import.c

@@ -90,7 +90,7 @@ int dsa_import(const unsigned char *in, unsigned long inlen, dsa_key *key)
        key->type = PK_PRIVATE;
        key->type = PK_PRIVATE;
    } else { /* public */
    } else { /* public */
       ltc_asn1_list params[3];
       ltc_asn1_list params[3];
-      unsigned long tmpbuf_len = LTC_DER_MAX_PUBKEY_SIZE*8;
+      unsigned long tmpbuf_len = inlen;
 
 
       LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL);
       LTC_SET_ASN1(params, 0, LTC_ASN1_INTEGER, key->p, 1UL);
       LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL);
       LTC_SET_ASN1(params, 1, LTC_ASN1_INTEGER, key->q, 1UL);

+ 1 - 1
src/pk/rsa/rsa_import_x509.c

@@ -39,7 +39,7 @@ int rsa_import_x509(const unsigned char *in, unsigned long inlen, rsa_key *key)
       return err;
       return err;
    }
    }
 
 
-   tmpbuf_len = MAX_RSA_SIZE * 8;
+   tmpbuf_len = inlen;
    tmpbuf = XCALLOC(1, tmpbuf_len);
    tmpbuf = XCALLOC(1, tmpbuf_len);
    if (tmpbuf == NULL) {
    if (tmpbuf == NULL) {
        err = CRYPT_MEM;
        err = CRYPT_MEM;