CVM

CVM Protocol

CVM Version 2 Protocol

Input to and output from the module follows the same format: a four byte protocol identifier (always "CVM2"), a four byte packet type identifier, eight bytes of random data (to help prevent spoofing of UDP responses), followed by a series of tagged strings, and completed with a single NUL byte. The total size of either the input and output must not exceed 512 bytes. The random data in the response is copied exactly from the request.

A tagged string consists of a tag byte, a length byte, and that many bytes of data. The tag byte identifies what credential (in the input request) or what fact (in the output response) is represented by the string.

Input

The packet type identifier in the input (request) packet is "REQ2". Example (all numbers are hexadecimal):

0000000: 4356 4d32 5245 5132 0102 0304 0506 0708  CVM2REQ2........
0000010: 0108 7573 6572 6e61 6d65 0209 6c6f 6361  ..username..loca
0000020: 6c68 6f73 7403 0870 6173 7377 6f72 6400  lhost..password.

Output

The following types of response packets are possible:

SUCC
Authentication succeeded, and the packet contains a list of facts.
FAIL
Authentication rejected, permanent error. The credentials were accepted by this module, but are not valid. The facts may include an error code number and a message.
EBAD
Authentication failed, permanent error. The credentials were not accepted by this module.
ETMP
Authentication failed, temporary error.

Example (all numbers are hexadecimal):

0000000: 4356 4d32 5355 4343 0102 0304 0506 0708  CVM2SUCC........
0000010: 0108 7573 6572 6e61 6d65 0205 3132 3334  ..username..1234
0000020: 3503 0532 3334 3536 00                   5..23456.