summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-04-21 20:33:37 +0000
committertb <>2023-04-21 20:33:37 +0000
commitb70f997d3d267673579cd541ea60647349fc7428 (patch)
treecba33a7c1896b3ce511dc54849c7d83072ccfcba /src/lib
parent0f30a4517cb2ece4a9a563e33c6c7c33f846f015 (diff)
downloadopenbsd-b70f997d3d267673579cd541ea60647349fc7428.tar.gz
openbsd-b70f997d3d267673579cd541ea60647349fc7428.tar.bz2
openbsd-b70f997d3d267673579cd541ea60647349fc7428.zip
cms_io: reverse polarity of an if statement to unindent
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/cms/cms_io.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/libcrypto/cms/cms_io.c b/src/lib/libcrypto/cms/cms_io.c
index c45e4a03dd..d5aeea952d 100644
--- a/src/lib/libcrypto/cms/cms_io.c
+++ b/src/lib/libcrypto/cms/cms_io.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_io.c,v 1.15 2023/04/21 20:30:53 tb Exp $ */ 1/* $OpenBSD: cms_io.c,v 1.16 2023/04/21 20:33:37 tb Exp $ */
2/* 2/*
3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 3 * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
4 * project. 4 * project.
@@ -64,19 +64,21 @@ CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms)
64{ 64{
65 ASN1_OCTET_STRING **pos; 65 ASN1_OCTET_STRING **pos;
66 66
67 pos = CMS_get0_content(cms); 67 if ((pos = CMS_get0_content(cms)) == NULL)
68 if (pos == NULL)
69 return 0; 68 return 0;
69
70 if (*pos == NULL) 70 if (*pos == NULL)
71 *pos = ASN1_OCTET_STRING_new(); 71 *pos = ASN1_OCTET_STRING_new();
72 if (*pos != NULL) { 72 if (*pos == NULL) {
73 (*pos)->flags |= ASN1_STRING_FLAG_NDEF; 73 CMSerror(ERR_R_MALLOC_FAILURE);
74 (*pos)->flags &= ~ASN1_STRING_FLAG_CONT; 74 return 0;
75 *boundary = &(*pos)->data;
76 return 1;
77 } 75 }
78 CMSerror(ERR_R_MALLOC_FAILURE); 76
79 return 0; 77 (*pos)->flags |= ASN1_STRING_FLAG_NDEF;
78 (*pos)->flags &= ~ASN1_STRING_FLAG_CONT;
79 *boundary = &(*pos)->data;
80
81 return 1;
80} 82}
81 83
82CMS_ContentInfo * 84CMS_ContentInfo *