Files
mars-tinyldap/fmt_tls_packet.c
2015-05-07 23:53:05 +00:00

14 lines
280 B
C

#include "tinytls.h"
#include "uint16.h"
size_t fmt_tls_packet(char* dest,enum contenttype ct, size_t len) {
if (len>0xffff) return 0;
if (dest) {
dest[0]=ct;
dest[1]=0x03; dest[2]=0x03; // version: TLS 1.2
dest[3]=len>>8;
dest[4]=len&0xff;
}
return 5;
}