Commit 91c44f82 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename blake2s to blake2s128.

parent dda8d637
...@@ -318,7 +318,7 @@ This specifies smallest (highest) rule priority used with source-specific ...@@ -318,7 +318,7 @@ This specifies smallest (highest) rule priority used with source-specific
routes. The default is 100. routes. The default is 100.
.TP .TP
.BI "key id" " id" " type " \c .BI "key id" " id" " type " \c
.RB { hmac-sha256 | blake2s } \c .RB { hmac-sha256 | blake2s128 } \c
.BI " value" " value" .BI " value" " value"
Configure a key for use with the Configure a key for use with the
.B key .B key
...@@ -327,13 +327,13 @@ interface option. The ...@@ -327,13 +327,13 @@ interface option. The
is one of is one of
.B hmac-sha256 .B hmac-sha256
or or
.BR blake2s . .BR blake2s128 .
The The
.B value .B value
is a hexadecimal string (up to 64 bytes for is a hexadecimal string (up to 64 bytes for
.BR hmac-sha256 , .BR hmac-sha256 ,
up to 32 bytes for up to 32 bytes for
.BR blake2s ). .BR blake2s128 ).
.SS Interface configuration .SS Interface configuration
An interface is configured by a line with the following format: An interface is configured by a line with the following format:
.IP .IP
......
...@@ -784,8 +784,8 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return) ...@@ -784,8 +784,8 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return)
key->type = AUTH_TYPE_NONE; key->type = AUTH_TYPE_NONE;
} else if(strcmp(auth_type, "hmac-sha256") == 0) { } else if(strcmp(auth_type, "hmac-sha256") == 0) {
key->type = AUTH_TYPE_SHA256; key->type = AUTH_TYPE_SHA256;
} else if(strcmp(auth_type, "blake2s") == 0) { } else if(strcmp(auth_type, "blake2s128") == 0) {
key->type = AUTH_TYPE_BLAKE2S; key->type = AUTH_TYPE_BLAKE2S128;
} else { } else {
fprintf(stderr, "Key type '%s' isn't supported.\n", auth_type); fprintf(stderr, "Key type '%s' isn't supported.\n", auth_type);
free(auth_type); free(auth_type);
...@@ -830,7 +830,7 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return) ...@@ -830,7 +830,7 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return)
} }
break; break;
} }
case AUTH_TYPE_BLAKE2S: case AUTH_TYPE_BLAKE2S128:
if(key->len < 1 || key->len > 32) { if(key->len < 1 || key->len > 32) {
fprintf(stderr, "Key length is %d, expected 1 to 32.\n", fprintf(stderr, "Key length is %d, expected 1 to 32.\n",
key->len); key->len);
......
...@@ -31,7 +31,7 @@ THE SOFTWARE. ...@@ -31,7 +31,7 @@ THE SOFTWARE.
#define AUTH_TYPE_NONE 0 #define AUTH_TYPE_NONE 0
#define AUTH_TYPE_SHA256 1 #define AUTH_TYPE_SHA256 1
#define AUTH_TYPE_BLAKE2S 2 #define AUTH_TYPE_BLAKE2S128 2
struct filter_result { struct filter_result {
unsigned int add_metric; /* allow = 0, deny = INF, metric = <0..INF> */ unsigned int add_metric; /* allow = 0, deny = INF, metric = <0..INF> */
......
...@@ -171,7 +171,7 @@ compute_hmac(const unsigned char *src, const unsigned char *dst, ...@@ -171,7 +171,7 @@ compute_hmac(const unsigned char *src, const unsigned char *dst,
return -1; return -1;
return 32; return 32;
} }
case AUTH_TYPE_BLAKE2S: { case AUTH_TYPE_BLAKE2S128: {
blake2s_state s; blake2s_state s;
if(key->len > 32) if(key->len > 32)
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment