mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-03 20:22:59 -05:00 
			
		
		
		
	Add LCOV_EXCLUDE_LINE on some IO errors
This commit is contained in:
		
							parent
							
								
									7575daa1f2
								
							
						
					
					
						commit
						446ee6618f
					
				@ -362,8 +362,8 @@ int ctr_drbg_write_seed_file( ctr_drbg_context *ctx, const char *path )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( fwrite( buf, 1, CTR_DRBG_MAX_INPUT, f ) != CTR_DRBG_MAX_INPUT )
 | 
					    if( fwrite( buf, 1, CTR_DRBG_MAX_INPUT, f ) != CTR_DRBG_MAX_INPUT )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ret = POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR;
 | 
					        ret = POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR; /* LCOV_EXCL_LINE */
 | 
				
			||||||
        goto exit;
 | 
					        goto exit;                                 /* LCOV_EXCL_LINE */
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = 0;
 | 
					    ret = 0;
 | 
				
			||||||
@ -394,8 +394,8 @@ int ctr_drbg_update_seed_file( ctr_drbg_context *ctx, const char *path )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( fread( buf, 1, n, f ) != n )
 | 
					    if( fread( buf, 1, n, f ) != n )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        fclose( f );
 | 
					        fclose( f );                                   /* LCOV_EXCL_LINE */
 | 
				
			||||||
        return( POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR );
 | 
					        return( POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR ); /* LCOV_EXCL_LINE */
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fclose( f );
 | 
					    fclose( f );
 | 
				
			||||||
 | 
				
			|||||||
@ -291,7 +291,7 @@ void hmac_drbg_free( hmac_drbg_context *ctx )
 | 
				
			|||||||
#if defined(POLARSSL_FS_IO)
 | 
					#if defined(POLARSSL_FS_IO)
 | 
				
			||||||
int hmac_drbg_write_seed_file( hmac_drbg_context *ctx, const char *path )
 | 
					int hmac_drbg_write_seed_file( hmac_drbg_context *ctx, const char *path )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int ret = POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR;
 | 
					    int ret;
 | 
				
			||||||
    FILE *f;
 | 
					    FILE *f;
 | 
				
			||||||
    unsigned char buf[ POLARSSL_HMAC_DRBG_MAX_INPUT ];
 | 
					    unsigned char buf[ POLARSSL_HMAC_DRBG_MAX_INPUT ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -303,8 +303,8 @@ int hmac_drbg_write_seed_file( hmac_drbg_context *ctx, const char *path )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( fwrite( buf, 1, sizeof( buf ), f ) != sizeof( buf ) )
 | 
					    if( fwrite( buf, 1, sizeof( buf ), f ) != sizeof( buf ) )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ret = POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR;
 | 
					        ret = POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR; /* LCOV_EXCL_LINE */
 | 
				
			||||||
        goto exit;
 | 
					        goto exit;                                  /* LCOV_EXCL_LINE */
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ret = 0;
 | 
					    ret = 0;
 | 
				
			||||||
@ -335,8 +335,8 @@ int hmac_drbg_update_seed_file( hmac_drbg_context *ctx, const char *path )
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if( fread( buf, 1, n, f ) != n )
 | 
					    if( fread( buf, 1, n, f ) != n )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        fclose( f );
 | 
					        fclose( f );                                    /* LCOV_EXCL_LINE */
 | 
				
			||||||
        return( POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR );
 | 
					        return( POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR ); /* LCOV_EXCL_LINE */
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fclose( f );
 | 
					    fclose( f );
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user