Commit 9529941b authored by Antonin Décimo's avatar Antonin Décimo Committed by Juliusz Chroboczek

Use AUTH_TYPE_NONE consistently.

parent d922b64a
...@@ -783,7 +783,6 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return) ...@@ -783,7 +783,6 @@ parse_key(int c, gnc_t gnc, void *closure, struct key **key_return)
} else if(strcmp(auth_type, "blake2s") == 0) { } else if(strcmp(auth_type, "blake2s") == 0) {
key->type = AUTH_TYPE_BLAKE2S; key->type = AUTH_TYPE_BLAKE2S;
} else { } else {
key->type = 0;
free(auth_type); free(auth_type);
goto error; goto error;
} }
......
...@@ -72,7 +72,7 @@ add_key(char *id, int type, int len, unsigned char *value) ...@@ -72,7 +72,7 @@ add_key(char *id, int type, int len, unsigned char *value)
{ {
struct key *key; struct key *key;
assert(value != NULL && type != 0); assert(value != NULL && type != AUTH_TYPE_NONE);
key = find_key(id); key = find_key(id);
if(key) { if(key) {
......
...@@ -1074,12 +1074,12 @@ flushbuf(struct buffered *buf, struct interface *ifp) ...@@ -1074,12 +1074,12 @@ flushbuf(struct buffered *buf, struct interface *ifp)
assert(buf->len <= buf->size); assert(buf->len <= buf->size);
if(buf->len > 0) { if(buf->len > 0) {
if(ifp->key != NULL && ifp->key->type != 0) if(ifp->key != NULL && ifp->key->type != AUTH_TYPE_NONE)
send_crypto_seqno(buf, ifp); send_crypto_seqno(buf, ifp);
debugf(" (flushing %d buffered bytes)\n", buf->len); debugf(" (flushing %d buffered bytes)\n", buf->len);
DO_HTONS(packet_header + 2, buf->len); DO_HTONS(packet_header + 2, buf->len);
fill_rtt_message(buf, ifp); fill_rtt_message(buf, ifp);
if(ifp->key != NULL && ifp->key->type != 0) { if(ifp->key != NULL && ifp->key->type != AUTH_TYPE_NONE) {
end = add_hmac(buf, ifp, packet_header); end = add_hmac(buf, ifp, packet_header);
if(end < 0) { if(end < 0) {
fprintf(stderr, "Couldn't add HMAC.\n"); fprintf(stderr, "Couldn't add HMAC.\n");
......
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