File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 2828
2929#include "util.h"
3030#include <stdio.h>
31+ #include <string.h>
3132
3233#if defined(_WIN32 ) || defined(_WIN64 )
3334#define strncasecmp _strnicmp
@@ -77,7 +78,12 @@ struct util_ctx_st {
7778
7879UTIL_CTX * UTIL_CTX_new ()
7980{
80- return OPENSSL_zalloc (sizeof (UTIL_CTX ));
81+ UTIL_CTX * ctx ;
82+
83+ ctx = OPENSSL_malloc (sizeof (UTIL_CTX ));
84+ if (ctx )
85+ memset (ctx , 0 , sizeof (UTIL_CTX ));
86+ return ctx ;
8187}
8288
8389void UTIL_CTX_free (UTIL_CTX * ctx )
@@ -237,6 +243,24 @@ static char *dump_hex(unsigned char *val, const size_t len)
237243 return hexbuf ;
238244}
239245
246+ #if OPENSSL_VERSION_NUMBER < 0x10100000L
247+ static char * OPENSSL_strndup (const char * str , size_t s )
248+ {
249+ size_t len ;
250+ char * ret ;
251+
252+ if (!str || !s )
253+ return NULL ;
254+ len = strnlen (str , s );
255+ ret = OPENSSL_malloc (len + 1 );
256+ if (ret ) {
257+ memcpy (ret , str , len );
258+ ret [len ] = '\0' ;
259+ }
260+ return ret ;
261+ }
262+ #endif
263+
240264static char * dump_expiry (const PKCS11_CERT * cert )
241265{
242266 BIO * bio ;
You can’t perform that action at this time.
0 commit comments