bc-java
bc-java copied to clipboard
ECUtil.getNamedCurveOid does not safely handle strings with space at last position
e.g.
org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil.getNamedCurveOid(" ");
is going to lead to a java.lang.StringIndexOutOfBoundsException: String index out of range: 0 due the assumption that after a ' ' char there's still another character
I've changed it to now do a trim() after the null check. Thanks for the report.
Fixed in 1.79.