Implement checksum verification as recommended in RFC1071.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>