Merge remote-tracking branch 'cyassl/master' into STM.LPC

Conflicts:
	IDE/MDK-ARM/MDK-ARM/CyaSSL/config-FS.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/config-RTX-TCP-FS.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h
	IDE/MDK-ARM/MDK-ARM/CyaSSL/main.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/shell.c
	IDE/MDK-ARM/MDK-ARM/CyaSSL/ssl-dummy.c
	IDE/MDK-ARM/MDK-ARM/config/File_Config.c
	IDE/MDK-ARM/MDK-ARM/config/RTX_Conf_CM.c
	IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvopt
	IDE/MDK-ARM/Projects/MDK-ARM-STM32F2xx.uvproj
	ctaocrypt/src/random.c
	src/internal.c
This commit is contained in:
kojo
2013-05-26 09:27:06 +09:00
28 changed files with 1960 additions and 177 deletions

View File

@@ -580,7 +580,14 @@ int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
#elif defined(NO_DEV_RANDOM)
#error "you need to write an os specific GenerateSeed() here"
int GenerateSeed(OS_Seed* os, byte* output, word32 sz) { return(0) ; }
/*
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
return 0;
}
*/
#else /* !USE_WINDOWS_API && !THREADX && !MICRIUM && !NO_DEV_RANDOM */

View File

@@ -26,7 +26,7 @@
*/
/**
* Edited by Moisés Guimarães (moises.guimaraes@phoebus.com.br)
* Edited by Moisés Guimarães (moisesguimaraesm@gmail.com)
* to fit CyaSSL's needs.
*/
@@ -1183,16 +1183,16 @@ static int _fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
{
fp_int tmp;
int err;
/* prevent overflows */
if (P->used > (FP_SIZE/2)) {
return FP_VAL;
}
/* is X negative? */
if (X->sign == FP_NEG) {
#ifndef POSITIVE_EXP_ONLY /* reduce stack if assume no negatives */
int err;
fp_int tmp;
/* yes, copy G and invmod it */
fp_copy(G, &tmp);
if ((err = fp_invmod(&tmp, P, &tmp)) != FP_OKAY) {
@@ -1204,7 +1204,11 @@ int fp_exptmod(fp_int * G, fp_int * X, fp_int * P, fp_int * Y)
X->sign = FP_NEG;
}
return err;
} else {
#else
return FP_VAL;
#endif
}
else {
/* Positive exponent so just exptmod */
return _fp_exptmod(G, X, P, Y);
}