shift instead of multiply and add comment

This commit is contained in:
Jacob Barthelmeh
2021-08-23 13:24:27 -06:00
parent 1e491993ca
commit da6e8d394f
2 changed files with 9 additions and 7 deletions

View File

@@ -6312,6 +6312,8 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx, int writeDup)
ssl->protoMsgCb = ctx->protoMsgCb; ssl->protoMsgCb = ctx->protoMsgCb;
ssl->protoMsgCtx = ctx->protoMsgCtx; ssl->protoMsgCtx = ctx->protoMsgCtx;
/* follow default behavior of setting toInfoOn similar to
* wolfSSL_set_msg_callback when the callback is set */
if (ctx->protoMsgCb != NULL) { if (ctx->protoMsgCb != NULL) {
ssl->toInfoOn = 1; ssl->toInfoOn = 1;
} }
@@ -21496,10 +21498,10 @@ int PickHashSigAlgo(WOLFSSL* ssl, const byte* hashSigAlgo, word32 hashSigAlgoSz)
if (ssl->protoMsgCb != NULL && sz > RECORD_HEADER_SZ) { if (ssl->protoMsgCb != NULL && sz > RECORD_HEADER_SZ) {
/* version from hex to dec 16 is 16^1, 256 from 16^2 and /* version from hex to dec 16 is 16^1, 256 from 16^2 and
4096 from 16^3 */ 4096 from 16^3 */
int version = (ssl->version.minor & 0X0F) + int version = (ssl->version.minor & 0x0F) +
(ssl->version.minor & 0xF0) * 16 + ((ssl->version.minor & 0xF0) << 4) +
(ssl->version.major & 0X0F) * 256 + ((ssl->version.major & 0x0F) << 8) +
(ssl->version.major & 0xF0) * 4096; ((ssl->version.major & 0xF0) << 12);
ssl->protoMsgCb(written, version, type, ssl->protoMsgCb(written, version, type,
(const void *)(data + RECORD_HEADER_SZ), (const void *)(data + RECORD_HEADER_SZ),

View File

@@ -32561,12 +32561,12 @@ static void test_wolfSSL_a2i_IPADDRESS(void)
int dataSz = 0; int dataSz = 0;
ASN1_OCTET_STRING *st; ASN1_OCTET_STRING *st;
unsigned char ipv4_exp[] = {0x7F, 0, 0, 1}; const unsigned char ipv4_exp[] = {0x7F, 0, 0, 1};
unsigned char ipv6_exp[] = { const unsigned char ipv6_exp[] = {
0x20, 0x21, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x0d, 0xb8, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0x00, 0x00, 0x42, 0x77, 0x77 0x00, 0x00, 0xff, 0x00, 0x00, 0x42, 0x77, 0x77
}; };
unsigned char ipv6_home[] = { const unsigned char ipv6_home[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01
}; };