Re: libcrypto: stop some ASN.1 bleeding

2014-05-15 Thread Miod Vallat
As promised, here is a new diff. Bob Beck suggested introducing wrappers to the time-related functions, so that the error path becomes easier to understand; this makes the diff to these functions much simpler indeed. Index: a_gentm.c

Re: libcrypto: stop some ASN.1 bleeding

2014-05-15 Thread Brendan MacDonell
Miod Vallat m...@online.fr writes: As promised, here is a new diff. Bob Beck suggested introducing wrappers to the time-related functions, so that the error path becomes easier to understand; this makes the diff to these functions much simpler indeed. That's helpful. It definitely makes it

Re: libcrypto: stop some ASN.1 bleeding

2014-05-15 Thread Miod Vallat
Index: a_time.c +ASN1_GENERALIZEDTIME * +ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out) +{ + ASN1_GENERALIZEDTIME *tmp = NULL, *ret; + + if (!out || !*out) { + if (!(tmp = ASN1_GENERALIZEDTIME_new())) + return NULL; +

Re: libcrypto: stop some ASN.1 bleeding

2014-05-15 Thread Brendan MacDonell
OK, the latest diff looks good to me.

libcrypto: stop some ASN.1 bleeding

2014-05-14 Thread Miod Vallat
... or, in other words, try to fix most memory leak upon failure. This kind of change is difficult to test, the more eyes reviewing it, the better. Miod Index: a_gentm.c === RCS file: /cvs/src/lib/libssl/src/crypto/asn1/a_gentm.c,v

Re: libcrypto: stop some ASN.1 bleeding

2014-05-14 Thread macdonellba
Miod Vallat m...@online.fr writes: ... or, in other words, try to fix most memory leak upon failure. This kind of change is difficult to test, the more eyes reviewing it, the better. Well, I'll try to take a stab at it then. Miod Index: a_gentm.c

Re: libcrypto: stop some ASN.1 bleeding

2014-05-14 Thread Miod Vallat
... or, in other words, try to fix most memory leak upon failure. This kind of change is difficult to test, the more eyes reviewing it, the better. Well, I'll try to take a stab at it then. You might be able to use ASN1_STRING_set(ret, NULL, len) to handle resizing / allocating the