Branch: Tag:

2014-02-20

2014-02-20 19:34:01 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Standards.ASN1.Types: Fixed DER for sets.

The sort order in Set was reversed, which broke some verification code.

656:    constant tag = 17;    constant type_name = "SET";    -  int(-1..1) compare_octet_strings(string r, string s) { +  int(-1..1) compare_octet_strings(string r, string s) +  { +  if (r == s) return 0; +     for(int i = 0;; i++) {    if (i == sizeof(r)) -  return (i = sizeof(s)) ? 0 : 1; +  return (i = sizeof(s)) ? 0 : -1;    if (i == sizeof(s)) -  return -1; -  if (r[i] < s[i]) +     return 1; -  else if (r[i] > s[i]) +  if (r[i] < s[i])    return -1; -  +  else if (r[i] > s[i]) +  return 1;    }    }