Friedrich Delgado Friedrichs <[email protected]> writes: > I did that, and re-tried the gnutls-cli line, with a different result: > > ,---- > Processed 3 CA certificate(s). > Processed 3 client certificates... > Processed 3 client X.509 certificates... > Resolving 'intern.organisation.org'... > Connecting to 'NNN.NNN.NN.NNN:443'... > *** Fatal error: Key usage violation in certificate has been detected. > *** Handshake has failed > GNUTLS ERROR: Key usage violation in certificate has been detected. > `---- > > Looks like I can reproduce the problem with gnutls-cli.
Now it becomes interesting! Try adding '--print-cert --verbose' to print the cert chain returned by the server. Does the server cert have the 'Digital signature' and 'Key encipherment' key usage bits? It could be as simple as the key usage extension is not marked critical. I'll see if I create a self-test of that setup, to see if it is rejected or not. >> > Or can I convert the pkcs12 file with gnutls, in case there's some >> > problem with the converted file from openssl? >> Try 'certtool --p12-info' > > certtool -d 4711 --inraw --p12-info --infile organisation-user.p12 > > actually seems to work, however if I to use the result, I get > the following output with the gnutls-cli command: > > ,---- > Processed 3 client certificates... > *** Error loading key file: Base64 unexpected header error. > `---- You need to separate the key from the certificates after decoding the PKCS#12 structure. >> The bits looks fine (both digital signature and key encipherment), >> although the Key Usage extension itself SHOULD be marked critical >> according to the specifications. > >> Maybe the problem is with the key usage bits in some other certificate >> in the chain. Can you post the same info for the other certs too? > ---Zitatende--- > > Ok, all the certificates in the CA chain have the following usage bits: > > Certificate signing. > CRL signing. > > in particular Do they have the CA=true flag? > > ,---- > > certtool -i < organisation-user-ca.pem|grep -A 2 -i 'key usage' > Key Usage (not critical): > Certificate signing. > CRL signing. > -- > Key Usage (not critical): > Certificate signing. > CRL signing. > -- > Key Usage (critical): > Certificate signing. > CRL signing. > -- > Key Usage (critical): > Certificate signing. > CRL signing. > -- > Key Usage (critical): > Certificate signing. > CRL signing. > -- > Key Usage (not critical): > Certificate signing. > CRL signing. > -- > Key Usage (critical): > Certificate signing. > CRL signing. > -- > Key Usage (not critical): > Certificate signing. > CRL signing. > `---- > > I don't know if it is remarkable that some have "critical" and some > "not critical". It is certainly an error, but I'm not sure if GnuTLS actually checks the critical flag for key usage extensions, there are (as you see) simply too many key usage extensions with non-critical flag. And as far as I can see, it is not a significant concern since support for key usage bits is fairly critical today. So any implementation that doesn't support it is likely to have other problems too, so adding a critical flag to that extension is not likely to improve that particular system much. We should have a self-test about this though. Maybe we already do -- I'll check the "chainverify" self-test. > Ok, this goes bit beyond my knowledge now, if you have any particular > questions about the pki involved here, that can't be resolved with > command line tools, I'd have to ask a colleague about this. I *think* > I picked the right server CA certificate to check, I'm sure the CA > chain from my client certificate is the one I use. What is also interesting is the server's certificate, and its chain. That is printed by the gnutls-cli --print-cert --verbose command above. /Simon -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

