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

TypeError: Strings must be encoded before hashing #59

Closed
zhouchenh opened this issue Apr 28, 2022 · 1 comment · Fixed by #60
Closed

TypeError: Strings must be encoded before hashing #59

zhouchenh opened this issue Apr 28, 2022 · 1 comment · Fixed by #60

Comments

@zhouchenh
Copy link
Contributor

I was trying to list all entries in the accessibility database with sudo tccutil -l. However, I got the following error.

# tccutil -l
/usr/local/bin/tccutil:30: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
osx_version = version(mac_ver()[0]) # mac_ver() returns 10.16 for Big Sur instead 11.+
Error opening Database. You probably need to disable SIP for this to work.

The SIP has been turned off.

# csrutil status
System Integrity Protection status: disabled.

@zhouchenh
Copy link
Contributor Author

zhouchenh commented Apr 28, 2022

Commented out the except TypeError: part and got this:

Traceback (most recent call last):
  File "./tccutil", line 354, in <module>
    main()
  File "./tccutil", line 334, in main
    list_clients()
  File "./tccutil", line 205, in list_clients
    open_database()
  File "./tccutil", line 134, in open_database
    accessTableDigest = digest_check(c.execute("SELECT sql FROM sqlite_master WHERE name='access' and type='table'"))
  File "./tccutil", line 109, in digest_check
    accessTableDigest = hashlib.sha1(row[0]).hexdigest()[0:10]
TypeError: Strings must be encoded before hashing

@zhouchenh zhouchenh changed the title Error Opening Database When SIP Is Off TypeError: Strings must be encoded before hashing Apr 28, 2022
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

Successfully merging a pull request may close this issue.

1 participant