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

Periodically reload verify cert store (stable) #1186

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

bbockelm
Copy link
Contributor

This is a backport of #1183 (plus some #ifdef's so it can compile on SL6).

This uses a per-SSL-object certificate store (shared via ref counts) in order to provide verification functions. A helper task periodically loads a fresh copy of the cert store.

This triggers a reload of the cert store used for chain building
and certificate verification (CRLs) once an hour.
Also add a few comments about the usage.
Copy link
Member

@abh3 abh3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the version check, it looks good.

// so we simply rely on the global one in SSL_CTX. The latter
// doesn't refresh the verify store, which causes issues with some
// plugins.
#if OPENSSL_VERSION_NUMBER >= 0x010100000L
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so fast, the test should be '>' not '>=' because OpenSSL 1.01 does not have the set1 functions. I know from your comment that you did compile it on SL6 but that only worked because someone must have upgraded their OpenSSL (which of course they should have). Unfortunately, lots of sites use RH6 out of the box and it comes with 1.0.1e-fips and it definitely won't compile! I think all of teh test should change and hen you'll be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this?

OPENSSL_VERSION_NUMBER >= 0x010100000L should test for 1.1.0 or later. That is, it only enables this code if you are at least on 1.1.0 -- that should exclude any variant of RHEL6.

(FWIW - the OpenSSL RPM I tested against was openssl-1.0.1e-58.el6_10.x86_64)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it is intentional, but it will also exclude any variant of RHEL7, as e.g. both Centos7 and CC7 have openssl 1.0.2k. From what I see SSL_set1_verify_cert_store & SSL_set1_chain_cert_store are available in OpenSSL 1.0.2 (see e.g. https://github.com/openssl/openssl/blob/OpenSSL_1_0_2k/ssl/ssl.h). If we would like to include RHEL7 we should test for OPENSSL_VERSION_NUMBER >= 0x10002000L.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh - sorry, I haven't been able to sit down and get to this in the last two days (which have each had >6hrs of Zoom meetings...). You're right, this is too strict.

// Initialize a store for use on individual SSL objects and schedule
// a periodic update. These separate stores are only usable on versions
// of OpenSSL 1.1.0 or later.
#if OPENSSL_VERSION_NUMBER >= 0x010100000L
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@simonmichal simonmichal merged commit 26a1ba9 into xrootd:stable-4.12.x Apr 30, 2020
@abh3
Copy link
Member

abh3 commented Apr 30, 2020 via email

@simonmichal
Copy link
Contributor

Already done: 5c73add

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

Successfully merging this pull request may close these issues.

None yet

3 participants