//
// Aspia Project
// Copyright (C) 2016-2024 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

syntax = "proto3";

option optimize_for = LITE_RUNTIME;

package proto;

// Sent from peer to relay for authentication.
// If the authentication failed, then the connection should be dropped.
message PeerToRelay
{
    // Unique key identifier in the relay pool.
    uint32 key_id = 1;

    // Public key of the peer.
    bytes public_key = 2;

    message Secret
    {
        bytes random_data       = 1;
        string client_address   = 2;
        string client_user_name = 3;
        string host_address     = 4;
        fixed64 host_id         = 5;
    }

    // Encrypted secret.
    bytes data = 3;
}
