Merge pull request #411 from fedepell/fix_cert_copy

tls: fix order of operations to copy peer certificate
pull/413/head
Michael Zillgith 3 years ago committed by GitHub
commit 4b5db538fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -189,8 +189,8 @@ verifyCertificate (void* parameter, mbedtls_x509_crt *crt, int certificate_depth
self->peerCert = (uint8_t*) GLOBAL_MALLOC(crt->raw.len);
if (self->peerCert) {
memcpy(self->peerCert, crt->raw.p, self->peerCertLength);
self->peerCertLength = (int)crt->raw.len;
memcpy(self->peerCert, crt->raw.p, self->peerCertLength);
}
}

Loading…
Cancel
Save