-
Notifications
You must be signed in to change notification settings - Fork 12
Missing 8-byte hashes for SSL certificates #3
Comments
For whatever reason it seems yocto is disabling the c_rehash calls: We need to figure out why, and if we should drop that patch in our builds. |
Also, i don't seem to have the hash files on my fedora machine... |
This seems to be related: |
Hmm, seems like c_rehash is not included in our builds because we don't have perl in PACKAGECONFIG. We should add that and see what else changes that causes. |
Right, on Fedora the situation is completely different, no hashes there. When I run my test script it will look at /etc/crypto-policies/back-ends/openssl.config and then at /etc/pki/tls/cert.pem which is part of the ca-certificates (The Mozilla CA root certificate bundle) package. |
Where would such an addition go? I looked around the repository and that is not clear at all to me, probably because my understanding of the Yocto project is fairly limited / non-existent, but still... |
I think it goes in: Probably as PACKAGECONFIG_append = " perl" or something. |
@alexlarsson Shouldn't |
So, fun stuff: this commit in oe-core may help fix the issue. |
Oh. Perl is in the sdk, just not set in the packageconfig |
JFTR, I'm devoting some time to this now, still in the phase of building the runtime locally, though, so that I can actually test whatever fix I'll be proposing. Btw, I had some trouble so far because it was a bit difficult to figure out what the right way to build the runtime, and after some unsuccessful attempts (with different chroots, compilers and such) it seems that the best way to do it according to @alexlarsson is to build the runtime from inside the SDK itself, but again the steps to do that were not clear, so I'm sharing what I'm doing here in case I'm not yet in the right patch (still building as we speak):
@alexlarsson I think it would be nice if this steps (plus anything else that I might have missed) were documented somewhere, and I guess a README or a HACKING file checked in this repo would be a good place for it. It would certainly have saved me some time and headaches, what do you say? |
"make sandboxed" is supposed to be enough, and it works for me. How did it fail for you? |
I don't have
I'm a bit confused, maybe is a misunderstanding from my side, but I'd appreciate some clarification. |
Weird! I'll look into it. |
Thanks. I'm running flatpak and flatpak-builder 0.8.3 right from the Debian Testing repos in that machine, by the way. Let me know if there's any specific test / experiment you want me to help with. |
So, build-finish tries to look for the app, and files/sh in the runtime is a symlink to /bin/bash, which is resolved on the host when build-finish is looking for the result. I think the easiest fix is just to use /usr/bin/bash |
sh is a symlink to /bin which flatpak build-finish will resolve on the host side, which fails as described in: #3 Lets just use bash directly to avoid this
As @erikos found out when we upgraded to flatpak 0.8.2 in Endless, the freedesktop runtime is not installing 8-byte hashes under /etc/ssl/certs, which are used by OpenSSL to look up the certificates, as per http://www.gagravarr.org/writing/openssl-certs/others.shtml. This is a problem because it makes it impossible for flatpak-builder to download sources for modules using the
https://
protocol, which forced us to put this workaround in place for now: endlessm/gnome-weather@5f01b2aWe initially were a bit confused because this used to work on previous versions of flatpak (up to 0.8.1), but it seems the difference is this commit, as before that point flatpak would bind mount the host's /etc/ssl/certs contents too, and then the 8-byte hash files would be available inside the sandbox.
Investigating a bit how this files are generated in debian, it seems like those hashes are created by a
c_rehash
tool that comes with the openssl package, which gets called fromupdate-ca-certicates
(from the ca-certificates package)... which is then executed on the debian/postinst script of the ca-certificates package:To test this theory, I manually removed all the hashes from my /etc/ssl/certs directory, and then re-run sudo update-ca-certificates --fresh -v manually... and all the hashes were generated again.
So, at this point it seems like the right solution to this problem would be to somehow do something similar to what Debian does at the time of creating the runtime, and generate those 8-byte hashes files inside /etc/ssl/certs, so that they are available inside the sandbox now that flatpak does not mount the hosts's certs directory.
What I'm not that certain of is how exactly that should be achieved so, while I'm happy to work on this if needed, I could use some guidance to at least know where to touch the right things.
The text was updated successfully, but these errors were encountered: