Ticket #46596: patch-null-absent.diff

File patch-null-absent.diff, 783 bytes (added by mouse07410 (Mouse), 10 years ago)

Updated patch for signature algorithm mismatch and ASN.1 type comparison bug.

  • crypto/asn1/a_type.c

    old new  
    117117        {
    118118        int result = -1;
    119119
     120        if (!a && !b) return 0; /* both null-pointers => both absent/equal */
     121
    120122        if (!a || !b || a->type != b->type) return -1;
    121123
    122124        switch (a->type)
  • crypto/asn1/x_algor.c

    old new  
    151151                return rv;
    152152        if (!a->parameter && !b->parameter)
    153153                return 0;
     154        if ((!a->parameter && b->parameter
     155             && b->parameter->type == V_ASN1_NULL)
     156            ||
     157            (!b->parameter && a->parameter
     158             && a->parameter->type == V_ASN1_NULL)
     159            )
     160          return 0;
    154161        return ASN1_TYPE_cmp(a->parameter, b->parameter);
    155162        }