// crypto info
out_uint16_le(s, SEC_TAG_SRV_CRYPT);
out_uint16_le(s, 84 + sizeof(cacert) + sizeof(server_cert)); // length
- out_uint32_le(s, 8); // 128-bit
+ out_uint32_le(s, 1); // 128-bit
out_uint32_le(s, 2); // medium
out_uint32_le(s, SEC_RANDOM_SIZE); // random_len
// this is a good time to load our private key :-)
{
unsigned char *buf = (unsigned char *)malloc(1024);
- unsigned char *ptr = buf;
+ const unsigned char *ptr = buf;
memcpy(buf, private_key, sizeof(private_key));
privkey = d2i_RSAPrivateKey(NULL, &ptr, sizeof(private_key));
free(buf);
+
+ printf("Loaded private key (%u bytes)\n", sizeof(private_key));
}
}