File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -294,16 +294,17 @@ ossl_cmsci_get_certificates(VALUE self)
294294/*
295295 * CMS SignerInfo is not a first class object, but part of the
296296 * CMS ContentInfo. It can be wrapped in a ruby object, but it can
297- * not be created or freed directly.
297+ * not be created or freed directly, so a reference to the CMS ContentInfo
298+ * is placed into the "cms" attribute.
298299 */
299300static VALUE
300- ossl_cmssi_new (CMS_SignerInfo * cmssi )
301+ ossl_cmssi_new (VALUE ci , CMS_SignerInfo * cmssi )
301302{
302303 VALUE obj ;
303304
304305 obj = NewCMSsi (cCMSSignerInfo );
305306 SetCMSsi (obj , cmssi );
306- rb_ivar_set (obj , rb_intern ("cms" ), cmssi );
307+ rb_ivar_set (ci , rb_intern ("cms" ), obj );
307308
308309 return obj ;
309310}
@@ -368,7 +369,7 @@ ossl_cmsci_get_signers(VALUE self)
368369 ary = rb_ary_new2 (num );
369370 for (i = 0 ; i < num ; i ++ ) {
370371 CMS_SignerInfo * si = sk_CMS_SignerInfo_value (sk , i );
371- rb_ary_push (ary , ossl_cmssi_new (si ));
372+ rb_ary_push (ary , ossl_cmssi_new (self , si ));
372373 }
373374
374375 return ary ;
You can’t perform that action at this time.
0 commit comments