diff options
Diffstat (limited to 'demos/cms')
-rw-r--r-- | demos/cms/Makefile | 18 | ||||
-rw-r--r-- | demos/cms/cms_ddec.c | 3 | ||||
-rw-r--r-- | demos/cms/cms_dec.c | 3 | ||||
-rw-r--r-- | demos/cms/cms_sign.c | 9 | ||||
-rw-r--r-- | demos/cms/cms_sign2.c | 6 |
5 files changed, 28 insertions, 11 deletions
diff --git a/demos/cms/Makefile b/demos/cms/Makefile index 7c8f30d632..3d4cb90750 100644 --- a/demos/cms/Makefile +++ b/demos/cms/Makefile @@ -15,18 +15,28 @@ TESTS = cms_comp \ cms_uncomp \ cms_ver -CFLAGS = -I../../include -g +CFLAGS = -I../../include -g -Wall LDFLAGS = -L../.. LDLIBS = -lcrypto all: $(TESTS) +cms_comp: cms_comp.o +cms_ddec: cms_ddec.o +cms_dec: cms_dec.o +cms_denc: cms_denc.o +cms_enc: cms_enc.o +cms_sign: cms_sign.o +cms_sign2: cms_sign2.o +cms_uncomp: cms_uncomp.o +cms_ver: cms_ver.o + +$(TESTS): + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS) + clean: $(RM) $(TESTS) *.o -cms_%: cms_%.c - $(CC) $(CFLAGS) $(LDFLAGS) -o "$@" "$<" $(LDLIBS) - test: all @echo "\nCMS tests:" LD_LIBRARY_PATH=../.. ./cms_enc diff --git a/demos/cms/cms_ddec.c b/demos/cms/cms_ddec.c index f65a77e129..d119e97222 100644 --- a/demos/cms/cms_ddec.c +++ b/demos/cms/cms_ddec.c @@ -34,7 +34,8 @@ int main(int argc, char **argv) rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - BIO_reset(tbio); + if (BIO_reset(tbio) < 0) + goto err; rkey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); diff --git a/demos/cms/cms_dec.c b/demos/cms/cms_dec.c index f64a68ab42..b15885eb18 100644 --- a/demos/cms/cms_dec.c +++ b/demos/cms/cms_dec.c @@ -31,7 +31,8 @@ int main(int argc, char **argv) rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - BIO_reset(tbio); + if (BIO_reset(tbio) < 0) + goto err; rkey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); diff --git a/demos/cms/cms_sign.c b/demos/cms/cms_sign.c index 35fc889f80..31e71e8b63 100644 --- a/demos/cms/cms_sign.c +++ b/demos/cms/cms_sign.c @@ -38,7 +38,8 @@ int main(int argc, char **argv) scert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - BIO_reset(tbio); + if (BIO_reset(tbio) < 0) + goto err; skey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); @@ -62,8 +63,10 @@ int main(int argc, char **argv) if (!out) goto err; - if (!(flags & CMS_STREAM)) - BIO_reset(in); + if (!(flags & CMS_STREAM)) { + if (BIO_reset(in) < 0) + goto err; + } /* Write out S/MIME message */ if (!SMIME_write_CMS(out, cms, in, flags)) diff --git a/demos/cms/cms_sign2.c b/demos/cms/cms_sign2.c index 61d9f8bbe8..af3386eb76 100644 --- a/demos/cms/cms_sign2.c +++ b/demos/cms/cms_sign2.c @@ -30,7 +30,8 @@ int main(int argc, char **argv) scert = PEM_read_bio_X509(tbio, NULL, 0, NULL); - BIO_reset(tbio); + if (BIO_reset(tbio) < 0) + goto err; skey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); @@ -43,7 +44,8 @@ int main(int argc, char **argv) scert2 = PEM_read_bio_X509(tbio, NULL, 0, NULL); - BIO_reset(tbio); + if (BIO_reset(tbio) < 0) + goto err; skey2 = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL); |