der_decode_subject_public_key_info: fix compile error

also make it possible to define min/max RSA key sizes externally

This closes #59
This commit is contained in:
Steffen Jaeckel
2015-02-15 16:32:12 +01:00
parent 62878de0c5
commit 90e968a202
3 changed files with 26 additions and 6 deletions
+24
View File
@@ -367,6 +367,30 @@
#endif /* LTC_NO_PK */
/* define these PK sizes out of LTC_NO_PK
* to have them always defined
*/
#if defined(LTC_MRSA)
/* Min and Max RSA key sizes (in bits) */
#ifndef MIN_RSA_SIZE
#define MIN_RSA_SIZE 1024
#endif
#ifndef MAX_RSA_SIZE
#define MAX_RSA_SIZE 4096
#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 */
#ifndef LTC_NO_PKCS
-4
View File
@@ -28,10 +28,6 @@ int pk_get_oid(int pk, oid_st *st);
/* ---- RSA ---- */
#ifdef LTC_MRSA
/* Min and Max RSA key sizes (in bits) */
#define MIN_RSA_SIZE 1024
#define MAX_RSA_SIZE 4096
/** RSA PKCS style key */
typedef struct Rsa_key {
/** Type of key, PK_PRIVATE or PK_PUBLIC */