68 #ifdef HAVE_WTLS_OPENSSL 79 void destroy_octstr(
Octstr * data);
80 void destroy_octstr16(
Octstr * data);
81 void destroy_octstr_fixed(
Octstr * data);
85 void destroy_rsa_secret(
RSASecret * secret);
88 void dump_void16(
char *dbg,
int level,
int i);
105 charpos =
pack_int16(data, charpos, (i & 0xFFFF0000) >> 16);
106 charpos =
pack_int16(data, charpos, i & 0xFFFF);
155 switch (ecparams->
field) {
165 switch (ecparams->
basis) {
210 switch (public_key_algo) {
345 for (i = 0; i <
gwlist_len(ciphersuites); i++) {
357 List * compmethod_list)
366 for (i = 0; i <
gwlist_len(compmethod_list); i++) {
401 switch (signature_algo) {
550 switch (ecparams->
field) {
560 switch (ecparams->
basis) {
606 switch (public_key_algo) {
727 for (i = 0; i < array_length; i++) {
746 endpos = *charpos + gwlist_length;
749 while (*charpos < endpos) {
771 for (i = 0; i < gwlist_length; i += 2) {
785 List *compmethod_list;
798 for (i = 0; i < gwlist_length; i++) {
804 return compmethod_list;
844 switch (signature_algo) {
903 void destroy_octstr(
Octstr * data)
908 void destroy_octstr16(
Octstr * data)
913 void destroy_octstr_fixed(
Octstr * data)
926 destroy_octstr16(dhparams->
dh_p);
927 destroy_octstr16(dhparams->
dh_g);
934 switch (ecparams->
field) {
939 switch (ecparams->
basis) {
967 switch (public_key_algo) {
1015 void destroy_rsa_secret(
RSASecret * secret)
1062 for (i = 0; i <
gwlist_len(ciphersuites); i++) {
1074 for (i = 0; i <
gwlist_len(compmethod_list); i++) {
1079 gw_free(compmethod_list);
1105 switch (signature_algo) {
1137 void dump_void16(
char *dbg,
int level,
int i)
1139 debug(dbg, 0,
"%*s16 bit Int: %d", level,
"", i);
1142 void dump_int32(
char *dbg,
int level,
long i)
1144 debug(dbg, 0,
"%*s32 bit Int: %ld", level,
"", i);
1164 debug(dbg, 0,
"%*sRandom :", level,
"");
1165 debug(dbg, 0,
"%*sGMT Unix Time: %ld", level + 1,
"",
1167 debug(dbg, 0,
"%*sRandom Bytes:", level + 1,
"");
1173 debug(dbg, 0,
"%*sDH Parameters :", level,
"");
1174 debug(dbg, 0,
"%*sdh_e: %d", level + 1,
"", dhparams->
dh_e);
1175 debug(dbg, 0,
"%*sdh_p:", level + 1,
"");
1177 debug(dbg, 0,
"%*sdh_g:", level + 1,
"");
1183 debug(dbg, 0,
"%*sEC Parameters :", level,
"");
1185 debug(dbg, 0,
"%*sField: %d", level + 1,
"", ecparams->
field);
1186 switch (ecparams->
field) {
1188 debug(dbg, 0,
"%*sprime_p :", level + 1,
"");
1193 debug(dbg, 0,
"%*sM: %d", level + 1,
"", ecparams->
m);
1195 debug(dbg, 0,
"%*sBasis: %d", level + 1,
"", ecparams->
basis);
1196 switch (ecparams->
basis) {
1200 debug(dbg, 0,
"%*sK: %d", level + 1,
"", ecparams->
k);
1203 debug(dbg, 0,
"%*sk1: %d", level + 1,
"", ecparams->
k1);
1204 debug(dbg, 0,
"%*sk2: %d", level + 1,
"", ecparams->
k2);
1205 debug(dbg, 0,
"%*sk3: %d", level + 1,
"", ecparams->
k3);
1208 debug(dbg, 0,
"%*sirreducible: 0x%p", level + 1,
"",
1216 debug(dbg, 0,
"%*sEC Curve: 0x%p", level + 1,
"", ecparams->
curve);
1217 debug(dbg, 0,
"%*sa: 0x%p", level + 2,
"", ecparams->
curve->
a);
1219 debug(dbg, 0,
"%*sb: 0x%p", level + 2,
"", ecparams->
curve->
b);
1221 debug(dbg, 0,
"%*sseed: 0x%p", level + 2,
"", ecparams->
curve->
seed);
1224 debug(dbg, 0,
"%*spoint: 0x%p", level + 2,
"", ecparams->
base->
point);
1227 debug(dbg, 0,
"%*sorder: 0x%p", level + 2,
"", ecparams->
order);
1229 debug(dbg, 0,
"%*scofactor: 0x%p", level + 2,
"", ecparams->
cofactor);
1235 debug(dbg, 0,
"%*sParameterSpecifier:", level,
"");
1237 debug(dbg, 0,
"%*sParameter Index: %d", level + 1,
"",
1241 debug(dbg, 0,
"%*sLength: %ld", level + 1,
"",
1243 switch (public_key_algo) {
1263 debug(dbg, 0,
"%*sPublicKey: 0x%p", level,
"",
1265 debug(dbg, 0,
"%*sECDH Point: 0x%p", level + 1,
"",
1270 debug(dbg, 0,
"%*sECDSA Point: 0x%p", level + 1,
"",
1282 debug(dbg, 0,
"%*sRSA Public Key: 0x%p", level,
"", key);
1283 debug(dbg, 0,
"%*sRSA Exponent: 0x%p", level + 1,
"",
1292 debug(dbg, 0,
"%*sEC Public Key: 0x%p", level,
"", key);
1293 debug(dbg, 0,
"%*sPoint: 0x%p", level + 1,
"", key->
point);
1299 debug(dbg, 0,
"%*sDH Public Key: 0x%p", level,
"", key->
dh_Y);
1305 debug(dbg, 0,
"%*sRSA Secret: 0x%p", level,
"", secret);
1306 debug(dbg, 0,
"%*sClient Version: %d", level + 1,
"",
1308 debug(dbg, 0,
"%*sRandom: 0x%p", level,
"", secret->
random);
1315 debug(dbg, 0,
"%*sRSA Encrypted Secret: %p", level,
"",
1322 debug(dbg, 0,
"%*sKey Exchange Id: 0x%p", level,
"", keyexid);
1323 debug(dbg, 0,
"%*sKey Exch Suite: %d", level + 1,
"",
1337 debug(dbg, 0,
"%*sElement %d", level,
"", i);
1347 debug(dbg, 0,
"%*sKey List: 0x%p", level,
"", key_list);
1361 debug(dbg, 0,
"%*sCipherSuite List: 0x%p", level,
"", ciphersuites);
1364 for (i = 0; i <
gwlist_len(ciphersuites); i++) {
1366 debug(dbg, 0,
"%*sBulk Cipher Algo: %d", level,
"",
1376 debug(dbg, 0,
"%*sCompression Method List: 0x%p", level,
"",
1379 for (i = 0; i <
gwlist_len(compmethod_list); i++) {
1380 debug(dbg, 0,
"%*sMethod %d: %d", level,
"", i,
1387 debug(dbg, 0,
"%*sIdentifier: 0x%p", level,
"", ident);
1388 debug(dbg, 0,
"%*sIdent type: %d", level + 1,
"", ident->
id_type);
1391 debug(dbg, 0,
"%*sCharset: %d", level + 1,
"", ident->
charset);
1392 debug(dbg, 0,
"%*sNamet: %s", level + 1,
"",
1396 debug(dbg, 0,
"%*sIdentifier: 0x%p", level + 1,
"",
1401 debug(dbg, 0,
"%*sKey Hash: 0x%p", level + 1,
"",
1406 debug(dbg, 0,
"%*sDistinguished Name: 0x%p", level + 1,
"",
1417 debug(dbg, 0,
"%*sSignature: 0x%p", level,
"", sig);
1418 switch (signature_algo) {
1431 debug(dbg, 0,
"%*sWTLS Certificate: 0x%p", level,
"", cert);
1434 debug(dbg, 0,
"%*sCertificate Version: %d", level + 1,
"",
1437 debug(dbg, 0,
"%*sSignature Algo: %d", level + 1,
"",
1440 debug(dbg, 0,
"%*sID Type: %d", level + 1,
"",
1445 debug(dbg, 0,
"%*sValid not Before: %ld", level + 1,
"",
1447 debug(dbg, 0,
"%*sValid not After: %ld", level + 1,
"",
1452 debug(dbg, 0,
"%*sPublic Key Type: %d", level + 1,
"",
void destroy_compression_method_list(List *compmethod_list)
void dump_compression_method_list(char *dbg, int level, List *compmethod_list)
enum pubkey_algo PublicKeyAlgorithm
void dump_rsa_pubkey(char *dbg, int level, RSAPublicKey *key)
SignatureAlgorithm signature_algo
PublicKey * unpack_public_key(Octstr *data, long *charpos, PublicKeyType key_type)
void gwlist_append(List *list, void *item)
int pack_dhparams(Octstr *data, long charpos, DHParameters *dhparams)
ECPublicKey * ecdsa_pubkey
void dump_key_exchange_id(char *dbg, int level, KeyExchangeId *keyexid)
long gwlist_len(List *list)
PublicKeyType pubkey_type
ToBeSignedCertificate * tobesigned_cert
void * gwlist_get(List *list, long pos)
int pack_dh_pubkey(Octstr *data, long charpos, DHPublicKey *key)
ECPublicKey * unpack_ec_pubkey(Octstr *data, long *charpos)
void octstr_append_char(Octstr *ostr, int ch)
WTLSCertificate * unpack_wtls_certificate(Octstr *data, long *charpos)
int pack_octstr16(Octstr *data, long charpos, Octstr *opaque)
int pack_key_list(Octstr *data, long charpos, List *key_list)
ParameterSpecifier * param_specif
Octstr * distinguished_name
List * unpack_compression_method_list(Octstr *data, long *charpos)
int pack_ecparams(Octstr *data, long charpos, ECParameters *ecparams)
Octstr * unpack_octstr16(Octstr *data, long *charpos)
void destroy_ec_pubkey(ECPublicKey *key)
int pack_public_key(Octstr *data, long charpos, PublicKey *key, PublicKeyType key_type)
int pack_random(Octstr *data, long charpos, Random *random)
int pack_int16(Octstr *data, long charpos, int i)
#define octstr_get_cstr(ostr)
void dump_ec_pubkey(char *dbg, int level, ECPublicKey *key)
#define octstr_copy(ostr, from, len)
int pack_rsa_pubkey(Octstr *data, long charpos, RSAPublicKey *key)
void dump_signature(char *dbg, int level, Signature *sig)
void dump_public_key(char *dbg, int level, PublicKey *key, PublicKeyType key_type)
void dump_octstr16(char *dbg, int level, Octstr *opaque)
int pack_wtls_certificate(Octstr *data, long charpos, WTLSCertificate *cert)
void dump_octstr_fixed(char *dbg, int level, Octstr *opaque)
Signature * unpack_signature(Octstr *data, long *charpos)
long unpack_int32(Octstr *data, long *charpos)
void destroy_rsa_encrypted_secret(RSAEncryptedSecret *secret)
void destroy_param_spec(ParameterSpecifier *pspec)
void octstr_insert(Octstr *ostr1, const Octstr *ostr2, long pos)
void dump_dhparams(char *dbg, int level, DHParameters *dhparams)
ParameterSpecifier * unpack_param_spec(Octstr *data, long *charpos)
int pack_array(Octstr *data, long charpos, List *array)
void dump_array(char *dbg, int level, List *array)
void dump_dh_pubkey(char *dbg, int level, DHPublicKey *key)
int pack_identifier(Octstr *data, long charpos, Identifier *ident)
void dump_random(char *dbg, int level, Random *random)
int pack_ciphersuite_list(Octstr *data, long charpos, List *ciphersuites)
void dump_wtls_certificate(char *dbg, int level, WTLSCertificate *cert)
void destroy_array(List *array)
int pack_rsa_secret(Octstr *data, long charpos, RSASecret *secret)
void dump_int32(char *dbg, int level, long i)
ECParameters * unpack_ecparams(Octstr *data, long *charpos)
#define octstr_dump(ostr, level,...)
int pack_signature(Octstr *data, long charpos, Signature *sig)
int unpack_int16(Octstr *data, long *charpos)
Random * unpack_random(Octstr *data, long *charpos)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
DHParameters * unpack_dhparams(Octstr *data, long *charpos)
enum sig_algo SignatureAlgorithm
Octstr * unpack_octstr(Octstr *data, long *charpos)
void dump_key_list(char *dbg, int level, List *key_list)
void dump_param_spec(char *dbg, int level, ParameterSpecifier *pspec)
List * unpack_key_list(Octstr *data, long *charpos)
ParameterSpecifier * param_spec
void dump_ecparams(char *dbg, int level, ECParameters *ecparams)
void destroy_identifier(Identifier *ident)
RSAPublicKey * rsa_pubkey
void destroy_dh_pubkey(DHPublicKey *key)
KeyExchangeId * unpack_key_exchange_id(Octstr *data, long *charpos)
RSAEncryptedSecret * unpack_rsa_encrypted_secret(Octstr *data, long *charpos)
int pack_rsa_encrypted_secret(Octstr *data, long charpos, RSAEncryptedSecret *secret)
long octstr_len(const Octstr *ostr)
void dump_octstr(char *dbg, int level, Octstr *opaque)
int pack_compression_method_list(Octstr *data, long charpos, List *compmethod_list)
void destroy_key_list(List *key_list)
DHPublicKey * unpack_dh_pubkey(Octstr *data, long *charpos)
void debug(const char *place, int err, const char *fmt,...)
int pack_octstr_fixed(Octstr *data, long charpos, Octstr *opaque)
ECPublicKey * ecdh_pubkey
void destroy_rsa_pubkey(RSAPublicKey *key)
void dump_identifier(char *dbg, int level, Identifier *ident)
void dump_rsa_encrypted_secret(char *dbg, int level, RSAEncryptedSecret *secret)
List * unpack_array(Octstr *data, long *charpos)
List * unpack_ciphersuite_list(Octstr *data, long *charpos)
void destroy_random(Random *random)
void destroy_wtls_certificate(WTLSCertificate *cert)
int pack_int32(Octstr *data, long charpos, long i)
int pack_octstr(Octstr *data, long charpos, Octstr *opaque)
Identifier * unpack_identifier(Octstr *data, long *charpos)
int pack_param_spec(Octstr *data, long charpos, ParameterSpecifier *pspec)
RSAPublicKey * unpack_rsa_pubkey(Octstr *data, long *charpos)
enum compmethod CompressionMethod
int pack_key_exchange_id(Octstr *data, long charpos, KeyExchangeId *keyexid)
int octstr_get_char(const Octstr *ostr, long pos)
void octstr_set_char(Octstr *ostr, long pos, int ch)
Octstr * unpack_octstr_fixed(Octstr *data, long *charpos, long length)
void dump_rsa_secret(char *dbg, int level, RSASecret *secret)
int pack_ec_pubkey(Octstr *data, long charpos, ECPublicKey *key)
enum public_key_type PublicKeyType
void dump_ciphersuite_list(char *dbg, int level, List *ciphersuites)
RSASecret * unpack_rsa_secret(Octstr *data, long *charpos)
Octstr * encrypted_secret
void destroy_ciphersuite_list(List *ciphersuites)
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)