Skip to content

Commit

Permalink
Don't save cert to a file if no root cert present
Browse files Browse the repository at this point in the history
  • Loading branch information
tocharl committed Oct 10, 2023
1 parent 5acf94f commit ae71cd5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions plugins_tools/eid-viewer/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,11 @@ static int write_elements(xmlTextWriterPtr writer, struct element_desc *element)
int have_cache = cache_have_label(element->label);
assert(element->child_elements == NULL);

//for testing
//if(EID_STRCMP(element->label, TEXT("firstnames")) == 0) {
// be_log(EID_VWR_LOG_ERROR, "Could not write file: no root certificate found");
// return 0;
//}

if(element->reqd && !have_cache) {
//don't let save file if no root cert present
if(EID_STRCMP(element->label, TEXT("Root")) == 0) {
be_log(EID_VWR_LOG_ERROR, "Could not write file: no root certificate found");
return 1;
be_log(EID_VWR_LOG_COARSE, "Could not write certificates: no root certificate found");
return 0;
} else {
be_log(EID_VWR_LOG_ERROR, "Could not write file: no data found for required label %s", element->label);
return -1;
Expand Down

0 comments on commit ae71cd5

Please sign in to comment.