diff options
author | Ben Laurie <ben@openssl.org> | 2000-09-05 19:06:45 +0200 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2000-09-05 19:06:45 +0200 |
commit | 29eb7d9ce0488690cca532d0ecb4075b5ca59209 (patch) | |
tree | 38734b41c49140676cd7d7359ef5a132e5493f3e /demos | |
parent | Keep a not of original encoding in certificate requests. (diff) | |
download | openssl-29eb7d9ce0488690cca532d0ecb4075b5ca59209.tar.xz openssl-29eb7d9ce0488690cca532d0ecb4075b5ca59209.zip |
Distinguish between assertions and conditions that should cause death.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/state_machine/state_machine.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/demos/state_machine/state_machine.c b/demos/state_machine/state_machine.c index 690423e476..0eb8e92c0c 100644 --- a/demos/state_machine/state_machine.c +++ b/demos/state_machine/state_machine.c @@ -83,6 +83,11 @@ #include <sys/socket.h> #include <netinet/in.h> +/* die_unless is intended to work like assert, except that it happens + always, even if NDEBUG is defined. Use assert as a stopgap. */ + +#define die_unless(x) assert(x) + typedef struct { SSL_CTX *pCtx; @@ -111,20 +116,20 @@ SSLStateMachine *SSLStateMachine_new(const char *szCertificateFile, SSLStateMachine *pMachine=malloc(sizeof *pMachine); int n; - assert(pMachine); + die_unless(pMachine); pMachine->pCtx=SSL_CTX_new(SSLv23_server_method()); - assert(pMachine->pCtx); + die_unless(pMachine->pCtx); n=SSL_CTX_use_certificate_file(pMachine->pCtx,szCertificateFile, SSL_FILETYPE_PEM); - assert(n > 0); + die_unless(n > 0); n=SSL_CTX_use_PrivateKey_file(pMachine->pCtx,szKeyFile,SSL_FILETYPE_PEM); - assert(n > 0); + die_unless(n > 0); pMachine->pSSL=SSL_new(pMachine->pCtx); - assert(pMachine->pSSL); + die_unless(pMachine->pSSL); pMachine->pbioRead=BIO_new(BIO_s_mem()); /* Set EOF to return 0 (-1 is the default) */ |