@@ -2159,7 +2159,7 @@ int GetLength_ex(const byte* input, word32* inOutIdx, int* len, word32 maxIdx,
21592159 /* Bottom 7 bits are the number of bytes to calculate length with.
21602160 * Note: 0 indicates indefinite length encoding *not* 0 bytes of length.
21612161 */
2162- word32 bytes = b & 0x7F ;
2162+ word32 bytes = (word32) b & 0x7FU ;
21632163 int minLen;
21642164
21652165 /* Calculate minimum length to be encoded with bytes. */
@@ -2935,7 +2935,7 @@ static int SetASNIntMP(mp_int* n, int maxSz, byte* output)
29352935 length = mp_unsigned_bin_size(n);
29362936 if (maxSz >= 0 && (1 + length + (leadingBit ? 1 : 0)) > maxSz)
29372937 return BUFFER_E;
2938- idx = SetASNInt(length, leadingBit ? 0x80 : 0x00 , output);
2938+ idx = SetASNInt(length, (byte)( leadingBit ? 0x80U : 0x00U) , output);
29392939 if (maxSz >= 0 && (idx + length) > maxSz)
29402940 return BUFFER_E;
29412941
@@ -14468,7 +14468,7 @@ word32 SetLength(word32 length, byte* output)
1446814468
1446914469 if (output) {
1447014470 /* Encode count byte. */
14471- output[i] = j | ASN_LONG_LENGTH;
14471+ output[i] = (byte)( j | ASN_LONG_LENGTH) ;
1447214472 }
1447314473 /* Skip over count byte. */
1447414474 i++;
@@ -14550,8 +14550,8 @@ word32 SetSet(word32 len, byte* output)
1455014550 */
1455114551word32 SetImplicit(byte tag, byte number, word32 len, byte* output)
1455214552{
14553- tag = ((tag == ASN_SEQUENCE || tag == ASN_SET) ? ASN_CONSTRUCTED : 0)
14554- | ASN_CONTEXT_SPECIFIC | number;
14553+ tag = (byte)(( (tag == ASN_SEQUENCE || tag == ASN_SET) ? ASN_CONSTRUCTED : 0)
14554+ | ASN_CONTEXT_SPECIFIC | number) ;
1455514555 return SetHeader(tag, len, output);
1455614556}
1455714557
@@ -14566,8 +14566,8 @@ word32 SetImplicit(byte tag, byte number, word32 len, byte* output)
1456614566 */
1456714567word32 SetExplicit(byte number, word32 len, byte* output)
1456814568{
14569- return SetHeader(ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | number, len ,
14570- output);
14569+ return SetHeader((byte)( ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | number) ,
14570+ len, output);
1457114571}
1457214572
1457314573#if defined(OPENSSL_EXTRA)
@@ -14754,8 +14754,7 @@ word32 SetAlgoID(int algoOID, byte* output, int type, int curveSz)
1475414754
1475514755 tagSz = (type == oidHashType ||
1475614756 (type == oidSigType && !IsSigAlgoECC((word32)algoOID)) ||
14757- (type == oidKeyType && algoOID == RSAk)) ? 2 : 0;
14758-
14757+ (type == oidKeyType && algoOID == RSAk)) ? 2U : 0U;
1475914758 algoName = OidFromId((word32)algoOID, (word32)type, &algoSz);
1476014759 if (algoName == NULL) {
1476114760 WOLFSSL_MSG("Unknown Algorithm");
@@ -18634,7 +18633,7 @@ static int DecodeSubtree(const byte* input, word32 sz, Base_entry** head,
1863418633 }
1863518634
1863618635 /* Get type, LSB 4-bits */
18637- bType = (b & ASN_TYPE_MASK);
18636+ bType = (byte)( b & ASN_TYPE_MASK);
1863818637
1863918638 if (bType == ASN_DNS_TYPE || bType == ASN_RFC822_TYPE ||
1864018639 bType == ASN_DIR_TYPE) {
@@ -21988,7 +21987,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
2198821987
2198921988 if (decrementMaxPathLen && cert->ca->maxPathLen > 0) {
2199021989 WOLFSSL_MSG("\tmaxPathLen status: reduce by 1");
21991- cert->maxPathLen = cert->ca->maxPathLen - 1;
21990+ cert->maxPathLen = (byte)( cert->ca->maxPathLen - 1) ;
2199221991 if (verify != NO_VERIFY && type != CA_TYPE &&
2199321992 type != TRUSTED_PEER_TYPE) {
2199421993 WOLFSSL_MSG("\tmaxPathLen status: OK");
@@ -22006,7 +22005,7 @@ int ParseCertRelative(DecodedCert* cert, int type, int verify, void* cm)
2200622005 } else if (cert->ca && cert->isCA) {
2200722006 /* case where cert->pathLength extension is not set */
2200822007 if (cert->ca->maxPathLen > 0) {
22009- cert->maxPathLen = cert->ca->maxPathLen - 1;
22008+ cert->maxPathLen = (byte)( cert->ca->maxPathLen - 1) ;
2201022009 } else {
2201122010 cert->maxPathLen = 0;
2201222011 if (verify != NO_VERIFY && type != CA_TYPE &&
@@ -31240,15 +31239,15 @@ int StoreECC_DSA_Sig_Bin(byte* out, word32* outLen, const byte* r, word32 rLen,
3124031239 idx = SetSequence(rLen+rAddLeadZero + sLen+sAddLeadZero + headerSz, out);
3124131240
3124231241 /* store r */
31243- ret = SetASNInt((int)rLen, rAddLeadZero ? 0x80 : 0x00 , &out[idx]);
31242+ ret = SetASNInt((int)rLen, (byte)( rAddLeadZero ? 0x80U : 0x00U) , &out[idx]);
3124431243 if (ret < 0)
3124531244 return ret;
3124631245 idx += (word32)ret;
3124731246 XMEMCPY(&out[idx], r, rLen);
3124831247 idx += rLen;
3124931248
3125031249 /* store s */
31251- ret = SetASNInt((int)sLen, sAddLeadZero ? 0x80 : 0x00 , &out[idx]);
31250+ ret = SetASNInt((int)sLen, (byte)( sAddLeadZero ? 0x80U : 0x00U) , &out[idx]);
3125231251 if (ret < 0)
3125331252 return ret;
3125431253 idx += (word32)ret;
0 commit comments