| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix JNI buffer validation and improve asymmetric key handling | 1 小时前 | |
Fix JNI buffer validation and improve asymmetric key handling | 1 小时前 | |
fix: improve RSA JCE support and native packaging 1. Add RSA X.509 / PKCS#8 encoding support RSAPublicKeyImpl and encodable RSAPrivateKeyImpl now export standard encodings so RSA keys can be used with KeyFactory, certificate generation, certificate verification, and JCE key-spec round trips. Minimal RSA private keys that do not carry a public exponent remain non-encodable and report a null format. 2. Add RSA KeyFactory support Register KeyFactory.RSA and support RSAPublicKeySpec, RSAPrivateKeySpec, RSAPrivateCrtKeySpec, X509EncodedKeySpec, and PKCS8EncodedKeySpec conversions. 3. Preserve the real RSA public exponent Propagate the public exponent through RSA signing, cipher, encoding, decoding, and key-factory paths instead of assuming 65537. Keys without a required public exponent are rejected at initialization. 4. Improve RSA signature compatibility Register SHA1withRSA and common RSA signature aliases/OIDs used by certificate verification flows. Fix RSA/PSS initialization for SHA-2 PSS algorithms so they use PSS padding rather than falling back to PKCS#1. 5. Remove unsupported SM3withRSA/PSS registration SM3withRSA remains registered. SM3withRSA/PSS is intentionally not registered because the native PSS parameter path does not support it correctly; callers should use SM3withRSA or a supported SHA-* RSA/PSS algorithm. 6. Update native build and runtime loading behavior Replace the hard-coded /root/openhitls build path. Maven now uses OPENHITLS_ROOT or -Dopenhitls.root at build time to find OpenHiTLS headers and shared libraries, copies the required native libraries into target/native, and configures tests with openhitls.native.path. At runtime, NativeLoader treats only -Dopenhitls.native.path as an explicit native directory. If it is not set, loading falls back to System.loadLibrary and then packaged META-INF/native libraries. OPENHITLS_ROOT and openhitls.root are build-time inputs, not runtime native search paths. 7. Stabilize tests Add RSA key encoding, KeyFactory, PSS, alias, and self-signed certificate verification coverage. Temporarily ignore Classic-McEliece tests because the current OpenHiTLS build can hang while generating those keys. Signed-off-by: chenqi <chenqi180@huawei.com> | 1 个月前 | |
add jce provider | 1 个月前 |