Commit 8ee2020
authored
fix(ldap): [OCISDEV-1031] restore pinned-CA-only trust for LDAP TLS (#674)
tlsConfigFromLDAPConn's CA-cert branch built its RootCAs pool from
x509.SystemCertPool() plus the configured CA, so configuring a CA
cert also trusted every system-level CA instead of just the pinned
one — a trust-scope widening versus the pre-pool graph service
behavior (x509.NewCertPool()). It also ignored AppendCertsFromPEM's
return value, silently falling back to an unrestricted trust store
on a malformed/empty CA file instead of failing initialization.
Use x509.NewCertPool() and fail when the PEM contains no valid
certificates, matching the behavior callers relied on before this
helper was introduced in #658.
Flagged during review of owncloud/ocis#12660.
Signed-off-by: Lukas Hirt <info@hirt.cz>1 parent c38fd3b commit 8ee2020
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
0 commit comments