[pgjdbc/pgjdbc] d281a7: Add cert key type checking to chooseClientAlias (#...

From: Nick Burgan <noreply(at)github(dot)com>
To: pgsql-jdbc(at)lists(dot)postgresql(dot)org
Subject: [pgjdbc/pgjdbc] d281a7: Add cert key type checking to chooseClientAlias (#...
Date: 2022-01-24 18:39:29
Message-ID: pgjdbc/pgjdbc/push/refs/heads/master/3d6093-d281a7@github.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Branch: refs/heads/master
Home: https://github.com/pgjdbc/pgjdbc
Commit: d281a788b227b73e5a5236a10f3e5f5e73d011e7
https://github.com/pgjdbc/pgjdbc/commit/d281a788b227b73e5a5236a10f3e5f5e73d011e7
Author: Nick Burgan <13688219+nmburgan(at)users(dot)noreply(dot)github(dot)com>
Date: 2022-01-24 (Mon, 24 Jan 2022)

Changed paths:
M pgjdbc/src/main/java/org/postgresql/ssl/LazyKeyManager.java
M pgjdbc/src/main/java/org/postgresql/ssl/PKCS12KeyManager.java
M pgjdbc/src/test/java/org/postgresql/test/ssl/LazyKeyManagerTest.java
M pgjdbc/src/test/java/org/postgresql/test/ssl/PKCS12KeyTest.java

Log Message:
-----------
Add cert key type checking to chooseClientAlias (#2417)

Previously, these functions ignored the keyType (or 'strings') argument to the chooseClientAlias function. Some libraries (e.g. Bouncy Castle) expect that when chooseClientAlias is called and key types are passed in, that it will return null if the cert doesn't use one of the given key types. For example, if ['EC'] was passed in for keyType and the cert contained an RSA key, since this would return 'user' rather than null in that case, it would cause Bouncy Castle to assume using an ECDSA signing algorithm was okay, and cause problems during the Certificate Verify part of the handshake.

This modifies these functions to only return 'user' if keyType is passed in and the cert contains a key of that type. If keyType is empty or null, it will ignore this and continue to check only the issuer.

Browse pgsql-jdbc by date

  From Date Subject
Next Message Sehrope Sarkuni 2022-01-25 17:12:37 [pgjdbc/pgjdbc] 90e53c: test: Disable no-arg callable statement tests in s...
Previous Message Zuzana Miklankova 2022-01-21 13:29:42 [pgjdbc/pgjdbc] 3d6093: docs: add info about convenience maven project (#2...