forked from wolfSSL/wolfssl
refinements from peer review for #6303.
This commit is contained in:
@ -10405,7 +10405,7 @@ static WC_INLINE void InitKeyWrapCounter(byte* inOutCtr, word32 value)
|
|||||||
|
|
||||||
bytes = sizeof(word32);
|
bytes = sizeof(word32);
|
||||||
for (i = 0; i < sizeof(word32); i++) {
|
for (i = 0; i < sizeof(word32); i++) {
|
||||||
inOutCtr[i+sizeof(word32)] = (value >> ((bytes - 1) * 8)) & 0xFF;
|
inOutCtr[i+sizeof(word32)] = (byte)(value >> ((bytes - 1) * 8));
|
||||||
bytes--;
|
bytes--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2944,7 +2944,7 @@ int wc_DhGenerateParams(WC_RNG *rng, int modSz, DhKey *dh)
|
|||||||
/* force magnitude */
|
/* force magnitude */
|
||||||
buf[0] |= 0xC0;
|
buf[0] |= 0xC0;
|
||||||
/* force even */
|
/* force even */
|
||||||
buf[bufSz - 1] &= (byte)~1U;
|
buf[bufSz - 1] &= 0xfe;
|
||||||
|
|
||||||
if (mp_init_multi(tmp, tmp2, &dh->p, &dh->q, &dh->g, 0)
|
if (mp_init_multi(tmp, tmp2, &dh->p, &dh->q, &dh->g, 0)
|
||||||
!= MP_OKAY) {
|
!= MP_OKAY) {
|
||||||
|
@ -411,7 +411,7 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
|
|||||||
WOLFSSL_ENTER("wc_CryptKey");
|
WOLFSSL_ENTER("wc_CryptKey");
|
||||||
|
|
||||||
if (length < 0)
|
if (length < 0)
|
||||||
ret = BAD_LENGTH_E;
|
return BAD_LENGTH_E;
|
||||||
|
|
||||||
switch (id) {
|
switch (id) {
|
||||||
#ifndef NO_DES3
|
#ifndef NO_DES3
|
||||||
|
@ -1085,10 +1085,7 @@ size_t wc_strlcat(char *dst, const char *src, size_t dstSize)
|
|||||||
int wc_strcasecmp(const char *s1, const char *s2)
|
int wc_strcasecmp(const char *s1, const char *s2)
|
||||||
{
|
{
|
||||||
char c1, c2;
|
char c1, c2;
|
||||||
for (;
|
for (;;++s1, ++s2) {
|
||||||
;
|
|
||||||
++s1, ++s2)
|
|
||||||
{
|
|
||||||
c1 = *s1;
|
c1 = *s1;
|
||||||
if ((c1 >= 'a') && (c1 <= 'z'))
|
if ((c1 >= 'a') && (c1 <= 'z'))
|
||||||
c1 -= ('a' - 'A');
|
c1 -= ('a' - 'A');
|
||||||
@ -1106,10 +1103,7 @@ int wc_strcasecmp(const char *s1, const char *s2)
|
|||||||
int wc_strncasecmp(const char *s1, const char *s2, size_t n)
|
int wc_strncasecmp(const char *s1, const char *s2, size_t n)
|
||||||
{
|
{
|
||||||
char c1, c2;
|
char c1, c2;
|
||||||
for (c1 = 0, c2 = 0;
|
for (c1 = 0, c2 = 0; n > 0; --n, ++s1, ++s2) {
|
||||||
n > 0;
|
|
||||||
--n, ++s1, ++s2)
|
|
||||||
{
|
|
||||||
c1 = *s1;
|
c1 = *s1;
|
||||||
if ((c1 >= 'a') && (c1 <= 'z'))
|
if ((c1 >= 'a') && (c1 <= 'z'))
|
||||||
c1 -= ('a' - 'A');
|
c1 -= ('a' - 'A');
|
||||||
|
Reference in New Issue
Block a user