Branch: Tag:

2014-05-20

2014-05-20 10:08:45 by Martin Nilsson <nilsson@opera.com>

Have list of acceptable hash-signature-pairs in context.

91:   string(8bit) get_signature_algorithms()   {    ADT.struct sign_algs = ADT.struct(); -  foreach(sort(indices(HASH_lookup)), int h) { -  sign_algs->put_uint(h, 1); -  sign_algs->put_uint(SIGNATURE_rsa, 1); -  sign_algs->put_uint(h, 1); -  sign_algs->put_uint(SIGNATURE_dsa, 1); - #if constant(Crypto.ECC.Curve) -  // NB: MD5 is not supported with ECDSA signatures. -  if (h != HASH_md5) { -  sign_algs->put_uint(h, 1); -  sign_algs->put_uint(SIGNATURE_ecdsa, 1); +  foreach(context->signature_algorithms, [int hash, int sign]) +  { +  sign_algs->put_uint(hash, 1); +  sign_algs->put_uint(sign, 1);    } - #endif -  } +     return sign_algs->pop_data();   }