mostly remove MAX_RSA_SIZE
This commit is contained in:
parent
ab02d2e450
commit
9cfbaa83a3
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user