add --enable-dsa

This commit is contained in:
toddouska 2013-03-11 16:39:06 -07:00
parent 2ab409df96
commit 7719cd9faa
3 changed files with 28 additions and 3 deletions

View File

@ -522,6 +522,21 @@ fi
AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
# DSA
AC_ARG_ENABLE([dsa],
[ --enable-dsa Enable DSA (default: disabled)],
[ ENABLED_DSA=$enableval ],
[ ENABLED_DSA=no ]
)
if test "$ENABLED_DSA" = "no"
then
AM_CFLAGS="$AM_CFLAGS -DNO_DSA"
fi
AM_CONDITIONAL([BUILD_DSA], [test "x$ENABLED_DSA" = "xyes"])
# HC128
AC_ARG_ENABLE([hc128],
[ --enable-hc128 Enable HC-128 (default: disabled)],
@ -910,6 +925,7 @@ echo " * certgen: $ENABLED_CERTGEN"
echo " * HC-128: $ENABLED_HC128"
echo " * RABBIT: $ENABLED_RABBIT"
echo " * MD4: $ENABLED_MD4"
echo " * DSA: $ENABLED_DSA"
echo " * PSK: $ENABLED_PSK"
echo " * LEANPSK: $ENABLED_LEANPSK"
echo " * RSA: $ENABLED_RSA"

View File

@ -27,7 +27,6 @@ src_libcyassl_la_SOURCES += ctaocrypt/src/des3.c \
ctaocrypt/src/md5.c \
ctaocrypt/src/asn.c \
ctaocrypt/src/dh.c \
ctaocrypt/src/dsa.c \
ctaocrypt/src/pwdbased.c \
ctaocrypt/src/aes.c \
ctaocrypt/src/memory.c
@ -41,6 +40,10 @@ if BUILD_MD4
src_libcyassl_la_SOURCES += ctaocrypt/src/md4.c
endif
if BUILD_DSA
src_libcyassl_la_SOURCES += ctaocrypt/src/dsa.c
endif
if BUILD_AESNI
src_libcyassl_la_SOURCES += ctaocrypt/src/aes_asm.s
endif

View File

@ -7340,6 +7340,7 @@ static int initGlobalRNG = 0;
}
#ifndef NO_DSA
static void InitCyaSSL_DSA(CYASSL_DSA* dsa)
{
if (dsa) {
@ -7432,7 +7433,7 @@ static int initGlobalRNG = 0;
return 0; /* key gen not needed by server */
}
#endif /* NO_DSA */
static void InitCyaSSL_Rsa(CYASSL_RSA* rsa)
{
@ -7532,6 +7533,7 @@ static int initGlobalRNG = 0;
}
#ifndef NO_DSA
static int SetDsaExternal(CYASSL_DSA* dsa)
{
DsaKey* key;
@ -7573,6 +7575,7 @@ static int initGlobalRNG = 0;
return 0;
}
#endif /* NO_DSA */
static int SetRsaExternal(CYASSL_RSA* rsa)
@ -7724,6 +7727,7 @@ static int initGlobalRNG = 0;
}
#ifndef NO_DSA
/* return 0 on success, < 0 otherwise */
int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet,
CYASSL_DSA* dsa)
@ -7759,6 +7763,7 @@ static int initGlobalRNG = 0;
return 0;
}
#endif /* NO_DSA */
/* return 1 on success, 0 otherwise */
@ -8330,6 +8335,7 @@ int CyaSSL_RSA_LoadDer(CYASSL_RSA* rsa, const unsigned char* der, int derSz)
}
#ifndef NO_DSA
/* Load DSA from Der, 0 on success < 0 on error */
int CyaSSL_DSA_LoadDer(CYASSL_DSA* dsa, const unsigned char* der, int derSz)
{
@ -8358,7 +8364,7 @@ int CyaSSL_DSA_LoadDer(CYASSL_DSA* dsa, const unsigned char* der, int derSz)
return 0;
}
#endif /* NO_DSA */