X-Git-Url: https://www.bearssl.org/gitweb//home/git/?p=BearSSL;a=blobdiff_plain;f=tools%2Fbrssl.h;h=d889b08ed1e294059cdbbb50129d2d841a705384;hp=cf1cea39a36f7bf5979b8cc2ced92a16b3ef5ea8;hb=3655193439d4e093bb80a2f0d9e02179d424de08;hpb=b42bd5972f935ffc32019acac6f8a07ae08ae9c2 diff --git a/tools/brssl.h b/tools/brssl.h index cf1cea3..d889b08 100644 --- a/tools/brssl.h +++ b/tools/brssl.h @@ -211,6 +211,23 @@ extern const hash_function hash_functions[]; */ unsigned parse_hash_functions(const char *arg); +/* + * Get a curve name (by ID). If the curve ID is not known, this returns + * NULL. + */ +const char *get_curve_name(int id); + +/* + * Get a curve name (by ID). The name is written in the provided buffer + * (zero-terminated). If the curve ID is not known, the name is + * "unknown (***)" where "***" is the decimal value of the identifier. + * If the name does not fit in the provided buffer, then dst[0] is set + * to 0 (unless len is 0, in which case nothing is written), and -1 is + * returned. Otherwise, the name is written in dst[] (with a terminating + * 0), and this function returns 0. + */ +int get_curve_name_ext(int id, char *dst, size_t len); + /* * Type for a known cipher suite. */ @@ -270,6 +287,11 @@ const char *get_suite_name(unsigned suite); */ int get_suite_name_ext(unsigned suite, char *dst, size_t len); +/* + * Tell whether a cipher suite uses ECDHE key exchange. + */ +int uses_ecdhe(unsigned suite); + /* * Print out all known names (for protocol versions, cipher suites...). */