/* tlsv1_set_dhparams - Set Diffie-Hellman parameters @cred: TLSv1 credentials from tlsv1_cred_alloc() @dh_file: File or reference name for the DH params in PEM or DER format @dh_blob: DH params as inlined data or NULL if not used @dh_blob_len: dh_blob length Returns: 0 on success, -1 on failure  */
int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file, const u8 *dh_blob, size_t dh_blob_len)
/* tlsv1_set_dhparams - Set Diffie-Hellman parameters @cred: TLSv1 credentials from tlsv1_cred_alloc() @dh_file: File or reference name for the DH params in PEM or DER format @dh_blob: DH params as inlined data or NULL if not used @dh_blob_len: dh_blob length Returns: 0 on success, -1 on failure  */
int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file, const u8 *dh_blob, size_t dh_blob_len)
{
	if (dh_blob)
		return tlsv1_set_dhparams_blob(cred, dh_blob, dh_blob_len);
	if (dh_file) {
		u8 *buf = NULL;
		size_t len;
		int ret;
		if (buf == NULL) {
			wpa_printf(MSG_INFO, "TLSv1: Failed to read '%s'",
				   dh_file);
			return -1;
		}
		ret = tlsv1_set_dhparams_blob(cred, buf, len);
		os_free(buf);
		return ret;
	}
	return 0;
}