-/* $OpenBSD: ikev2.c,v 1.331 2021/11/15 22:37:35 tobhe Exp $ */
+/* $OpenBSD: ikev2.c,v 1.332 2021/11/16 21:43:36 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
print_map(ikeauth.auth_method,
ikev2_auth_map));
ikev2_send_auth_failed(env, sa);
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (-1);
}
ikeauth.auth_method = sa->sa_peerauth.id_type;
log_debug("%s: failed to get auth data",
__func__);
ikev2_send_auth_failed(env, sa);
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (-1);
}
log_info("%s: ikev2_msg_authverify failed",
SPI_SA(sa, __func__));
ikev2_send_auth_failed(env, sa);
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (-1);
}
if (sa->sa_eapmsk != NULL) {
!sa->sa_hdr.sh_initiator)) == NULL) {
log_debug("%s: failed to get auth data",
__func__);
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (-1);
}
ibuf_release(authmsg);
if (ret != 0) {
ikev2_send_auth_failed(env, sa);
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (-1);
}
sa_state(env, sa, IKEV2_STATE_EAP_SUCCESS);
}
+ explicit_bzero(&ikeauth, sizeof(ikeauth));
return (0);
}
-/* $OpenBSD: parse.y,v 1.135 2021/10/26 17:31:22 tobhe Exp $ */
+/* $OpenBSD: parse.y,v 1.136 2021/11/16 21:43:36 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
memcpy(&$$, &$2, sizeof($$));
$$.auth_method = IKEV2_AUTH_SHARED_KEY_MIC;
$$.auth_eap = 0;
+ explicit_bzero(&$2, sizeof($2));
}
| EAP STRING {
unsigned int i;
sizeof($$.auth_data));
$$.auth_length = strlen($1);
}
- free($1);
+ freezero($1, strlen($1));
}
| FILENAME STRING {
if (parsekeyfile($2, &$$) != 0) {
pol.pol_flags = flags;
pol.pol_rdomain = rdomain;
memcpy(&pol.pol_auth, authtype, sizeof(struct iked_auth));
+ explicit_bzero(authtype, sizeof(*authtype));
if (name != NULL) {
if (strlcpy(pol.pol_name, name,