Skip to content

Bug: incorrect signature generation leads to "Invalid signature" with non-ASCII in names #93

Description

@slaFFik

If the customer name in HelpScout or FreeScout has special characters, like ã, ü, ö - both FreeScout and HelpScout will not display in their sidebars EDD data.

The reason is in this method: \EDD\HelpScout\Request::create_expected_signature().

json_encode() encodes non-ASCII characters, so signatures are not equal when checked later in \EDD\HelpScout\Request::signature_equals().

The fix:

	private function create_expected_signature() {
		return base64_encode( hash_hmac( 'sha1', json_encode( $this->data, JSON_UNESCAPED_UNICODE ), self::$secret_key, true ) );
	}

Note the new JSON_UNESCAPED_UNICODE.

I will submit the PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions