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

dod_certs_to_mobileconfig NoneType error #1

Closed
pittjl opened this issue Nov 15, 2023 · 3 comments
Closed

dod_certs_to_mobileconfig NoneType error #1

pittjl opened this issue Nov 15, 2023 · 3 comments

Comments

@pittjl
Copy link

pittjl commented Nov 15, 2023

I know this was last updated a few years ago, but I tried it out today and got an error. This is using python 3.11. I am able to curl the zip file without issue.

dod_certs_mobileconfig % python3 dod_certs_to_mobileconfig.py
Attempting to get .zip file from https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/unclass-certificates_pkcs7_DoD.zip
Traceback (most recent call last):
File "/Users/jlp/code/dodcerts/macos/dod_certs_mobileconfig/dod_certs_to_mobileconfig.py", line 254, in
main()
File "/Users/jlp/code/dodcerts/macos/dod_certs_mobileconfig/dod_certs_to_mobileconfig.py", line 210, in main
pem_bundle_file, pem_title = find_p7b_file(tempdir)
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object

brodjieski added a commit that referenced this issue Nov 15, 2023
Looks like they changed how they are bundling their
certificates. Indead of PEM, they are using DER.

Issue #1
@brodjieski
Copy link
Owner

@pittjl Give it a try now. Had to make some adjustments for it to work with latest DOD bundle.

@pittjl
Copy link
Author

pittjl commented Nov 15, 2023

Now a NoneType error in a different location.

Attempting to get .zip file from https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/unclass-certificates_pkcs7_DoD.zip
Traceback (most recent call last):
File "/Users/jlp/code/dodcerts/macos/dod_certs_mobileconfig/./dod_certs_to_mobileconfig.py", line 254, in
main()
File "/Users/jlp/code/dodcerts/macos/dod_certs_mobileconfig/./dod_certs_to_mobileconfig.py", line 246, in main
newPayload.addPayloadFromPEM(certData)
File "/Users/jlp/code/dodcerts/macos/dod_certs_mobileconfig/./dod_certs_to_mobileconfig.py", line 108, in addPayloadFromPEM
name = name_regex.search(pemfile).group(2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

@brodjieski
Copy link
Owner

I believe this issue has been resolved... ran the script today and it generated profile.

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

2 participants