Skip to content

Commit

Permalink
feat: Implement PoWeb handshake messages (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea authored Jul 8, 2020
1 parent 10e0b37 commit aa1d64f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
20 changes: 20 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,8 @@ plugins {
id('maven-publish')
id("com.diffplug.gradle.spotless") version "3.27.1"
id('jacoco')
id("com.google.protobuf") version "$protobufGradleVersion"
id('idea')
}

group = "tech.relaycorp"
Expand All @@ -26,6 +30,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 +52,17 @@ tasks.withType(KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "1.8"
}

protobuf {
protoc { artifact = "com.google.protobuf:protoc:$protobufVersion" }
}
sourceSets {
main {
kotlin {
setBuildDir("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;
}

0 comments on commit aa1d64f

Please sign in to comment.