mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Cleanup of DerBuffer duplication that was using memcpy still after refractor and should be direct pointer copy.
This commit is contained in:
@@ -3874,7 +3874,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der));
|
ssl->buffers.certificate = der;
|
||||||
#ifdef KEEP_OUR_CERT
|
#ifdef KEEP_OUR_CERT
|
||||||
ssl->keepCert = 1; /* hold cert for ssl lifetime */
|
ssl->keepCert = 1; /* hold cert for ssl lifetime */
|
||||||
#endif
|
#endif
|
||||||
@@ -3889,7 +3889,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
|
|||||||
ctx->ourCert = NULL;
|
ctx->ourCert = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
XMEMCPY(&ctx->certificate, &der, sizeof(der));
|
ctx->certificate = der;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type == PRIVATEKEY_TYPE) {
|
else if (type == PRIVATEKEY_TYPE) {
|
||||||
@@ -3898,12 +3898,12 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
|
|||||||
if (ssl->buffers.weOwnKey) {
|
if (ssl->buffers.weOwnKey) {
|
||||||
FreeDer(&ssl->buffers.key);
|
FreeDer(&ssl->buffers.key);
|
||||||
}
|
}
|
||||||
XMEMCPY(&ssl->buffers.key, &der, sizeof(der));
|
ssl->buffers.key = der;
|
||||||
ssl->buffers.weOwnKey = 1;
|
ssl->buffers.weOwnKey = 1;
|
||||||
}
|
}
|
||||||
else if (ctx) {
|
else if (ctx) {
|
||||||
FreeDer(&ctx->privateKey);
|
FreeDer(&ctx->privateKey);
|
||||||
XMEMCPY(&ctx->privateKey, &der, sizeof(der));
|
ctx->privateKey = der;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user