X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=tools%2Fbrssl.h;h=f2957e640f4db949768c0ccb68110fc1f717aa8b;hp=d889b08ed1e294059cdbbb50129d2d841a705384;hb=5414fd525e903fe65e372735f106dcdc19109aad;hpb=3655193439d4e093bb80a2f0d9e02179d424de08 diff --git a/tools/brssl.h b/tools/brssl.h index d889b08..f2957e6 100644 --- a/tools/brssl.h +++ b/tools/brssl.h @@ -471,17 +471,33 @@ const br_hash_class *get_hash_impl(int id); */ const char *find_error_name(int err, const char **comment); +/* + * Find the symbolic name for an algorithm implementation. Provided + * pointer should be a pointer to a vtable or to a function, where + * appropriate. If not recognised, then the string "UNKNOWN" is returned. + * + * If 'long_name' is non-zero, then the returned name recalls the + * algorithm type as well; otherwise, only the core implementation name + * is returned (e.g. the long name could be 'aes_big_cbcenc' while the + * short name is 'big'). + */ +const char *get_algo_name(const void *algo, int long_name); + /* * Run a SSL engine, with a socket connected to the peer, and using * stdin/stdout to exchange application data. * + * To help with Win32 compatibility, the socket descriptor is provided + * as an "unsigned long" value. + * * Returned value: * 0 SSL connection closed successfully * x > 0 SSL error "x" * -1 early socket close * -2 stdout was closed, or something failed badly */ -int run_ssl_engine(br_ssl_engine_context *eng, int fd, unsigned flags); +int run_ssl_engine(br_ssl_engine_context *eng, + unsigned long fd, unsigned flags); #define RUN_ENGINE_VERBOSE 0x0001 /* enable verbose messages */ #define RUN_ENGINE_TRACE 0x0002 /* hex dump of records */