PVS Server: Check CERT:STATUS:... of client #3618
Open
+929
−267
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In secure PVAccess, the certificate management service (PVACMS) issues certificates with a CERT:STATUS:... PV extension. PVACMS serves these CERT:STATUS:... PVs for each certificate that it created to provide updates on the certificate status.
This is most important for PVA servers. At face value, a client certificate may be valid for a long time (year?), but PVACMS allows administrators to revoke a certificate at any time. The secure socket (SSL, TLS) implementation in the JRE checks the certificate once at connection time, while the CERT:STATUS:.. allows continued verification for the duration of the TCP/TLS connection. The CERT:STATUS:.. PV will right away tell the PVA server on an IOC when a client certificate has been revoked. The IOC can then reconsider the authentication of the user, for example consider the user 'anonymous' and appropriately restrict write access because the certificate no longer provides authentication.
As the Java implementation of the PVA server can now be used with PVAiFY, this PR adds CERT:STATUS:... monitoring to the java PVA server. For now there is no meaningful authorization implemented, but writable PVs become read-only unless the CERT:STATUS:.. PV indicates a valid cert. Revoking a certificate will right away turn the client into a read-only state.
As an implementation detail, the CERT:STATUS:.. PV contains a recent OCSP response which allows the recipient to securely validate the certificate. The JDK, however, does not offer API to check OCSP responses. The BouncyCastle dependency was thus added to parse and check OCSP responses.
Checklist
Easy manual test:
First, install PVXS as described in https://george-mcintyre.github.io/pvxs/spvaqstart.html
Terminal 1: Start fresh PVACMS
Terminal 2: Handle certificates
Terminal 3: Run server
Terminal 4: Run client
Now, back in Terminal 2, revoke the client certificate:
Note how the PV becomes read-only in CSS, and the pvaclient shows
a corresponding
Received 'demo3' CID 2 access rights read-only (0x00)