Building a enveloped message with the 'enc.c' program, I see the call
PKCS7_add_recipient(p7,sk_X509_value(recips, i))
for every recipient.

The source code of PKCS7_add_recipient does:

  1. a call to
  2. 
    
    PKCS7_RECIP_INFO_set(ri,x509)
    that does:
    p7i->cert=x509
  3. a call to
  4. PKCS7_add_recipient_info(p7,ri)
    that pushes ri into the stack of p7
So, I conclude that the call to PKCS7_add_recipient adds a copy of the certificate of the destination. And using gdb I have verified it.
But, when the program 'enc' finishes, the generated pkcs7 object does not contain this certificates, only the issuer_and_serial.
In fact, this is what I expected before reading the code.
Can someone explain what happens?
-- 
        Manuel Mollar Villanueva
        Prof TEU depto informatica, UJI
        http://moon.act.uji.es
        mailto:[EMAIL PROTECTED]
        telf 964 72 8355
 

Reply via email to