Infer complains:
```
test_tls.c:172: error: Uninitialized Value
`_.cert` is read without initialization.
170.
171. T(sctx = SSL_CTX_new(TLS_server_method()));
172. T(SSL_CTX_use_certificate(sctx, ck.cert));
^
173. T(SSL_CTX_use_PrivateKey(sctx, ck.pkey));
174. T(SSL_CTX_check_private_key(sctx));
test_tls.c:173: error: Uninitialized Value
`_.pkey` is read without initialization.
171. T(sctx = SSL_CTX_new(TLS_server_method()));
172. T(SSL_CTX_use_certificate(sctx, ck.cert));
173. T(SSL_CTX_use_PrivateKey(sctx, ck.pkey));
^
174. T(SSL_CTX_check_private_key(sctx));
175.
```
Altough the complain is false positive, fixing it will allow for future
use of the tools in automated tests.
}
/* Generate simple cert+key pair. Based on req.c */
-static struct certkey certgen(const char *algname, const char *paramset)
+static void certgen(const char *algname, const char *paramset, struct certkey *ck)
{
/* Keygen. */
EVP_PKEY *tkey;
PEM_write_bio_X509(out, x509ss);
BIO_free_all(out);
#endif
- return (struct certkey){ .pkey = pkey, .cert = x509ss };
+ ck->pkey = pkey;
+ ck->cert = x509ss;
}
/* Non-blocking BIO test mechanic is based on sslapitest.c */
printf(cNORM "\n");
struct certkey ck;
- ck = certgen(algname, paramset);
+ certgen(algname, paramset, &ck);
SSL_CTX *cctx, *sctx;