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

Key not matching cert (iOS 7) #159

Open
GoogleCodeExporter opened this issue Apr 25, 2016 · 0 comments
Open

Key not matching cert (iOS 7) #159

GoogleCodeExporter opened this issue Apr 25, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Hi Jean, thanks for all your hard work :)

I am using your pre-compiled patch posted on 9/4 
(https://code.google.com/p/iphone-dataprotection/issues/detail?id=122#c21)

What steps will reproduce the problem?
1. Using iOS 7.1.2: ./keychain_dump
2. Examine cert.plist - certificate in question IS proper and matches the 
expected serial number/thumbprint
3. Examine keys.plist - using the corresponding key does NOT correspond 
properly to the cert.plist entry. It is the wrong private key, simply does not 
work. The length and structure look good (normal RSA/x509 structure in PEM 
format, starts with "MIIEowI..." and is 1500+ characters in length) to the 
naked eye but attempting to actually use the certificate results in errors.

What is the expected output? What do you see instead?

Running `openssl x509 -noout -text -inform pem -in cert.pem` on the certificate 
outputs information on the certificate as expected including public key, 
modulus, etc. 

However, running `openssl rsa -noout -text -inform der -in key.pem` on the 
private key from keys.plist results in a string of errors:

unable to load Private Key
2108:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\as
n1\tasn_dec.c:1319:
2108:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 e
rror:.\crypto\asn1\tasn_dec.c:659:
2108:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\as
n1\tasn_dec.c:1319:
2108:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\
crypto\asn1\tasn_dec.c:381:Type=RSA
2108:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:.\crypto\rsa\rsa_am
eth.c:115:
2108:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\as
n1\tasn_dec.c:1319:
2108:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:.\
crypto\asn1\tasn_dec.c:381:Type=PKCS8_PRIV_KEY_INFO



Original issue reported on code.google.com by [email protected] on 12 Mar 2015 at 3:26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant