Skip to content

Commit

Permalink
Support tor-specific socks error messages
Browse files Browse the repository at this point in the history
The socks port 'ExtendedErrors' flag must be set in the tor
configuration for tor to return these error codes.
  • Loading branch information
stevenengler committed Sep 15, 2021
1 parent 47d5eb3 commit 5925455
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/tgen-transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ static TGenEvent _tgentransport_receiveSocksResponseStatus(TGenTransport* transp
return TGEN_EVENT_READ;
} else {
gchar version = transport->socksBuffer->str[0];
gchar status = transport->socksBuffer->str[1];
guchar status = transport->socksBuffer->str[1];

g_string_free(transport->socksBuffer, TRUE);
transport->socksBuffer = NULL;
Expand Down Expand Up @@ -1121,6 +1121,38 @@ static TGenEvent _tgentransport_receiveSocksResponseStatus(TGenTransport* transp
g_string_append_printf(messageBuffer, "address type not supported");
break;
}
case 0xF0: {
g_string_append_printf(messageBuffer, "(tor) onion service descriptor can not be found");
break;
}
case 0xF1: {
g_string_append_printf(messageBuffer, "(tor) onion service descriptor is invalid");
break;
}
case 0xF2: {
g_string_append_printf(messageBuffer, "(tor) onion service introduction failed");
break;
}
case 0xF3: {
g_string_append_printf(messageBuffer, "(tor) onion service rendezvous failed");
break;
}
case 0xF4: {
g_string_append_printf(messageBuffer, "(tor) onion service missing client authorization");
break;
}
case 0xF5: {
g_string_append_printf(messageBuffer, "(tor) onion service wrong client authorization");
break;
}
case 0xF6: {
g_string_append_printf(messageBuffer, "(tor) onion service invalid address");
break;
}
case 0xF7: {
g_string_append_printf(messageBuffer, "(tor) onion service introduction timed out");
break;
}
default: {
g_string_append_printf(messageBuffer, "unknown error");
break;
Expand Down

0 comments on commit 5925455

Please sign in to comment.