ADVTOOLS/ADVTrustStore

Handling new simulators (iOS 14.5 and maybe some other versions ?)

Toldy opened this issue · 1 comments

Toldy commented

Hi,

It looks like the path of the sqlite3 file has moved for the recent simulators.
We had: trustStorePath = "/data/Library/Keychains/TrustStore.sqlite3"

This directory doesn't exist for my new simulator:

➜  ~ tree -f /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/ | grep sqlite3
│   │   │   ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/Library/MobileContainerManager/containers.sqlite3
│   │   │   ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/Library/MobileContainerManager/containers.sqlite3-wal
│   │               ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/pinningrules.sqlite3
│   │               │   ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/private/TrustStore.sqlite3
│   │               │   ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/private/ocspcache.sqlite3
│   │               │   ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/private/ocspcache.sqlite3-shm
│   │               │   └── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/private/ocspcache.sqlite3-wal
│   │               ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/valid.sqlite3
│   │               ├── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/valid.sqlite3-shm
│   │               └── /Users/jcolin/Library/Developer/CoreSimulator/Devices/80EBA33F-4B23-4AAC-A6AC-F72C5BABF656/data/private/var/protected/trustd/valid.sqlite3-wal

Maybe the new value should be /data/private/var/protected/trustd/private/TrustStore.sqlite3 ?

I tried my new path and then got this error:

c.execute('INSERT INTO tsettings (sha1, subj, tset, data) VALUES (?, ?, ?, ?)', [sqlite3.Binary(sha1), sqlite3.Binary(subj), sqlite3.Binary(tset), sqlite3.Binary(data)])
sqlite3.OperationalError: table tsettings has no column named sha1

Indeed, we now have a sha256 column in the sqlite3 file instead of sha1...
image

Do you plan any modifications ?

Thanks a lot,

Julien.

I submitted a pull request that fixes this issue