ADVTOOLS / ADVTrustStore

ADVTrustStore is a simple management script to import/list/remove CA certificates to the iOS simulator. It is working for iOS 5 and iOS 6.
355 stars 71 forks source link

ADVTrustStore python script - Fails due to premature end of input #13

Closed Urmil-Ally closed 4 years ago

Urmil-Ally commented 4 years ago

I am facing issues while using the iosCertTrustManager.py. Two actually.

Python: 3.7.2

  1. the script fails to run as-is with the syntax error.

File "./iosCertTrustManager-original.py", line 70 raise Error, 'Encoder not initialized. Call start() first.' ^ SyntaxError: invalid syntax

which is suppose is due to Python version mismatch. I was able to get it to work by adding () to the raise and print functions. raise Error ('Encoder not initialized. Call start() first.')

  1. I am not so sure as to why would it ready different lengths for the same PEM file. I really need help with this one.
Import certificate?  [y/N] y
Importing to /Users/Urmil/Library/Developer/CoreSimulator/Devices/78EE1B1A-A51C-4013-BA06-AE185638686A/data/Library/Keychains/TrustStore.sqlite3
Traceback (most recent call last):
  File "iosCertTrustManager.py", line 758, in <module>
    program.run()
  File "iosCertTrustManager.py", line 747, in run
    self.import_to_simulator(args.certificate_file, args.truststore)
  File "iosCertTrustManager.py", line 658, in import_to_simulator
    tstore.add_certificate(cert)
  File "iosCertTrustManager.py", line 484, in add_certificate
    self._add_record(certificate.get_fingerprint(), certificate.get_subject_ASN1(), 
  File "iosCertTrustManager.py", line 392, in get_subject_ASN1
    decoder.enter()
  File "iosCertTrustManager.py", line 245, in enter
    bytes = self._read_bytes(length)
  File "iosCertTrustManager.py", line 315, in _read_bytes
    raise Error ( 'Premature end of input.' )
__main__.Error: Premature end of input.

Thank you in advance.

andrivet commented 4 years ago

ADVTrustStore is written for python 2.7, not 3.x

Urmil-Ally commented 4 years ago

Thank you. This works perfectly with Py 2.7 but as mentioned by others, it does not automatically trust the cert on install.

Version: 13.3, 13.5 etc. Xcode: 11.5 (if it matters)

andrivet commented 4 years ago

it does not automatically trust the cert on install.

This is a different issue. I have no plan to fix it.