pluto: Make sure connection name is null-terminated during DPD restart.

This commit is contained in:
Tobias Brunner
2011-04-19 13:48:51 +02:00
parent f36a6ebd30
commit 2653c08513
+5 -4
View File
@@ -2196,9 +2196,9 @@ static void decode_cert(struct msg_digest *md)
cert_t x509cert = cert_empty; cert_t x509cert = cert_empty;
x509cert.cert = lib->creds->create(lib->creds, x509cert.cert = lib->creds->create(lib->creds,
CRED_CERTIFICATE, CERT_X509, CRED_CERTIFICATE, CERT_X509,
BUILD_BLOB_ASN1_DER, blob, BUILD_BLOB_ASN1_DER, blob,
BUILD_END); BUILD_END);
if (x509cert.cert) if (x509cert.cert)
{ {
if (verify_x509cert(&x509cert, strict_crl_policy, &valid_until)) if (verify_x509cert(&x509cert, strict_crl_policy, &valid_until))
@@ -3824,7 +3824,7 @@ main_id_and_auth(struct msg_digest *md
case XAUTHInitRSA: case XAUTHInitRSA:
case XAUTHRespRSA: case XAUTHRespRSA:
r = check_signature(KEY_RSA, peer, st, hash, r = check_signature(KEY_RSA, peer, st, hash,
&md->chain[ISAKMP_NEXT_SIG]->pbs, &md->chain[ISAKMP_NEXT_SIG]->pbs,
#ifdef USE_KEYRR #ifdef USE_KEYRR
kc == NULL ? NULL : kc->ac.keys_from_dns, kc == NULL ? NULL : kc->ac.keys_from_dns,
#endif /* USE_KEYRR */ #endif /* USE_KEYRR */
@@ -5851,6 +5851,7 @@ dpd_timeout(struct state *st)
/* caching the connection name before deletion */ /* caching the connection name before deletion */
strncpy(cname, c->name, BUF_LEN); strncpy(cname, c->name, BUF_LEN);
cname[BUF_LEN-1] = '\0';
if (c->kind == CK_INSTANCE) if (c->kind == CK_INSTANCE)
{ {