Add AuthzClientCryptoProvider for authorization client cryptographic operations#8
Conversation
…tory closes #33831 Signed-off-by: mposolda <mposolda@gmail.com>
Codoki PR ReviewSummary: Initialize crypto with safe classloader, ensure provider discovery Issues (Critical & High only)
Showing top 2 issues. Critical: 0, High: 2. See inline suggestions for more. Key Feedback (click to expand)
Confidence: 3/5 — Needs work before merge (2 high · status: Requires changes) React with 👍 or 👎 if you found this review useful. |
| throw new IOException("corrupted stream - negative length found"); | ||
| } | ||
|
|
||
| if (length >= limit) // after all we must have read at least 1 byte |
There was a problem hiding this comment.
| if (length >= limit) // after all we must have read at least 1 byte | |
| if (length > (limit - count)) { | |
| throw new IOException("corrupted stream - out of bounds length found"); | |
| } |
| @Override | ||
| public Provider getBouncyCastleProvider() { | ||
| try { | ||
| return KeyStore.getInstance(KeyStore.getDefaultType()).getProvider(); |
There was a problem hiding this comment.
🔷 Medium: getBouncyCastleProvider should return a BC provider when present; returning the default KeyStore provider is misleading and can break callers that expect BC-specific capabilities. Prefer returning the BC provider if available, falling back to the default only when BC is not installed.
| @@ -91,6 +92,7 @@ public static AuthzClient create(InputStream configStream) throws RuntimeExcepti | |||
| * @return a new instance | |||
| */ | |||
| public static AuthzClient create(Configuration configuration) { | |||
There was a problem hiding this comment.
| public static AuthzClient create(Configuration configuration) { | |
| ClassLoader cl = Thread.currentThread().getContextClassLoader(); | |
| CryptoIntegration.init(cl != null ? cl : AuthzClient.class.getClassLoader()); |
No description provided.