private static short[] checkNameType(short[] nameTypesSeen, short nameType) { /* * RFC 6066 3. The ServerNameList MUST NOT contain more than one name of the same * name_type. */ if (!NameType.isValid(nameType) || Arrays.contains(nameTypesSeen, nameType)) { return null; } return Arrays.append(nameTypesSeen, nameType); } }
public static byte[] createSupportedPointFormatsExtension(short[] ecPointFormats) throws IOException { if (ecPointFormats == null || !Arrays.contains(ecPointFormats, ECPointFormat.uncompressed)) { /* * RFC 4492 5.1. If the Supported Point Formats Extension is indeed sent, it MUST * contain the value 0 (uncompressed) as one of the items in the list of point formats. */ // NOTE: We add it at the end (lowest preference) ecPointFormats = Arrays.append(ecPointFormats, ECPointFormat.uncompressed); } return TlsUtils.encodeUint8ArrayWithUint8Length(ecPointFormats); }
public static byte[] createSupportedPointFormatsExtension(short[] ecPointFormats) throws IOException { if (ecPointFormats == null || !Arrays.contains(ecPointFormats, ECPointFormat.uncompressed)) { /* * RFC 4492 5.1. If the Supported Point Formats Extension is indeed sent, it MUST * contain the value 0 (uncompressed) as one of the items in the list of point formats. */ // NOTE: We add it at the end (lowest preference) ecPointFormats = Arrays.append(ecPointFormats, ECPointFormat.uncompressed); } return TlsUtils.encodeUint8ArrayWithUint8Length(ecPointFormats); }
private static short[] checkNameType(short[] nameTypesSeen, short nameType) { /* * RFC 6066 3. The ServerNameList MUST NOT contain more than one name of the same * name_type. */ if (!NameType.isValid(nameType) || Arrays.contains(nameTypesSeen, nameType)) { return null; } return Arrays.append(nameTypesSeen, nameType); } }