mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
shift instead of multiply and add comment
This commit is contained in:
@@ -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),
|
||||||
|
@@ -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
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user