Hi,

>From the code:
http://cvs.openssl.org/fileview?f=openssl/crypto/pkcs7/pk7_doit.c&v=1.79.2.1

Can this line be removed ?
ri=sk_PKCS7_RECIP_INFO_value(rsk,0);

The value is asked again 2 lines bottom. sk_value is only a getter,
thus it does not even change the value which could modify the
behaviour for the later code, if I am not mistaken.

void *sk_value(const _STACK *st, int i)
{
   if(!st || (i < 0) || (i >= st->num)) return NULL;
   return st->data[i];
}

Please englighten me about it and thank you in advance ! :-)

Best Regards,
Laszlo Papp

PS.: I made a mistake in the previous patch, that is why I am now
sending again. It was quite a while ago when I last used the "diff"
util and not the git formatted patch, so I changed the arguments and
it showed the deletion as an addition. I am sorry for that noise.

--- ../tmp/openssl-SNAP-20110407/crypto/pkcs7/pk7_doit.c        2010-06-12 
18:00:26.000000000 +0300
+++ crypto/pkcs7/pk7_doit.c     2011-04-07 16:12:37.250002934 +0300
@@ -1113,7 +1113,6 @@
        rsk=p7->d.signed_and_enveloped->recipientinfo;
        if (rsk == NULL)
                return NULL;
-       ri=sk_PKCS7_RECIP_INFO_value(rsk,0);
        if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return(NULL);
        ri=sk_PKCS7_RECIP_INFO_value(rsk,idx);
        return(ri->issuer_and_serial);

Reply via email to