-
Notifications
You must be signed in to change notification settings - Fork 59
Certificate analysis #28
Comments
@Br1oP do you think this could be (at least partially) be done for 0.1.0? |
I will try to look into the Ring library to see if we can use it to parse the certificates with it and eliminate the OpenSSL dependency. I don't think I will have anything for 0.1.0. |
If Ring is not useful, we could try to implement our own PKCS 7 module. |
What is "certificate analysis"? My guess is that it might be useful to start with https://github.com/briansmith/webpki (based on ring) and/or https://github.com/ctz/webpki-roots (derived from Mozilla's certificate store). |
I think I understand better now. Checkout https://github.com/google/nogotofail, which is probably doing something similar to what you're trying to do. |
Hi Brian, thanks for commenting! Our process of "certificate analysis" is the process of reading and analyzing the certificate(s) included in the Android application. For this, we are using OpenSSL, more specifically the command "openssl pkcs7 -inform DER -in filename -noout -print_certs -text". At the moment the analysis process consists mainly in three steps:
We do not want to have a dependency to OpenSSL since that makes the program less portable, we want to use either an existing Rust library or implement our own parser for this. I will look into the libraries that you posted ASAP. Don't hesitate to contact if you have more insight on the matter :). |
Hi. |
@briansmith can we use webpki to read PKSC#7 information? |
webpki doesn't support CMS (PKCS#7) stuff, it is just for validating certificate chains. It doesn't contain a parser for certificates in CMS format, primarily because CMS that's not a very good format for storing root certificates. (Though it seems many things use it for that.) It also doesn't support the concept of expired roots, currently. |
@briansmith So we would need to create our own parser? Do you know of any other way? |
Are you sure it's PKCS#7 and not another format like PKCS#12 or plain PEM or DER certificates that you need to support? Could you send me an example file?: brian@briansmith.org |
@briansmith an example would be this: The output we get when running the command
We would like to get those fingerprints and if the certificate is self-signed. Can that be done with webpki? For the info I think it would be a DER certificate. |
Yes, that is PKCS#7. I am surprised that Android apps are using that format. Anyway, currently there is no support for CMS parsing in webpki. Obviously, a big part of that is actually the X.509 certificate, so the amount of parsing to unwrap it is probably not much. |
Currently certificate analysis is only done by an OpenSSL dependency and the certificate is not correctly analyzed. We should probably do our own native analysis and get some output in the report.
The idea behind this is replacing the OpenSSL dependency, can it be done with ring? or with our own PKSC#7 parser?
The text was updated successfully, but these errors were encountered: