Fix for empty trusted CA dir
Trusted CA dir in security configuration is optional, but participant creation currently fails if no or empty dir is provided. This commit fixes this issue and adds some tests for various trusted_ca_dir values. Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
This commit is contained in:
		
							parent
							
								
									1cf472ea06
								
							
						
					
					
						commit
						6c9e50cf3a
					
				
					 4 changed files with 53 additions and 23 deletions
				
			
		| 
						 | 
				
			
			@ -87,14 +87,14 @@ char * ddsrt_file_normalize(const char *filepath)
 | 
			
		|||
    char *normPtr;
 | 
			
		||||
 | 
			
		||||
    norm = NULL;
 | 
			
		||||
    if ((filepath != NULL) && (*filepath != '\0')) {
 | 
			
		||||
        norm = ddsrt_malloc(strlen(filepath) + 1);
 | 
			
		||||
    if (filepath != NULL) {
 | 
			
		||||
        norm = ddsrt_malloc (strlen (filepath) + 1);
 | 
			
		||||
        /* replace any / or \ by DDSRT_FILESEPCHAR */
 | 
			
		||||
        fpPtr = (char *) filepath;
 | 
			
		||||
        normPtr = norm;
 | 
			
		||||
        while (*fpPtr != '\0') {
 | 
			
		||||
            *normPtr = *fpPtr;
 | 
			
		||||
            if ((*fpPtr == '/') || (*fpPtr == '\\')) {
 | 
			
		||||
            if (*fpPtr == '/' || *fpPtr == '\\') {
 | 
			
		||||
                *normPtr = DDSRT_FILESEPCHAR;
 | 
			
		||||
                normPtr++;
 | 
			
		||||
            } else {
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +106,6 @@ char * ddsrt_file_normalize(const char *filepath)
 | 
			
		|||
        }
 | 
			
		||||
        *normPtr = '\0';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return norm;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue