-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
bugA defect in the libraryA defect in the libraryprotocolRelating to the protocol layerRelating to the protocol layer
Description
Bug Report
With the acceptance of SDL 0317, this library's implementation of security queries does not match the spec fully. Several issues exist with the current implementation such as:
- When a security query is received from Core, its header is entirely ignored and the library assumes that it is a
Send Handshake Datarequest. This causes issues if Core were to send another type of query, such as aSend Internal Errornotification.
System.arraycopy(msg.getData(), 12, data, 0, iLen);
byte[] dataToRead = new byte[4096];
Integer iNumBytes = sdlSecurity.runHandshake(data, dataToRead);- Hardcoded values are used when sending security queries for fields such as query ID. In addition, some values are not explicitly set at all, such as query type and sequential number. Any predefined values should be properly added as constants.
protocolMessage.setFunctionID(0x01);should be changed to something like
securityQuery.setQueryID(QueryID.SEND_HANDSHAKE_DATA);
securityQuery.setQueryType(QueryType.RESPONSE);
securityQuery.setSequenceNumber(msg.getSequenceNumber());- Security queries are constructed using an RPC header, which has a slightly different format than a security query header. Security query headers should be implemented separate from RPC headers.
ProtocolMessage protocolMessage = new ProtocolMessage();
...
sendMessage(protocolMessage);should be changed to something like
SecurityQuery securityQuery = new SecurityQuery();
...
sendMessage(securityQuery);OS & Version Information
- Android Version: N/A
- SDL Android Version: master
- Testing Against: N/A
Metadata
Metadata
Assignees
Labels
bugA defect in the libraryA defect in the libraryprotocolRelating to the protocol layerRelating to the protocol layer