memcpy(cert.protocolMinorVersion, protocolMinorVersion, sizeof(protocolMinorVersion));
memcpy(cert.signedData.resolverPK, pubK, sizeof(cert.signedData.resolverPK));
memcpy(cert.signedData.clientMagic, pubK, sizeof(cert.signedData.clientMagic));
- cert.signedData.serial = serial;
+ cert.signedData.serial = htonl(serial);
cert.signedData.tsStart = htonl((uint32_t) begin);
cert.signedData.tsEnd = htonl((uint32_t) end);
public:
uint32_t getSerial() const
{
- return signedData.serial;
+ return ntohl(signedData.serial);
}
uint32_t getTSStart() const
{
resolverPK = orig[0:32]
clientMagic = orig[32:40]
- serial = struct.unpack_from("I", orig[40:44])[0]
+ serial = struct.unpack_from("!I", orig[40:44])[0]
validFrom = struct.unpack_from("!I", orig[44:48])[0]
validUntil = struct.unpack_from("!I", orig[48:52])[0]
return DNSCryptResolverCertificate(serial, validFrom, validUntil, resolverPK, clientMagic)