Re: nss -- xmlSecNssX509StoreVerify question

Aleksey Sanin <[email protected]> Thu, 8 Dec 2016 13:26:27 -0800
Newsgroups gmane.text.xml.xmlsec
Message-ID <[email protected]>
Could you please confirm that xmlsec-nss gets the key from the
certificate and not from another place?

I am not very familiar with this code unfortunately. It might
have happen that the NSS API changed since xmlsec-nss was
written :)

Aleksey

On 12/8/16 1:06 PM, Miklos Vajna wrote:
> Hi,
> 
> Context: currently we patch xmlsec in LibreOffice with
> <https://cgit.freedesktop.org/libreoffice/core/tree/external/libxmlsec/xmlsec1-noverify.patch.1>,
> and I'm trying to find out if it would be possible to avoid that patch.
> As far as I understand, using the
> XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS flag makes this possible
> when calling xmlSecDSigCtxVerify(), but I wanted to first see
> xmlSecDSigCtxVerify() failing without using that flag (when the above
> patch is not applied).
> 
> However, for some reason xmlSecDSigCtxVerify() doesn't fail with my test
> "self-signed" certificate (when the NSS DB doesn't contain the
> root/intermediate CA), even when I'm not using that flag. Reading
> xmlSecNssX509StoreVerify(), it seems that it calls NSS
> CERT_VerifyCertificate() with requiredUsages=0:
> 
> https://github.com/lsh123/xmlsec/blob/master/src/nss/x509vfy.c#L217
> 
> And when that happens, CERT_VerifyCertificate() just iterates over the
> usages of the certificicate, and on each iteration it returns
> ("continues") early, as "i & requiredUsages" is false. The result is
> that later functions like cert_CheckLeafTrust() and
> cert_VerifyCertChain() are not called:
> 
> https://dxr.mozilla.org/mozilla-central/source/security/nss/lib/certhigh/certvfy.c#1220
> 
> Now the question: is this expected? I'm not sure if this is a bug in
> xmlsec or I generate my self-signed certificate in an incorrect way.
> 
> FWIW, here is my script to generate 1) a root CA 2) an intermediate CA
> and 3) an actual certificate:
> 
> https://cgit.freedesktop.org/libreoffice/core/tree/xmlsecurity/qa/create-certs/create-certs.sh
> 
> Thanks,
> 
> Miklos
> 
> 
> 
> _______________________________________________
> xmlsec mailing list
> [email protected]
> http://www.aleksey.com/mailman/listinfo/xmlsec
>

_______________________________________________
xmlsec mailing list
[email protected]
http://www.aleksey.com/mailman/listinfo/xmlsec
signature.asc (application/pgp-signature, 842 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJYSdAHAAoJEEEbi2vACtCgCVQP/3XYJIPGneV701kHhMUGXEH1
JWV2I6/YE4CvHbQGocQFciwW4Gf53Olw63mGPWDAL+tSq2vI5Se1WC+lEUjJCat7
sMkKiTbgI8E/bKGHaJzwYh3HiloZKR2eou+1z5oquWR9bmxOWQ/ZgWQnCjqw14pr
KW+ZduknSwaOKhxV6Re/I0CX1giZSN1G+pNurB0qOGhF1edl026ThexTjmkvj254
7k6HuoPyBPDa/xjBDl1+QVldoMCH1Thba1zYPt89VSoEyOCFw189qRVSgXab5uWi
APCqLQ0R5th1ksoUf69iju8QikDggTV0LlbGXsPYF5nYCNFNQC7kP0UmNOW8M6P1
vo1kEZdqgxHnzAZzlup/kAhJrG4/AhQcbqoUSJuWeTnBe7XswAYGIYJMn+KQrdC1
am7Nqaqcvg+PNLxRNkUyi06DNk0PbWtZjz/NCt833gNaTVxMWfu4DIohp2OBGeud
lzxtFm5VoQ537uvbM0qHd3f4gUEEbODrQn2YZuYW5tLbzEjzwEP24lxaCZNvt0qi
zwzfnnnLQPh89OT9y4BMI44GSq7EtwpoRKvvovfjI83kpUSr0M+0gQdZfAVOGBav
dosjp6n64WC7SmgSeRJ8LkBMc/o4iLRDjz37B2gtB5QJ44kE8rC/A8RJjwJ1p5G8
ESdYY/vfMtqy3sbL3/I+
=wJvX
-----END PGP SIGNATURE-----