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.

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.
ERRR
Authentication failed, temporary error.

The flag byte in the version 2 protocol output contains the authentication success code. If authentication succeeded, the code byte will be 0. If the credentials are accepted by this module, but are not valid, the code will be 100 (permanent authentication failure). Any other code indicates a temporary error. The list of facts will follow the flag byte only if authentication succeeded. Example (all numbers are hexadecimal):

000000 00 01 08 75 73 65 72 6e  61 6d 65 02 05 31 32 33  ...usern ame..123
000010 34 35 03 05 32 33 34 35  36 04 09 54 65 73 74 20  45..2345 6..Test 
000020 55 73 65 72 05 0a 2f 68  6f 6d 65 2f 75 73 65 72  User../h ome/user
000030 08 03 35 30 30 08 05 32  33 34 35 36 08 03 31 30  ..500..2 3456..10
000040 30 0e 09 6c 6f 63 61 6c  68 6f 73 74 0f 12 2f 68  0..local host../h
000050 6f 6d 65 2f 75 73 65 72  2f 4d 61 69 6c 64 69 72  ome/user /Maildir
000060 00                                                .