"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tools/pkcs11-register.c" between
opensc-0.21.0.tar.gz and opensc-0.22.0.tar.gz

About: OpenSc provides a set of libraries and utilities to work with smart cards.

pkcs11-register.c  (opensc-0.21.0):pkcs11-register.c  (opensc-0.22.0)
skipping to change at line 126 skipping to change at line 126
return NULL; return NULL;
} }
void void
add_module_pkcs11_txt(const char *profile_dir, add_module_pkcs11_txt(const char *profile_dir,
const char *module_path, const char *module_name, const char *exc lude_module_path) const char *module_path, const char *module_name, const char *exc lude_module_path)
{ {
char pkcs11_txt_path[PATH_MAX]; char pkcs11_txt_path[PATH_MAX];
char *pkcs11_txt = NULL; char *pkcs11_txt = NULL;
size_t pkcs11_txt_len = 0; size_t pkcs11_txt_len = 0;
unsigned char *txt = NULL;
if (!profile_dir if (!profile_dir
|| snprintf(pkcs11_txt_path, sizeof pkcs11_txt_path, || snprintf(pkcs11_txt_path, sizeof pkcs11_txt_path,
"%s%c%s", profile_dir, path_sep, "pkcs11.txt") < 0 "%s%c%s", profile_dir, path_sep, "pkcs11.txt") < 0
|| !fread_to_eof(pkcs11_txt_path, || !fread_to_eof(pkcs11_txt_path, &txt, &pkcs11_txt_len))
(unsigned char **) &pkcs11_txt, &pkcs11_txt_len)) {
{
goto err; goto err;
} }
pkcs11_txt = (char *)txt;
char *p = realloc(pkcs11_txt, pkcs11_txt_len+1); char *p = realloc(pkcs11_txt, pkcs11_txt_len+1);
if (!p) if (!p)
goto err; goto err;
p[pkcs11_txt_len] = '\0'; p[pkcs11_txt_len] = '\0';
pkcs11_txt = p; pkcs11_txt = p;
if (!strstr(pkcs11_txt, module_path) if (!strstr(pkcs11_txt, module_path)
&& (!exclude_module_path || !strstr(pkcs11_txt, exclude_m odule_path))) { && (!exclude_module_path || !strstr(pkcs11_txt, exclude_m odule_path))) {
/* module is not yet present */ /* module is not yet present */
FILE *f = fopen(pkcs11_txt_path, "a"); FILE *f = fopen(pkcs11_txt_path, "a");
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)