Fix comparison in DER set-value sorting
@@ -472,8 +472,8 @@ private static boolean lessThanOrEqual(byte[] a, byte[] b)
* primitive form accordingly. Failing to ignore the CONSTRUCTED bit could therefore lead to
* ordering inversions.
*/
- int a0 = a[0] & ~BERTags.CONSTRUCTED;
- int b0 = b[0] & ~BERTags.CONSTRUCTED;
+ int a0 = a[0] & ~BERTags.CONSTRUCTED & 0xFF;
+ int b0 = b[0] & ~BERTags.CONSTRUCTED & 0xFF;
if (a0 != b0)
{
return a0 < b0;
