int engine_impl = 0;
prog = opt_progname(argv[0]);
- if ((buf = (unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL) {
- BIO_printf(bio_err, "%s: out of memory\n", prog);
- goto end;
- }
+ buf = app_malloc(BUFSIZE, "I/O buffer");
md = EVP_get_digestbyname(prog);
prog = opt_init(argc, argv, dgst_options);
goto end;
}
siglen = EVP_PKEY_size(sigkey);
- sigbuf = OPENSSL_malloc(siglen);
- if (!sigbuf) {
- BIO_printf(bio_err, "Out of memory\n");
- goto end;
- }
+ sigbuf = app_malloc(siglen, "signature buffer");
siglen = BIO_read(sigbio, sigbuf, siglen);
BIO_free(sigbio);
if (siglen <= 0) {
}
}
end:
- if (buf != NULL) {
- OPENSSL_cleanse(buf, BUFSIZE);
- OPENSSL_free(buf);
- }
+ OPENSSL_clear_free(buf, BUFSIZE);
BIO_free(in);
if (passin)
OPENSSL_free(passin);