Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement PoWeb handshake messages #14

Merged
merged 4 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
buildscript {
ext {
kotlinVersion = '1.3.72'
protobufVersion = '3.12.2'
protobufGradleVersion = '0.8.12'
}
}

Expand All @@ -13,6 +15,7 @@ plugins {
id('maven-publish')
id("com.diffplug.gradle.spotless") version "3.27.1"
id('jacoco')
id("com.google.protobuf") version "$protobufGradleVersion"
}

group = "tech.relaycorp"
Expand All @@ -26,6 +29,11 @@ dependencies {

implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")

// Protobuf
implementation "com.google.protobuf:protobuf-gradle-plugin:$protobufGradleVersion"
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
implementation "com.google.protobuf:protobuf-java-util:$protobufVersion"

testImplementation("org.jetbrains.kotlin:kotlin-test")

// Use the Kotlin JUnit5 integration.
Expand All @@ -43,6 +51,17 @@ tasks.withType(KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "1.8"
}

protobuf {
protoc { artifact = "com.google.protobuf:protoc:$protobufVersion" }
}
sourceSets {
main {
kotlin {
srcDirs "build/generated/source/proto/main/java"
}
}
}

jacoco {
toolVersion = "0.8.5"
}
Expand Down
19 changes: 19 additions & 0 deletions src/main/proto/poweb-handshake.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax = "proto3";

option java_multiple_files = true;
option java_package = "tech.relaycorp.poweb.messages.handshake";

package relaynet.poweb.handshake;

message Challenge {
// Sent by the gateway at the start of the connection

string gateway_nonce = 1;
}

message Response {
// Sent by the endpoint in response to Challenge

// The gateway's nonce signed by each endpoint certificate.
repeated bytes gateway_nonce_signatures = 1;
}