Skip to content

Commit e33ce43

Browse files
committed
feat: no need to test result of sk_* function, it will be correct if CMS_get0_SignerInfos function was successful
1 parent 540aad6 commit e33ce43

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

ext/openssl/ossl_cms.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,22 +356,18 @@ ossl_cmsci_get_signers(VALUE self)
356356
{
357357
CMS_ContentInfo *cms;
358358
STACK_OF(CMS_SignerInfo) *sk;
359-
CMS_SignerInfo *si;
360359
int num, i;
361360
VALUE ary;
362361

363362
GetCMSContentInfo(self, cms);
364363
if (!(sk = CMS_get0_SignerInfos(cms))) {
365-
OSSL_Debug("OpenSSL::CMS#get_signer_info == NULL!");
366364
return rb_ary_new();
367365
}
368-
if ((num = sk_CMS_SignerInfo_num(sk)) < 0) {
369-
ossl_raise(eCMSError, "Negative number of signers!");
370-
}
366+
num = sk_CMS_SignerInfo_num(sk);
371367
ary = rb_ary_new2(num);
372368
for (i=0; i<num; i++) {
373-
si = sk_CMS_SignerInfo_value(sk, i);
374-
rb_ary_push(ary, ossl_cmssi_new(si));
369+
CMS_SignerInfo *si = sk_CMS_SignerInfo_value(sk, i);
370+
rb_ary_push(ary, ossl_cmssi_new(si));
375371
}
376372

377373
return ary;

0 commit comments

Comments
 (0)