Skip to content

Commit

Permalink
More free_pass() for TPMv1 passwords
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
dwmw2 committed Dec 21, 2018
1 parent c8df16b commit 442f911
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gnutls_tpm.c
Expand Up @@ -184,7 +184,7 @@ int load_tpm1_key(struct openconnect_info *vpninfo, gnutls_datum_t *fdata,
goto out_srkpol;
}

free(pass);
free_pass(&pass);

/* ... we get it here instead. */
err = Tspi_Context_LoadKeyByBlob(vpninfo->tpm1->tpm_context, vpninfo->tpm1->srk,
Expand Down Expand Up @@ -244,7 +244,7 @@ int load_tpm1_key(struct openconnect_info *vpninfo, gnutls_datum_t *fdata,
err = Tspi_Policy_SetSecret(vpninfo->tpm1->tpm_key_policy,
TSS_SECRET_MODE_PLAIN,
strlen(pass), (void *)pass);
free(pass);
free_pass(&pass);

if (err) {
vpn_progress(vpninfo, PRG_ERR,
Expand Down
3 changes: 1 addition & 2 deletions openssl.c
Expand Up @@ -616,8 +616,7 @@ static int load_tpm_certificate(struct openconnect_info *vpninfo,
_("Failed to set TPM SRK password\n"));
openconnect_report_ssl_errors(vpninfo);
}
vpninfo->cert_password = NULL;
free(vpninfo->cert_password);
free_pass(&vpninfo->cert_password);
}

/* Provide our own UI method to handle the PIN callback. */
Expand Down

0 comments on commit 442f911

Please sign in to comment.