Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoded exception_trace cannot be decoded. #17

Closed
rthideaway opened this issue Jan 23, 2018 · 3 comments
Closed

Encoded exception_trace cannot be decoded. #17

rthideaway opened this issue Jan 23, 2018 · 3 comments
Assignees

Comments

@rthideaway
Copy link

rthideaway commented Jan 23, 2018

During base64 encoding of exception_trace you are actually encoding SHA-1 hash of serialized data, not serialized data. The critical line is: logs_http/logs_http.module:60

Where code is doing:

$return['exception_trace'] = Crypt::hashBase64(serialize($exception->getTrace()));

Crypt::hashBase64 is encoding SHA1 hash of given input:

  public static function hashBase64($data) {
    $hash = base64_encode(hash('sha256', $data, TRUE));
    // Modify the hash so it's safe to use in URLs.
    return str_replace(['+', '/', '='], ['-', '_', ''], $hash);
  }

So there is no way to get data back.

@rthideaway
Copy link
Author

rthideaway commented Jan 23, 2018

I guess you only want to:

$return['exception_trace'] = base64_encode(serialize($exception->getTrace()));

Link to patch

@rthideaway
Copy link
Author

PR: #19

@amitaibu
Copy link
Member

#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants