Cleanup of DerBuffer duplication that was using memcpy still after refractor and should be direct pointer copy.

This commit is contained in:
David Garske
2016-06-23 18:14:22 -07:00
parent 746ae2f4e5
commit b0f7d819bd

View File

@@ -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 {