protected boolean supportsClientECCCapabilities(int[] namedCurves, short[] ecPointFormats) { // NOTE: BC supports all the current set of point formats so we don't check them here if (namedCurves == null) { /* * RFC 4492 4. A client that proposes ECC cipher suites may choose not to include these * extensions. In this case, the server is free to choose any one of the elliptic curves * or point formats [...]. */ return TlsECCUtils.hasAnySupportedNamedCurves(); } for (int i = 0; i < namedCurves.length; ++i) { int namedCurve = namedCurves[i]; if (NamedCurve.isValid(namedCurve) && (!NamedCurve.refersToASpecificNamedCurve(namedCurve) || TlsECCUtils.isSupportedNamedCurve(namedCurve))) { return true; } } return false; }
public static void writeNamedECParameters(int namedCurve, OutputStream output) throws IOException { if (!NamedCurve.refersToASpecificNamedCurve(namedCurve)) { /* * RFC 4492 5.4. All those values of NamedCurve are allowed that refer to a specific * curve. Values of NamedCurve that indicate support for a class of explicitly defined * curves are not allowed here [...]. */ throw new TlsFatalAlert(AlertDescription.internal_error); } TlsUtils.writeUint8(ECCurveType.named_curve, output); TlsUtils.checkUint16(namedCurve); TlsUtils.writeUint16(namedCurve, output); } }
if (NamedCurve.isValid(entry) && isSupportedNamedCurve(entry))
public static void writeNamedECParameters(int namedCurve, OutputStream output) throws IOException { if (!NamedCurve.refersToASpecificNamedCurve(namedCurve)) { /* * RFC 4492 5.4. All those values of NamedCurve are allowed that refer to a specific * curve. Values of NamedCurve that indicate support for a class of explicitly defined * curves are not allowed here [...]. */ throw new TlsFatalAlert(AlertDescription.internal_error); } TlsUtils.writeUint8(ECCurveType.named_curve, output); TlsUtils.checkUint16(namedCurve); TlsUtils.writeUint16(namedCurve, output); } }
if (NamedCurve.isValid(entry) && isSupportedNamedCurve(entry))
protected boolean supportsClientECCCapabilities(int[] namedCurves, short[] ecPointFormats) { // NOTE: BC supports all the current set of point formats so we don't check them here if (namedCurves == null) { /* * RFC 4492 4. A client that proposes ECC cipher suites may choose not to include these * extensions. In this case, the server is free to choose any one of the elliptic curves * or point formats [...]. */ return TlsECCUtils.hasAnySupportedNamedCurves(); } for (int i = 0; i < namedCurves.length; ++i) { int namedCurve = namedCurves[i]; if (NamedCurve.isValid(namedCurve) && (!NamedCurve.refersToASpecificNamedCurve(namedCurve) || TlsECCUtils.isSupportedNamedCurve(namedCurve))) { return true; } } return false; }
if (!NamedCurve.refersToASpecificNamedCurve(namedCurve))
if (!NamedCurve.refersToASpecificNamedCurve(namedCurve))