Lines Matching refs:buf
119 static int load_file( const char *path, unsigned char **buf, size_t *n ) in load_file() argument
138 ( *buf = mbedtls_calloc( 1, *n + 1 ) ) == NULL ) in load_file()
144 if( fread( *buf, 1, *n, f ) != *n ) in load_file()
147 free( *buf ); in load_file()
148 *buf = NULL; in load_file()
154 (*buf)[*n] = '\0'; in load_file()
162 static int write_file( const char *path, unsigned char *buf, size_t n ) in write_file() argument
169 if( fwrite( buf, 1, n, f ) != n ) in write_file()
184 char buf[1024]; in main() local
192 memset( buf, 0, sizeof(buf) ); in main()
232 mbedtls_strerror( ret, buf, 1024 ); in main()
234 mbedtls_printf( " failed\n ! load_file returned %d - %s\n\n", ret, buf ); in main()
249 mbedtls_strerror( ret, buf, 1024 ); in main()
251 mbedtls_printf( " failed\n ! convert_pem_to_der %d - %s\n\n", ret, buf ); in main()
268 mbedtls_strerror( ret, buf, 1024 ); in main()
270 mbedtls_printf( " failed\n ! write_file returned %d - %s\n\n", ret, buf ); in main()