diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0fb4d6b93505e4c94c767147e4bab50c4c031970..2ed86229bcbd90c50d37b7373fc7f7346b2aad00 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,6 @@ variables: GOLANG_MINOR_VERSION: "${GOLANG_VERSION}.0" DOCKER_TLS_CERTDIR: "/certs" - # Build stage .build: &build @@ -137,7 +136,6 @@ build-etsi14module-latest: - docker buildx build --push -t "$IMAGE_NAME:$TAG" -f etsi14module/Dockerfile --build-arg "GITLAB_PROXY=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/" --build-arg GITLAB_LOGIN=${GITLAB_LOGIN} --build-arg GITLAB_TOKEN=${GITLAB_TOKEN} --build-arg GOLANG_VERSION=${GOLANG_VERSION} . <<: *build-latest - # Analyze stage lint: stage: analyze @@ -175,8 +173,24 @@ unit-tests: path: coverage.xml needs: [] +integration-test-aes: + tags: + - shell + needs: [] + variables: + DEPENDENCY_PROXY: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/ + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker login -u $CI_DEPENDENCY_PROXY_USER -p $CI_DEPENDENCY_PROXY_PASSWORD $CI_DEPENDENCY_PROXY_SERVER + - ./scripts/install_go_as_user.sh $GOLANG_MINOR_VERSION + - export PATH="$HOME/go/go/bin:$PATH" + - export GOROOT="$HOME/go/go" + - export GOPATH=$HOME/go_projects + - go version + script: + - make integration-test-aes -integration-test: +integration-test-otp: tags: - shell needs: [] @@ -191,4 +205,4 @@ integration-test: - export GOPATH=$HOME/go_projects - go version script: - - make integration-test + - make integration-test-otp diff --git a/.vscode/launch.json b/.vscode/launch.json index fc785bb504ec59954458135389216ed776ef84a6..70f8fa1d662f4a79adb6470d5ad123a139cbcbc1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -15,7 +15,7 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "compose-debug-up", + "preLaunchTask": "compose-debug-up" }, { "name": "kms02-debug", @@ -28,7 +28,7 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "compose-debug-up", + "preLaunchTask": "compose-debug-up" }, { "name": "kms03-debug", @@ -41,7 +41,7 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "compose-debug-up", + "preLaunchTask": "compose-debug-up" }, { "name": "kms04-debug", @@ -54,10 +54,10 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "compose-debug-up", + "preLaunchTask": "compose-debug-up" }, { - "name": "integration-test-kms01-debug", + "name": "integration-test-aes-kms01-debug", "type": "go", "request": "attach", "mode": "remote", @@ -67,10 +67,10 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "integration-test-debug-kms-up", + "preLaunchTask": "integration-test-aes-debug-kms-up" }, { - "name": "integration-test-kms02-debug", + "name": "integration-test-aes-kms02-debug", "type": "go", "request": "attach", "mode": "remote", @@ -80,7 +80,33 @@ "showLog": true, "trace": "log", "logOutput": "rpc", - "preLaunchTask": "integration-test-debug-kms-up", + "preLaunchTask": "integration-test-aes-debug-kms-up" + }, + { + "name": "integration-test-otp-kms01-debug", + "type": "go", + "request": "attach", + "mode": "remote", + "remotePath": "", + "port": 4401, + "host": "127.0.0.1", + "showLog": true, + "trace": "log", + "logOutput": "rpc", + "preLaunchTask": "integration-test-otp-debug-kms-up" + }, + { + "name": "integration-test-otp-kms02-debug", + "type": "go", + "request": "attach", + "mode": "remote", + "remotePath": "", + "port": 4402, + "host": "127.0.0.1", + "showLog": true, + "trace": "log", + "logOutput": "rpc", + "preLaunchTask": "integration-test-otp-debug-kms-up" }, { "name": "Launch currently open test", @@ -88,7 +114,7 @@ "request": "launch", "mode": "auto", "program": "${file}" - }, + } ], "compounds": [ { diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 17d823499757d7dd2546f0848c8301790161df11..5a9e6fb20cc725252a492bb4fbfca108857f64c1 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,14 +2,19 @@ "version": "2.0.0", "tasks": [ { - "label": "integration-test-debug-kms-up", - "command": "make integration-test-debug-compose-up", - "type": "shell", + "label": "integration-test-aes-debug-kms-up", + "command": "make integration-test-aes-debug-compose-up", + "type": "shell" + }, + { + "label": "integration-test-otp-debug-kms-up", + "command": "make integration-test-otp-debug-compose-up", + "type": "shell" }, { "label": "compose-debug-up", "command": "make compose-debug-up", - "type": "shell", + "type": "shell" } ] } diff --git a/Makefile b/Makefile index d74cc8042b311fbc198cd576d17137a49feb6a09..4a96cdf360b7fd2d0ecc625c5c17846b79ce5283 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,9 @@ compose-debug-up: generate-gokms-certs build-images install-gosdnc compose-debug-down: docker compose -f docker-compose.yml -f docker-compose.override.debug.yml down -integration-test: install-gosdnc generate-integration-test-certs build-images +integration-test: integration-test-aes integration-test-otp + +integration-test-aes: install-gosdnc generate-integration-test-certs build-images docker compose -f integration-tests/docker-compose.yml down docker compose -f integration-tests/docker-compose.yml up -d echo "Will sleep for the quantumlayers to get ready" @@ -109,13 +111,28 @@ integration-test: install-gosdnc generate-integration-test-certs build-images go test -p 1 -count=1 -v ./integration-tests/code/* docker compose -f integration-tests/docker-compose.yml down -integration-test-debug-compose-up: generate-integration-test-certs build-images install-gosdnc +integration-test-aes-debug-compose-up: generate-integration-test-certs build-images install-gosdnc docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml down docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml up -d -integration-test-debug-compose-down: +integration-test-aes-debug-compose-down: docker compose -f integration-tests/docker-compose.yml -f integration-tests/docker-compose.override.debug.yml down +integration-test-otp: install-gosdnc generate-integration-test-certs build-images + docker compose -f integration-tests/docker-compose-otp.yml down + docker compose -f integration-tests/docker-compose-otp.yml up -d + echo "Will sleep for the quantumlayers to get ready" + sleep 45 + go test -p 1 -count=1 -v ./integration-tests/code/* + docker compose -f integration-tests/docker-compose-otp.yml down + +integration-test-otp-debug-compose-up: generate-integration-test-certs build-images install-gosdnc + docker compose -f integration-tests/docker-compose-otp.yml -f integration-tests/docker-compose.override.debug.yml down + docker compose -f integration-tests/docker-compose-otp.yml -f integration-tests/docker-compose.override.debug.yml up -d + +integration-test-otp-debug-compose-down: + docker compose -f integration-tests/docker-compose-otp.yml -f integration-tests/docker-compose.override.debug.yml down + generate-certs: generate-root-ca generate-gokms-certs generate-integration-test-certs generate-root-ca: pre diff --git a/goKMS/api/gen/proto/go/kmsintercom/kmsintercom.pb.go b/goKMS/api/gen/proto/go/kmsintercom/kmsintercom.pb.go index d054ebed3ea4d231b0cba9b08e34e85befb8f8dd..b7988dc72c07f449a6ac73f524ae61479f04c25b 100644 --- a/goKMS/api/gen/proto/go/kmsintercom/kmsintercom.pb.go +++ b/goKMS/api/gen/proto/go/kmsintercom/kmsintercom.pb.go @@ -20,6 +20,52 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type CryptoAlgorithm int32 + +const ( + CryptoAlgorithm_AES_256_GCM CryptoAlgorithm = 0 + CryptoAlgorithm_OTP CryptoAlgorithm = 1 +) + +// Enum value maps for CryptoAlgorithm. +var ( + CryptoAlgorithm_name = map[int32]string{ + 0: "AES_256_GCM", + 1: "OTP", + } + CryptoAlgorithm_value = map[string]int32{ + "AES_256_GCM": 0, + "OTP": 1, + } +) + +func (x CryptoAlgorithm) Enum() *CryptoAlgorithm { + p := new(CryptoAlgorithm) + *p = x + return p +} + +func (x CryptoAlgorithm) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CryptoAlgorithm) Descriptor() protoreflect.EnumDescriptor { + return file_kmsintercom_kmsintercom_proto_enumTypes[0].Descriptor() +} + +func (CryptoAlgorithm) Type() protoreflect.EnumType { + return &file_kmsintercom_kmsintercom_proto_enumTypes[0] +} + +func (x CryptoAlgorithm) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CryptoAlgorithm.Descriptor instead. +func (CryptoAlgorithm) EnumDescriptor() ([]byte, []int) { + return file_kmsintercom_kmsintercom_proto_rawDescGZIP(), []int{0} +} + // Capabilities // The request message containing the requesting kms' name. type InterComCapabilitiesRequest struct { @@ -493,10 +539,11 @@ type KeyForwardingRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PathId string `protobuf:"bytes,2,opt,name=pathId,proto3" json:"pathId,omitempty"` - ProcessId string `protobuf:"bytes,3,opt,name=processId,proto3" json:"processId,omitempty"` - Key *Key `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PathId string `protobuf:"bytes,2,opt,name=pathId,proto3" json:"pathId,omitempty"` + ProcessId string `protobuf:"bytes,3,opt,name=processId,proto3" json:"processId,omitempty"` + CryptoAlgorithm CryptoAlgorithm `protobuf:"varint,4,opt,name=cryptoAlgorithm,proto3,enum=kmsintercom.CryptoAlgorithm" json:"cryptoAlgorithm,omitempty"` + Key *Key `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"` } func (x *KeyForwardingRequest) Reset() { @@ -552,6 +599,13 @@ func (x *KeyForwardingRequest) GetProcessId() string { return "" } +func (x *KeyForwardingRequest) GetCryptoAlgorithm() CryptoAlgorithm { + if x != nil { + return x.CryptoAlgorithm + } + return CryptoAlgorithm_AES_256_GCM +} + func (x *KeyForwardingRequest) GetKey() *Key { if x != nil { return x.Key @@ -839,11 +893,12 @@ type KeyDeliveryRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - KmsId string `protobuf:"bytes,3,opt,name=kmsId,proto3" json:"kmsId,omitempty"` - KeyId string `protobuf:"bytes,4,opt,name=keyId,proto3" json:"keyId,omitempty"` - RequestId string `protobuf:"bytes,5,opt,name=requestId,proto3" json:"requestId,omitempty"` - Keys []*Key `protobuf:"bytes,6,rep,name=keys,proto3" json:"keys,omitempty"` + Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + KmsId string `protobuf:"bytes,3,opt,name=kmsId,proto3" json:"kmsId,omitempty"` + KeyId string `protobuf:"bytes,4,opt,name=keyId,proto3" json:"keyId,omitempty"` + RequestId string `protobuf:"bytes,5,opt,name=requestId,proto3" json:"requestId,omitempty"` + CryptoAlgorithm CryptoAlgorithm `protobuf:"varint,6,opt,name=cryptoAlgorithm,proto3,enum=kmsintercom.CryptoAlgorithm" json:"cryptoAlgorithm,omitempty"` + Keys []*Key `protobuf:"bytes,7,rep,name=keys,proto3" json:"keys,omitempty"` } func (x *KeyDeliveryRequest) Reset() { @@ -906,6 +961,13 @@ func (x *KeyDeliveryRequest) GetRequestId() string { return "" } +func (x *KeyDeliveryRequest) GetCryptoAlgorithm() CryptoAlgorithm { + if x != nil { + return x.CryptoAlgorithm + } + return CryptoAlgorithm_AES_256_GCM +} + func (x *KeyDeliveryRequest) GetKeys() []*Key { if x != nil { return x.Keys @@ -1077,50 +1139,59 @@ var file_kmsintercom_kmsintercom_proto_rawDesc = []byte{ 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, - 0x8e, 0x01, 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0xd6, 0x01, 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x74, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x74, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x6d, 0x73, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x22, 0x35, 0x0a, 0x15, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x83, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x6b, 0x4b, - 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x74, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x70, 0x61, 0x74, 0x68, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4b, 0x65, 0x79, 0x49, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x38, 0x0a, - 0x18, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, 0x46, 0x0a, 0x0f, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x63, 0x6f, 0x6d, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x52, 0x0f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x12, 0x22, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, + 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x35, 0x0a, 0x15, 0x4b, 0x65, 0x79, 0x46, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, + 0x83, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x74, + 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x74, 0x68, 0x49, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x4b, 0x65, 0x79, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x18, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, + 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, + 0x66, 0x0a, 0x18, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x6d, 0x73, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x22, 0x39, 0x0a, 0x19, 0x4b, 0x65, 0x79, 0x49, 0x64, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x22, 0xea, 0x01, 0x0a, 0x12, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x66, 0x0a, 0x18, 0x4b, 0x65, 0x79, 0x49, 0x64, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x22, - 0x39, 0x0a, 0x19, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xa2, 0x01, 0x0a, 0x12, 0x4b, - 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x14, 0x0a, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x6d, 0x73, 0x49, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6b, 0x65, + 0x79, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x46, 0x0a, 0x0f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6c, 0x67, 0x6f, 0x72, + 0x69, 0x74, 0x68, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x6b, 0x6d, 0x73, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, + 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x0f, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, + 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x24, 0x0a, 0x04, 0x6b, 0x65, 0x79, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x22, 0x33, 0x0a, 0x13, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, @@ -1129,70 +1200,73 @@ var file_kmsintercom_kmsintercom_proto_rawDesc = []byte{ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x32, 0xb9, 0x06, 0x0a, 0x09, 0x4b, 0x6d, 0x73, 0x54, 0x61, 0x6c, 0x6b, 0x65, - 0x72, 0x12, 0x6a, 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x43, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x6b, 0x6d, 0x73, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, - 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, - 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, - 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x6b, 0x64, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x1f, 0x2e, 0x6b, - 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x51, - 0x6b, 0x64, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, - 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x51, 0x6b, 0x64, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x12, 0x64, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x46, - 0x6f, 0x72, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x25, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x46, - 0x6f, 0x72, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, - 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x4b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x46, 0x6f, 0x72, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x1f, 0x49, 0x6e, 0x74, 0x65, + 0x6b, 0x65, 0x79, 0x2a, 0x2b, 0x0a, 0x0f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x41, 0x6c, 0x67, + 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x45, 0x53, 0x5f, 0x32, 0x35, + 0x36, 0x5f, 0x47, 0x43, 0x4d, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x54, 0x50, 0x10, 0x01, + 0x32, 0xb9, 0x06, 0x0a, 0x09, 0x4b, 0x6d, 0x73, 0x54, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x12, 0x6a, + 0x0a, 0x14, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x28, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, + 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0b, 0x53, 0x79, + 0x6e, 0x63, 0x51, 0x6b, 0x64, 0x42, 0x75, 0x6c, 0x6b, 0x12, 0x1f, 0x2e, 0x6b, 0x6d, 0x73, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x6b, 0x64, 0x42, + 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6b, 0x6d, 0x73, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x51, 0x6b, 0x64, + 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, + 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x46, 0x6f, 0x72, 0x42, + 0x75, 0x6c, 0x6b, 0x12, 0x25, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, + 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x73, 0x46, 0x6f, 0x72, 0x42, + 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6b, 0x6d, 0x73, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4b, 0x65, 0x79, + 0x49, 0x64, 0x73, 0x46, 0x6f, 0x72, 0x42, 0x75, 0x6c, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x8e, 0x01, 0x0a, 0x1f, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, + 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x4e, 0x65, 0x67, + 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x4e, 0x65, 0x67, 0x6f, 0x74, + 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, + 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, - 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x6b, 0x6d, - 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x43, - 0x6f, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x4b, 0x65, 0x79, 0x4e, 0x65, - 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x34, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x49, - 0x6e, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, - 0x4b, 0x65, 0x79, 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x46, - 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x2e, 0x6b, 0x6d, 0x73, 0x69, + 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x0d, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, + 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6b, - 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x46, 0x6f, + 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x61, 0x0a, 0x10, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, + 0x69, 0x6e, 0x67, 0x12, 0x24, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, + 0x6d, 0x2e, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6b, 0x6d, 0x73, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x61, 0x0a, 0x10, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, - 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x24, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x41, 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, - 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6b, - 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x41, 0x63, 0x6b, 0x4b, 0x65, - 0x79, 0x46, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x11, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x6b, 0x6d, 0x73, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, - 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x26, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, - 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0b, 0x4b, - 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x12, 0x1f, 0x2e, 0x6b, 0x6d, 0x73, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, - 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6b, 0x6d, - 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, - 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0xb0, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x63, 0x6f, 0x6d, 0x42, 0x10, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, - 0x69, 0x2e, 0x68, 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, - 0x71, 0x75, 0x61, 0x6e, 0x74, 0x2f, 0x67, 0x6f, 0x4b, 0x4d, 0x53, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, - 0x0b, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xca, 0x02, 0x0b, 0x4b, - 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xe2, 0x02, 0x17, 0x4b, 0x6d, 0x73, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0b, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, - 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x00, 0x12, 0x64, 0x0a, 0x11, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, + 0x49, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x44, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x12, 0x1f, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x4b, 0x65, 0x79, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xb0, 0x01, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, + 0x42, 0x10, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x66, 0x62, 0x69, 0x2e, 0x68, + 0x2d, 0x64, 0x61, 0x2e, 0x64, 0x65, 0x2f, 0x64, 0x61, 0x6e, 0x65, 0x74, 0x2f, 0x71, 0x75, 0x61, + 0x6e, 0x74, 0x2f, 0x67, 0x6f, 0x4b, 0x4d, 0x53, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xa2, 0x02, 0x03, 0x4b, 0x58, 0x58, 0xaa, 0x02, 0x0b, 0x4b, 0x6d, + 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xca, 0x02, 0x0b, 0x4b, 0x6d, 0x73, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0xe2, 0x02, 0x17, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0b, 0x4b, 0x6d, 0x73, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6d, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1207,50 +1281,54 @@ func file_kmsintercom_kmsintercom_proto_rawDescGZIP() []byte { return file_kmsintercom_kmsintercom_proto_rawDescData } +var file_kmsintercom_kmsintercom_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_kmsintercom_kmsintercom_proto_msgTypes = make([]protoimpl.MessageInfo, 17) var file_kmsintercom_kmsintercom_proto_goTypes = []any{ - (*InterComCapabilitiesRequest)(nil), // 0: kmsintercom.InterComCapabilitiesRequest - (*InterComCapabilitiesReply)(nil), // 1: kmsintercom.InterComCapabilitiesReply - (*SyncQkdBulkRequest)(nil), // 2: kmsintercom.SyncQkdBulkRequest - (*SyncKeyIdsForBulkRequest)(nil), // 3: kmsintercom.SyncKeyIdsForBulkRequest - (*SyncKeyIdsForBulkResponse)(nil), // 4: kmsintercom.SyncKeyIdsForBulkResponse - (*SyncQkdBulkResponse)(nil), // 5: kmsintercom.SyncQkdBulkResponse - (*InterComTransportKeyNegotiationRequest)(nil), // 6: kmsintercom.InterComTransportKeyNegotiationRequest - (*InterComTransportKeyNegotiationResponse)(nil), // 7: kmsintercom.InterComTransportKeyNegotiationResponse - (*KeyForwardingRequest)(nil), // 8: kmsintercom.KeyForwardingRequest - (*KeyForwardingResponse)(nil), // 9: kmsintercom.KeyForwardingResponse - (*AckKeyForwardingRequest)(nil), // 10: kmsintercom.AckKeyForwardingRequest - (*AckKeyForwardingResponse)(nil), // 11: kmsintercom.AckKeyForwardingResponse - (*KeyIdNotificationRequest)(nil), // 12: kmsintercom.KeyIdNotificationRequest - (*KeyIdNotificationResponse)(nil), // 13: kmsintercom.KeyIdNotificationResponse - (*KeyDeliveryRequest)(nil), // 14: kmsintercom.KeyDeliveryRequest - (*KeyDeliveryResponse)(nil), // 15: kmsintercom.KeyDeliveryResponse - (*Key)(nil), // 16: kmsintercom.Key + (CryptoAlgorithm)(0), // 0: kmsintercom.CryptoAlgorithm + (*InterComCapabilitiesRequest)(nil), // 1: kmsintercom.InterComCapabilitiesRequest + (*InterComCapabilitiesReply)(nil), // 2: kmsintercom.InterComCapabilitiesReply + (*SyncQkdBulkRequest)(nil), // 3: kmsintercom.SyncQkdBulkRequest + (*SyncKeyIdsForBulkRequest)(nil), // 4: kmsintercom.SyncKeyIdsForBulkRequest + (*SyncKeyIdsForBulkResponse)(nil), // 5: kmsintercom.SyncKeyIdsForBulkResponse + (*SyncQkdBulkResponse)(nil), // 6: kmsintercom.SyncQkdBulkResponse + (*InterComTransportKeyNegotiationRequest)(nil), // 7: kmsintercom.InterComTransportKeyNegotiationRequest + (*InterComTransportKeyNegotiationResponse)(nil), // 8: kmsintercom.InterComTransportKeyNegotiationResponse + (*KeyForwardingRequest)(nil), // 9: kmsintercom.KeyForwardingRequest + (*KeyForwardingResponse)(nil), // 10: kmsintercom.KeyForwardingResponse + (*AckKeyForwardingRequest)(nil), // 11: kmsintercom.AckKeyForwardingRequest + (*AckKeyForwardingResponse)(nil), // 12: kmsintercom.AckKeyForwardingResponse + (*KeyIdNotificationRequest)(nil), // 13: kmsintercom.KeyIdNotificationRequest + (*KeyIdNotificationResponse)(nil), // 14: kmsintercom.KeyIdNotificationResponse + (*KeyDeliveryRequest)(nil), // 15: kmsintercom.KeyDeliveryRequest + (*KeyDeliveryResponse)(nil), // 16: kmsintercom.KeyDeliveryResponse + (*Key)(nil), // 17: kmsintercom.Key } var file_kmsintercom_kmsintercom_proto_depIdxs = []int32{ - 16, // 0: kmsintercom.KeyForwardingRequest.key:type_name -> kmsintercom.Key - 16, // 1: kmsintercom.KeyDeliveryRequest.keys:type_name -> kmsintercom.Key - 0, // 2: kmsintercom.KmsTalker.InterComCapabilities:input_type -> kmsintercom.InterComCapabilitiesRequest - 2, // 3: kmsintercom.KmsTalker.SyncQkdBulk:input_type -> kmsintercom.SyncQkdBulkRequest - 3, // 4: kmsintercom.KmsTalker.SyncKeyIdsForBulk:input_type -> kmsintercom.SyncKeyIdsForBulkRequest - 6, // 5: kmsintercom.KmsTalker.InterComTransportKeyNegotiation:input_type -> kmsintercom.InterComTransportKeyNegotiationRequest - 8, // 6: kmsintercom.KmsTalker.KeyForwarding:input_type -> kmsintercom.KeyForwardingRequest - 10, // 7: kmsintercom.KmsTalker.AckKeyForwarding:input_type -> kmsintercom.AckKeyForwardingRequest - 12, // 8: kmsintercom.KmsTalker.KeyIdNotification:input_type -> kmsintercom.KeyIdNotificationRequest - 14, // 9: kmsintercom.KmsTalker.KeyDelivery:input_type -> kmsintercom.KeyDeliveryRequest - 1, // 10: kmsintercom.KmsTalker.InterComCapabilities:output_type -> kmsintercom.InterComCapabilitiesReply - 5, // 11: kmsintercom.KmsTalker.SyncQkdBulk:output_type -> kmsintercom.SyncQkdBulkResponse - 4, // 12: kmsintercom.KmsTalker.SyncKeyIdsForBulk:output_type -> kmsintercom.SyncKeyIdsForBulkResponse - 7, // 13: kmsintercom.KmsTalker.InterComTransportKeyNegotiation:output_type -> kmsintercom.InterComTransportKeyNegotiationResponse - 9, // 14: kmsintercom.KmsTalker.KeyForwarding:output_type -> kmsintercom.KeyForwardingResponse - 11, // 15: kmsintercom.KmsTalker.AckKeyForwarding:output_type -> kmsintercom.AckKeyForwardingResponse - 13, // 16: kmsintercom.KmsTalker.KeyIdNotification:output_type -> kmsintercom.KeyIdNotificationResponse - 15, // 17: kmsintercom.KmsTalker.KeyDelivery:output_type -> kmsintercom.KeyDeliveryResponse - 10, // [10:18] is the sub-list for method output_type - 2, // [2:10] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 0, // 0: kmsintercom.KeyForwardingRequest.cryptoAlgorithm:type_name -> kmsintercom.CryptoAlgorithm + 17, // 1: kmsintercom.KeyForwardingRequest.key:type_name -> kmsintercom.Key + 0, // 2: kmsintercom.KeyDeliveryRequest.cryptoAlgorithm:type_name -> kmsintercom.CryptoAlgorithm + 17, // 3: kmsintercom.KeyDeliveryRequest.keys:type_name -> kmsintercom.Key + 1, // 4: kmsintercom.KmsTalker.InterComCapabilities:input_type -> kmsintercom.InterComCapabilitiesRequest + 3, // 5: kmsintercom.KmsTalker.SyncQkdBulk:input_type -> kmsintercom.SyncQkdBulkRequest + 4, // 6: kmsintercom.KmsTalker.SyncKeyIdsForBulk:input_type -> kmsintercom.SyncKeyIdsForBulkRequest + 7, // 7: kmsintercom.KmsTalker.InterComTransportKeyNegotiation:input_type -> kmsintercom.InterComTransportKeyNegotiationRequest + 9, // 8: kmsintercom.KmsTalker.KeyForwarding:input_type -> kmsintercom.KeyForwardingRequest + 11, // 9: kmsintercom.KmsTalker.AckKeyForwarding:input_type -> kmsintercom.AckKeyForwardingRequest + 13, // 10: kmsintercom.KmsTalker.KeyIdNotification:input_type -> kmsintercom.KeyIdNotificationRequest + 15, // 11: kmsintercom.KmsTalker.KeyDelivery:input_type -> kmsintercom.KeyDeliveryRequest + 2, // 12: kmsintercom.KmsTalker.InterComCapabilities:output_type -> kmsintercom.InterComCapabilitiesReply + 6, // 13: kmsintercom.KmsTalker.SyncQkdBulk:output_type -> kmsintercom.SyncQkdBulkResponse + 5, // 14: kmsintercom.KmsTalker.SyncKeyIdsForBulk:output_type -> kmsintercom.SyncKeyIdsForBulkResponse + 8, // 15: kmsintercom.KmsTalker.InterComTransportKeyNegotiation:output_type -> kmsintercom.InterComTransportKeyNegotiationResponse + 10, // 16: kmsintercom.KmsTalker.KeyForwarding:output_type -> kmsintercom.KeyForwardingResponse + 12, // 17: kmsintercom.KmsTalker.AckKeyForwarding:output_type -> kmsintercom.AckKeyForwardingResponse + 14, // 18: kmsintercom.KmsTalker.KeyIdNotification:output_type -> kmsintercom.KeyIdNotificationResponse + 16, // 19: kmsintercom.KmsTalker.KeyDelivery:output_type -> kmsintercom.KeyDeliveryResponse + 12, // [12:20] is the sub-list for method output_type + 4, // [4:12] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_kmsintercom_kmsintercom_proto_init() } @@ -1469,13 +1547,14 @@ func file_kmsintercom_kmsintercom_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_kmsintercom_kmsintercom_proto_rawDesc, - NumEnums: 0, + NumEnums: 1, NumMessages: 17, NumExtensions: 0, NumServices: 1, }, GoTypes: file_kmsintercom_kmsintercom_proto_goTypes, DependencyIndexes: file_kmsintercom_kmsintercom_proto_depIdxs, + EnumInfos: file_kmsintercom_kmsintercom_proto_enumTypes, MessageInfos: file_kmsintercom_kmsintercom_proto_msgTypes, }.Build() File_kmsintercom_kmsintercom_proto = out.File diff --git a/goKMS/api/kmsintercom/kmsintercom/kmsintercom.proto b/goKMS/api/kmsintercom/kmsintercom/kmsintercom.proto index acd7f935bf319375e9bb8b405e009b649784586b..ce06666107b91624b961cdec79fa52380c9060d8 100644 --- a/goKMS/api/kmsintercom/kmsintercom/kmsintercom.proto +++ b/goKMS/api/kmsintercom/kmsintercom/kmsintercom.proto @@ -4,111 +4,118 @@ package kmsintercom; // should be renamed to InterCom or KMSInterCom service KmsTalker { - rpc InterComCapabilities (InterComCapabilitiesRequest) returns (InterComCapabilitiesReply) {} - rpc SyncQkdBulk(SyncQkdBulkRequest) returns (SyncQkdBulkResponse) {} - rpc SyncKeyIdsForBulk(SyncKeyIdsForBulkRequest) returns (SyncKeyIdsForBulkResponse) {} - rpc InterComTransportKeyNegotiation(InterComTransportKeyNegotiationRequest) returns (InterComTransportKeyNegotiationResponse) {} - rpc KeyForwarding(KeyForwardingRequest) returns (KeyForwardingResponse) {} - rpc AckKeyForwarding(AckKeyForwardingRequest) returns (AckKeyForwardingResponse) {} - // KeyIDNotification is used for ETSI GS QKD 014 - rpc KeyIdNotification(KeyIdNotificationRequest) returns (KeyIdNotificationResponse) {} - rpc KeyDelivery(KeyDeliveryRequest) returns (KeyDeliveryResponse) {} + rpc InterComCapabilities(InterComCapabilitiesRequest) returns (InterComCapabilitiesReply) {} + rpc SyncQkdBulk(SyncQkdBulkRequest) returns (SyncQkdBulkResponse) {} + rpc SyncKeyIdsForBulk(SyncKeyIdsForBulkRequest) returns (SyncKeyIdsForBulkResponse) {} + rpc InterComTransportKeyNegotiation(InterComTransportKeyNegotiationRequest) returns (InterComTransportKeyNegotiationResponse) {} + rpc KeyForwarding(KeyForwardingRequest) returns (KeyForwardingResponse) {} + rpc AckKeyForwarding(AckKeyForwardingRequest) returns (AckKeyForwardingResponse) {} + // KeyIDNotification is used for ETSI GS QKD 014 + rpc KeyIdNotification(KeyIdNotificationRequest) returns (KeyIdNotificationResponse) {} + rpc KeyDelivery(KeyDeliveryRequest) returns (KeyDeliveryResponse) {} } // Capabilities // The request message containing the requesting kms' name. message InterComCapabilitiesRequest { - int64 timestamp = 1; - string kmsId = 2; - bool resetKeyStore = 3; + int64 timestamp = 1; + string kmsId = 2; + bool resetKeyStore = 3; } // The response message containing the replying kms' name. message InterComCapabilitiesReply { - int64 timestamp = 1; - string peerKmsName= 2; + int64 timestamp = 1; + string peerKmsName = 2; } message SyncQkdBulkRequest { - int64 timestamp = 1; - string kmsId = 2; - repeated int64 bulkId = 3; - //string bulkHash = 4; + int64 timestamp = 1; + string kmsId = 2; + repeated int64 bulkId = 3; + //string bulkHash = 4; } message SyncKeyIdsForBulkRequest { - int64 timestamp = 1; - string kmsId = 2; - int64 bulkId = 3; - repeated string keyId = 4; + int64 timestamp = 1; + string kmsId = 2; + int64 bulkId = 3; + repeated string keyId = 4; } message SyncKeyIdsForBulkResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message SyncQkdBulkResponse { - int64 timestamp = 1; - int64 bulkId = 2; + int64 timestamp = 1; + int64 bulkId = 2; } // Beim aushandeln message InterComTransportKeyNegotiationRequest { - int64 timestamp = 1; - string pathID = 2; - string keyToUse = 3; + int64 timestamp = 1; + string pathID = 2; + string keyToUse = 3; } message InterComTransportKeyNegotiationResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message KeyForwardingRequest { - int64 timestamp = 1; - string pathId = 2; - string processId = 3; - Key key = 4; + int64 timestamp = 1; + string pathId = 2; + string processId = 3; + CryptoAlgorithm cryptoAlgorithm = 4; + Key key = 5; } message KeyForwardingResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message AckKeyForwardingRequest { - int64 timestamp = 1; - string pathId = 2; - string processId = 3; - string KeyId = 4; + int64 timestamp = 1; + string pathId = 2; + string processId = 3; + string KeyId = 4; } message AckKeyForwardingResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message KeyIdNotificationRequest { - int64 timestamp = 1; - string kmsId = 2; - repeated string keyIds = 3; + int64 timestamp = 1; + string kmsId = 2; + repeated string keyIds = 3; } message KeyIdNotificationResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message KeyDeliveryRequest { - int64 timestamp = 1; - string kmsId = 3; - string keyId = 4; - string requestId = 5; - repeated Key keys = 6; + int64 timestamp = 1; + string kmsId = 3; + string keyId = 4; + string requestId = 5; + CryptoAlgorithm cryptoAlgorithm = 6; + repeated Key keys = 7; } message KeyDeliveryResponse { - int64 timestamp = 1; + int64 timestamp = 1; } message Key { - string id = 1; - string nonce = 2; - string key = 3; + string id = 1; + string nonce = 2; + string key = 3; +} + +enum CryptoAlgorithm { + AES_256_GCM = 0; + OTP = 1; } diff --git a/goKMS/config/config.go b/goKMS/config/config.go index 7ea24a6cee7875a48aaa3810be9eeb0983c23258..c29da1cc48361e2b78dd3ed9a2c32f90f1af886c 100644 --- a/goKMS/config/config.go +++ b/goKMS/config/config.go @@ -13,6 +13,7 @@ type Config struct { QuantumAddr string `yaml:"QuantumAddr"` AKMS AKMS `yaml:"AKMS"` GnmiBindAddress string `yaml:"GnmiBindAddress"` + KSACryptoAlgorithm string `yaml:"KSACryptoAlgorithm"` KmsTLS TLSConfig `yaml:"KmsTLS"` Peers []Peer `yaml:"Peers"` GnmiTLS TLSConfig `yaml:"GnmiTLS"` @@ -31,6 +32,7 @@ type AKMS struct { type Peer struct { PeerId string `yaml:"PeerId"` PeerInterComAddr string `yaml:"PeerInterComAddr"` + CryptoAlgorithm string `yaml:"CryptoAlgorithm"` Type string `yaml:"Type"` QuantumModule QuantumModule `yaml:"QuantumModule"` } diff --git a/goKMS/kms/crypto/aes.go b/goKMS/kms/crypto/aes.go new file mode 100644 index 0000000000000000000000000000000000000000..30ba3cabc5541ac42d09fa53fa3d9ffdbec8ad32 --- /dev/null +++ b/goKMS/kms/crypto/aes.go @@ -0,0 +1,83 @@ +package crypto + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "io" +) + +// AES is an implementation of the CryptoAlgorithm interface. +// AES provides the methods required for performing symmetric key encryption +// and decryption using the AES algorithm. +// +// For this the aes package from the Go standard library is used. +type AES struct { + name string +} + +// NewAES creates a new instance of a AES struct. +func NewAES(name string) *AES { + return &AES{ + name: name, + } +} + +// Encrypt encrypts the plaintext using a provided key. +// The key should have a length of 16, 24 or 32 bytes to select AES-128, +// AES-192 or AES-256. +// The method returns the nonce, the encrypted output and an error if something +// went wrong. +func (a *AES) Encrypt(plaintext []byte, key []byte) ([]byte, []byte, error) { + // create a new cipher block from the key + c, err := aes.NewCipher(key) + if err != nil { + return nil, nil, err + } + + // create a new block cipher wrapped in GCM with default nonce (12 + // bytes) and tag size (16 bytes). + gcm, err := cipher.NewGCM(c) + if err != nil { + return nil, nil, err + } + + // generate a random nonce of nonce size (12 bytes) + nonce := make([]byte, gcm.NonceSize()) + if _, err = io.ReadFull(rand.Reader, nonce); err != nil { + return nil, nil, err + } + + // Encrypt the plaintext using AES-GCM + // Destination is set to nil, therefore seal only contains the + // ciphertext with the tag appended. + seal := gcm.Seal(nil, nonce, plaintext, nil) + + return nonce, seal, nil +} + +// Decrypt decrypts the ciphertext using the provided key and nonce. +// The key should have a length of 16, 24 or 32 bytes to select AES-128, +// AES-192 or AES-256. +// The method returns the decrypted input. +func (a *AES) Decrypt(nonce, ciphertext []byte, key []byte) ([]byte, error) { + // create a new cipher block from the key + c, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + + // create a new block cipher wrapped in GCM with default nonce (12 + // bytes) and tag size (16 bytes). + gcm, err := cipher.NewGCM(c) + if err != nil { + return nil, err + } + + // Decrypt the ciphertext using AES-GCM + return gcm.Open(nil, nonce, ciphertext, nil) +} + +func (a *AES) Name() string { + return a.name +} diff --git a/goKMS/kms/crypto/crypto_test.go b/goKMS/kms/crypto/aes_test.go similarity index 99% rename from goKMS/kms/crypto/crypto_test.go rename to goKMS/kms/crypto/aes_test.go index 24dc8bd21eec0ddf6c3d702de2364f9eb8ffb02a..f6f4301c1927cf7da2e181548c855ceff7981b09 100644 --- a/goKMS/kms/crypto/crypto_test.go +++ b/goKMS/kms/crypto/aes_test.go @@ -49,7 +49,7 @@ func TestCrypto_AES_Encrypt(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - aes := NewAES() + aes := NewAES("AES-256-GCM") nonce, cipherText, err := aes.Encrypt(test.plaintext, test.key) if test.error { assert.Error(t, err) @@ -175,7 +175,7 @@ func TestCrypto_AES_Decrypt(t *testing.T) { t.Run(name, func(t *testing.T) { t.Parallel() - aes := NewAES() + aes := NewAES("AES-256-GCM") plainText, err := aes.Decrypt(test.nonce, test.cipherText, test.key) if test.error { assert.Error(t, err) @@ -191,7 +191,7 @@ func TestCrypto_AES_EncryptAndDecryptPlaintext(t *testing.T) { secret := []byte("this is a secret") key := []byte{0xfe, 0x34, 0x64, 0x9e, 0xdf, 0x1a, 0xf1, 0xc, 0xb7, 0x28, 0xee, 0x98, 0xe7, 0x7, 0x40, 0x8f, 0x3b, 0x8, 0x9a, 0xad, 0x45, 0x7a, 0x21, 0xe8, 0x84, 0x79, 0xc5, 0x1b, 0x25, 0x13, 0xa2, 0x3c} - aes := NewAES() + aes := NewAES("AES-256-GCM") // encrypt the secret with encrypt method nonce, encryptedSecret, err := aes.Encrypt(secret, key) diff --git a/goKMS/kms/crypto/crypto.go b/goKMS/kms/crypto/crypto.go index 960c8c921c2750029e30bb856fb7df99024e42a8..0b5b4e7bdb8e3b5f432adc443163bbbfe815c69d 100644 --- a/goKMS/kms/crypto/crypto.go +++ b/goKMS/kms/crypto/crypto.go @@ -1,12 +1,5 @@ package crypto -import ( - "crypto/aes" - "crypto/cipher" - "crypto/rand" - "io" -) - // CryptoAlgorithm is an interface that provides the methods required for // encryption and decryption of data. // Currently only AES is supported, but this could be extended to support other @@ -14,71 +7,5 @@ import ( type CryptoAlgorithm interface { Encrypt(plaintext []byte, key []byte) ([]byte, []byte, error) Decrypt(nonce, ciphertext []byte, key []byte) ([]byte, error) -} - -// AES is an implementation of the CryptoAlgorithm interface. -// AES provides the methods required for performing symmetric key encryption -// and decryption using the AES algorithm. -// -// For this the aes package from the Go standard library is used. -type AES struct{} - -// NewAES creates a new instance of a AES struct. -func NewAES() *AES { - return &AES{} -} - -// Encrypt encrypts the plaintext using a provided key. -// The key should have a length of 16, 24 or 32 bytes to select AES-128, -// AES-192 or AES-256. -// The method returns the nonce, the encrypted output and an error if something -// went wrong. -func (a *AES) Encrypt(plaintext []byte, key []byte) ([]byte, []byte, error) { - // create a new cipher block from the key - c, err := aes.NewCipher(key) - if err != nil { - return nil, nil, err - } - - // create a new block cipher wrapped in GCM with default nonce (12 - // bytes) and tag size (16 bytes). - gcm, err := cipher.NewGCM(c) - if err != nil { - return nil, nil, err - } - - // generate a random nonce of nonce size (12 bytes) - nonce := make([]byte, gcm.NonceSize()) - if _, err = io.ReadFull(rand.Reader, nonce); err != nil { - return nil, nil, err - } - - // Encrypt the plaintext using AES-GCM - // Destination is set to nil, therefore seal only contains the - // ciphertext with the tag appended. - seal := gcm.Seal(nil, nonce, plaintext, nil) - - return nonce, seal, nil -} - -// Decrypt decrypts the ciphertext using the provided key and nonce. -// The key should have a length of 16, 24 or 32 bytes to select AES-128, -// AES-192 or AES-256. -// The method returns the decrypted input. -func (a *AES) Decrypt(nonce, ciphertext []byte, key []byte) ([]byte, error) { - // create a new cipher block from the key - c, err := aes.NewCipher(key) - if err != nil { - return nil, err - } - - // create a new block cipher wrapped in GCM with default nonce (12 - // bytes) and tag size (16 bytes). - gcm, err := cipher.NewGCM(c) - if err != nil { - return nil, err - } - - // Decrypt the ciphertext using AES-GCM - return gcm.Open(nil, nonce, ciphertext, nil) + Name() string } diff --git a/goKMS/kms/crypto/otp.go b/goKMS/kms/crypto/otp.go new file mode 100644 index 0000000000000000000000000000000000000000..9deed97f1893deeb9dbf5e608b9dfd45c544f16d --- /dev/null +++ b/goKMS/kms/crypto/otp.go @@ -0,0 +1,49 @@ +package crypto + +import "fmt" + +type OTP struct { + name string +} + +func NewOTP(name string) *OTP { + return &OTP{ + name: name, + } +} + +func (o *OTP) Encrypt(plaintext []byte, key []byte) ([]byte, []byte, error) { + plainTextLen := len(plaintext) + keyLen := len(key) + if plainTextLen != keyLen { + return nil, nil, fmt.Errorf("For OTP the length of plaintext and key must not differ. Length of plaintext: %d, length of key: %d", plainTextLen, keyLen) + } + + ciphertext := make([]byte, plainTextLen) + + for i := range ciphertext { + ciphertext[i] = plaintext[i] ^ key[i] + } + + return nil, ciphertext, nil +} + +func (o *OTP) Decrypt(nonce, ciphertext []byte, key []byte) ([]byte, error) { + cipherTextLen := len(ciphertext) + keyLen := len(key) + if cipherTextLen != keyLen { + return nil, fmt.Errorf("For OTP the length of ciphertext and key must not differ. Length of ciphertext: %d, length of key: %d", cipherTextLen, keyLen) + } + + plaintext := make([]byte, cipherTextLen) + + for i := range plaintext { + plaintext[i] = ciphertext[i] ^ key[i] + } + + return plaintext, nil +} + +func (o *OTP) Name() string { + return o.name +} diff --git a/goKMS/kms/crypto/otp_test.go b/goKMS/kms/crypto/otp_test.go new file mode 100644 index 0000000000000000000000000000000000000000..0f6bf530defbfd4d40feffcc9214bd30fa1d9e35 --- /dev/null +++ b/goKMS/kms/crypto/otp_test.go @@ -0,0 +1,40 @@ +package crypto + +import ( + "crypto/rand" + "testing" + + "github.com/stretchr/testify/assert" +) + +// TestCrypto_OTP tests if a byte array is XOR'ed the proper way. +func TestCrypto_OTP_XOR(t *testing.T) { + testByteArray := []byte{0xF} + testByteArray2 := []byte{0xF0} + resultByteArray := make([]byte, len(testByteArray)) + + for i := range testByteArray { + resultByteArray[i] = testByteArray[i] ^ testByteArray2[i] + } + + assert.Equal(t, resultByteArray, []byte{0xFF}) +} + +func TestCrypto_OTP_EncryptAndDecryptPlaintext(t *testing.T) { + secret := []byte("this is a secret") + + key := make([]byte, len(secret)) + _, err := rand.Read(key) + assert.NoError(t, err) + + otp := NewOTP("OTP") + + // encrypt the secret with encrypt method + _, encryptedSecret, err := otp.Encrypt(secret, key) + assert.NoError(t, err) + + // decrypt the encryptedSecret with decrypt method + decryptedSecret, err := otp.Decrypt(nil, encryptedSecret, key) + assert.NoError(t, err) + assert.Equal(t, secret, decryptedSecret) +} diff --git a/goKMS/kms/crypto/utils.go b/goKMS/kms/crypto/utils.go index 2f4bab0accb02b6c0b69c753712931cefa3b2748..f5b02a636c5781cc353fb09d3acddfada62f6477 100644 --- a/goKMS/kms/crypto/utils.go +++ b/goKMS/kms/crypto/utils.go @@ -3,6 +3,7 @@ package crypto import ( "crypto/rand" "encoding/base64" + "fmt" "github.com/google/uuid" ) @@ -46,3 +47,14 @@ func Random256BitKey() (*Key, error) { KeyAsBase64: keyAsBase64String, }, nil } + +func GetCryptoAlgorithmByName(cryptoAlgorithmName string) (CryptoAlgorithm, error) { + switch cryptoAlgorithmName { + case "AES_256_GCM": + return NewAES(cryptoAlgorithmName), nil + case "OTP": + return NewOTP(cryptoAlgorithmName), nil + default: + return nil, fmt.Errorf("The provided crypto algorithm name: %s is not supported.", cryptoAlgorithmName) + } +} diff --git a/goKMS/kms/kms.go b/goKMS/kms/kms.go index 536bfc17312eca58be32a7adcd6dc79ef4f9a9ac..702573c894551ad092e6454fa8ed355f159098eb 100644 --- a/goKMS/kms/kms.go +++ b/goKMS/kms/kms.go @@ -85,8 +85,9 @@ type KMS struct { ckmsAkmsClient *akmsInterfaceClient.CkmsAkmsClient ckmsAkmsServer *akmsInterfaceServer.AKMSReceiverServer // ETSI14 Server things - etsi14Server *etsi14Server.ETSI14RESTService - keyStoreChannel chan []crypto.KSAKey + etsi14Server *etsi14Server.ETSI14RESTService + keyStoreChannel chan []crypto.KSAKey + ksaCryptoAlgorithm crypto.CryptoAlgorithm } // Will keep information about the quantum elements that this EKMS is talking to @@ -149,6 +150,13 @@ func NewKMS(kmsUUID uuid.UUID, logOutput io.Writer, logLevel log.Level, logInJso createdKMS.supportedKeyLengths[BitKeyLen256] = true + // initialize KSA crypto algorithm + createdKMS.ksaCryptoAlgorithm, err = crypto.GetCryptoAlgorithmByName(config.KSACryptoAlgorithm) + if err != nil { + log.Info("No crypto algorithm provided, or not supported -> using default.") + createdKMS.ksaCryptoAlgorithm = crypto.NewAES("AES_256_GCM") + } + // start the inter communication gRPC server go createdKMS.startGRPC() @@ -235,7 +243,14 @@ func (kms *KMS) initializePeers(config *config.Config) error { client.KmsTalkerClient = pbIC.NewKmsTalkerClient(newPeerConn) } - _, err = kms.AddPeer(peer.PeerId, peer.PeerInterComAddr, qm, client) + cryptoAlgorithm, err := crypto.GetCryptoAlgorithmByName(peer.CryptoAlgorithm) + if err != nil { + log.Info("No crypto algorithm provided, or not supported -> using default.") + cryptoAlgorithm = crypto.NewAES("AES_256_GCM") + } + log.Infof("Using %s as crypto algorithm", cryptoAlgorithm.Name()) + + _, err = kms.AddPeer(peer.PeerId, peer.PeerInterComAddr, qm, client, cryptoAlgorithm) if err != nil { log.Fatalf("Failed to create a peer: %s", err) return nil @@ -300,14 +315,14 @@ func (kms *KMS) AddQuantumElement(qm peers.QuantumModule) error { return nil } -func (kms *KMS) AddPeer(peerKmsId string, kmsPeerSocket string, servingQLE peers.QuantumModule, client *peers.GRPCClient) (*peers.KmsPeer, error) { +func (kms *KMS) AddPeer(peerKmsId string, kmsPeerSocket string, servingQLE peers.QuantumModule, client *peers.GRPCClient, cryptoAlgorithm crypto.CryptoAlgorithm) (*peers.KmsPeer, error) { // check if peer exists _, err := kms.FindPeerById(peerKmsId) if err == nil { log.Errorf("Trying to add existing peer %s, with KMS ID %s", kmsPeerSocket, peerKmsId) return nil, fmt.Errorf("trying to add existing peer %s, with KMS ID %s", kmsPeerSocket, peerKmsId) } - peer, err := peers.NewKmsPeer(peerKmsId, servingQLE, kmsPeerSocket, client, kms.eventBus, kms.gRPCTimeout) + peer, err := peers.NewKmsPeer(peerKmsId, servingQLE, cryptoAlgorithm, kmsPeerSocket, client, kms.eventBus, kms.gRPCTimeout) if err != nil { return nil, err } @@ -489,9 +504,8 @@ func (kms *KMS) GenerateAndSendKSAKey(remoteKMSId string, pathId uuid.UUID, requ ksaKeys := make([]*pbIC.Key, number) akmsKSAKeys := make([]crypto.KSAKey, number) - cryptoAlgo := crypto.NewAES() for i := 0; i < number; i++ { - ksaKey, akmsKSAKey, err := generateNewKSAKey(cryptoAlgo, platformKey.Value) + ksaKey, akmsKSAKey, err := generateNewKSAKey(kms.ksaCryptoAlgorithm, platformKey.Value) if err != nil { log.Error(err) return err @@ -653,16 +667,23 @@ func (kms *KMS) sendKSAKeysToPlatformKmsPeer(kmsPeerAddress, platformKeyID, requ } remoteClient := pbIC.NewKmsTalkerClient(remoteConn) + cryptoAlgorithmEnum, ok := pbIC.CryptoAlgorithm_value[kms.ksaCryptoAlgorithm.Name()] + if !ok { + log.Infof("Crypto algorithm provided: %s is not supported -> using default.", kms.ksaCryptoAlgorithm.Name()) + return fmt.Errorf("Crypto algorithm provided: %s is not supported -> using default.", kms.ksaCryptoAlgorithm.Name()) + } + ctx, cancel := context.WithTimeout(context.Background(), kms.gRPCTimeout) // create a new context with some metadata md := metadata.Pairs("hostname", kms.kmsName) ctx = metadata.NewOutgoingContext(ctx, md) defer cancel() _, err = remoteClient.KeyDelivery(ctx, &pbIC.KeyDeliveryRequest{ - KeyId: platformKeyID, - RequestId: requestID, - KmsId: kms.kmsUUID.String(), - Keys: ksaKeys, + KeyId: platformKeyID, + RequestId: requestID, + CryptoAlgorithm: pbIC.CryptoAlgorithm(cryptoAlgorithmEnum), + KmsId: kms.kmsUUID.String(), + Keys: ksaKeys, }) if err != nil { log.Error(err) @@ -724,9 +745,8 @@ func (kms *KMS) generateAndReturnKsaKey(receivingCKMSID, pathID uuid.UUID, numbe ksaKeysToSendToRemoteKMS := make([]*pbIC.Key, number) ksaKeysToReturn := make([]crypto.KSAKey, number) - cryptoAlgo := crypto.NewAES() for i := int64(0); i < number; i++ { - remoteKSAKey, localKSAKey, err := generateNewKSAKey(cryptoAlgo, platformKey.Value) + remoteKSAKey, localKSAKey, err := generateNewKSAKey(kms.ksaCryptoAlgorithm, platformKey.Value) if err != nil { log.Error(err) return nil, err diff --git a/goKMS/kms/kmsintercom.go b/goKMS/kms/kmsintercom.go index 6e7d61cd11254b1431550f6b8b70f51151c28bab..09c6bff8fc577701a290c0fe7e4f8c49f084759f 100644 --- a/goKMS/kms/kmsintercom.go +++ b/goKMS/kms/kmsintercom.go @@ -244,7 +244,12 @@ func (s *kmsTalkerServer) KeyForwarding(ctx context.Context, in *pb.KeyForwardin return nil, status.Errorf(codes.InvalidArgument, "") } - decryptedKey, err := s.getDecryptedKey(decryptKey.Key, route.Previous.CryptoAlgo(), in.GetKey()) + cryptoAlgorithm, err := crypto.GetCryptoAlgorithmByName(in.GetCryptoAlgorithm().String()) + if err != nil { + return nil, status.Errorf(codes.Internal, "%s", err) + } + + decryptedKey, err := s.getDecryptedKey(decryptKey.Key, cryptoAlgorithm, in.GetKey()) if err != nil { return nil, status.Errorf(codes.Internal, "%s", err) } @@ -308,8 +313,11 @@ func (s *kmsTalkerServer) KeyDelivery(ctx context.Context, in *pb.KeyDeliveryReq akmsKSAKeys := make([]crypto.KSAKey, len(in.Keys)) for i, key := range in.Keys { // decrypt the key - cryptoAlgo := crypto.NewAES() - decryptedKSAKey, err := s.getDecryptedKey(platformKey.Value, cryptoAlgo, key) + cryptoAlgorithm, err := crypto.GetCryptoAlgorithmByName(in.GetCryptoAlgorithm().String()) + if err != nil { + return nil, status.Errorf(codes.Internal, "%s", err) + } + decryptedKSAKey, err := s.getDecryptedKey(platformKey.Value, cryptoAlgorithm, key) if err != nil { return nil, status.Errorf(codes.Internal, "%s", err) } diff --git a/goKMS/kms/peers/kmsPeer.go b/goKMS/kms/peers/kmsPeer.go index 643a8dbeae24cffc7b4a6c3e82588e013fd0c455..caf14e1f4e6c298eff4fdf55555e2739dd581221 100644 --- a/goKMS/kms/peers/kmsPeer.go +++ b/goKMS/kms/peers/kmsPeer.go @@ -44,7 +44,7 @@ type KmsPeer struct { gRPCTimeout time.Duration tcpSocket *net.TCPAddr // the IP address and TCP port (aka socket) of the kms peer TcpSocketStr string // string rep. of tcpSocket - et crypto.CryptoAlgorithm + cryptoAlgorithm crypto.CryptoAlgorithm // NOTE: currently not used, could be of usage later on // name string // the name of the kms peer quit chan bool // cancel the peer goroutine @@ -52,7 +52,7 @@ type KmsPeer struct { } // TODO: check intercomaddr -> remove? -func NewKmsPeer(peerKmsId string, quantummodule QuantumModule, tcpSocketStr string, client *GRPCClient, eventBus *event.EventBus, gRPCTimeout time.Duration) (*KmsPeer, error) { +func NewKmsPeer(peerKmsId string, quantummodule QuantumModule, cryptoAlgorithm crypto.CryptoAlgorithm, tcpSocketStr string, client *GRPCClient, eventBus *event.EventBus, gRPCTimeout time.Duration) (*KmsPeer, error) { var peerKmsIdUUID uuid.UUID if peerKmsId == "" { peerKmsIdUUID = uuid.New() @@ -87,7 +87,7 @@ func NewKmsPeer(peerKmsId string, quantummodule QuantumModule, tcpSocketStr stri servingQuantumModul: quantummodule, tcpSocket: tcpSocket, TcpSocketStr: tcpSocketStr, - et: crypto.NewAES(), + cryptoAlgorithm: cryptoAlgorithm, quit: make(chan bool), eventBus: eventBus, gRPCTimeout: gRPCTimeout, @@ -113,7 +113,7 @@ func (kp *KmsPeer) QuantumModule() QuantumModule { } func (kp *KmsPeer) CryptoAlgo() crypto.CryptoAlgorithm { - return kp.et + return kp.cryptoAlgorithm } func (kp *KmsPeer) SyncBulkKeys() error { @@ -172,7 +172,7 @@ func (kp *KmsPeer) SendPayload(payload *crypto.Key, pathId, processId uuid.UUID) kp.servingQuantumModul.KeyStore().DeleteKey(key.KeyID) - nonce, encryptedPayload, err := kp.et.Encrypt(payload.Key, key.Key) + nonce, encryptedPayload, err := kp.cryptoAlgorithm.Encrypt(payload.Key, key.Key) if err != nil { return err } @@ -182,12 +182,19 @@ func (kp *KmsPeer) SendPayload(payload *crypto.Key, pathId, processId uuid.UUID) log.Infof("Sent encrypted Payload: %s with nonce: %s", encryptedPayloadAsString, nonceAsString) + cryptoAlgorithmEnum, ok := pbIC.CryptoAlgorithm_value[kp.cryptoAlgorithm.Name()] + if !ok { + log.Infof("Crypto algorithm provided: %s is not supported -> using default.", kp.cryptoAlgorithm.Name()) + return fmt.Errorf("Crypto algorithm provided: %s is not supported -> using default.", kp.cryptoAlgorithm.Name()) + } + ctx2, cancel2 := context.WithTimeout(context.Background(), kp.gRPCTimeout) defer cancel2() _, err = kp.peerClient.KeyForwarding(ctx2, &pbIC.KeyForwardingRequest{ - Timestamp: time.Now().Unix(), - PathId: pathId.String(), - ProcessId: processId.String(), + Timestamp: time.Now().Unix(), + PathId: pathId.String(), + ProcessId: processId.String(), + CryptoAlgorithm: pbIC.CryptoAlgorithm(cryptoAlgorithmEnum), Key: &pbIC.Key{ Id: payload.ID.String(), Nonce: nonceAsString, diff --git a/integration-tests/config/kms/kms_1.yaml b/integration-tests/config/kms/kms_1.yaml index 1e071d561c0064683422460e1e638eceaeb6dacf..4d55f40ce251477d1c0086aa453b42c599c8e29e 100644 --- a/integration-tests/config/kms/kms_1.yaml +++ b/integration-tests/config/kms/kms_1.yaml @@ -16,6 +16,7 @@ AKMS: CertFile: "config/ssl/kms/kms1-selfsigned.crt" KeyFile: "config/ssl/kms/kms1-selfsigned.key" GRPCTimeoutInSeconds: 600 +KSACryptoAlgorithm: AES_256_GCM KmsTLS: Active: false CAFile: "config/ssl/ca.crt" @@ -25,6 +26,7 @@ Peers: # peer to kms02 - PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2" PeerInterComAddr: kms02:50910 + CryptoAlgorithm: AES_256_GCM Type: danet # quantum module of type emulated at the given address QuantumModule: diff --git a/integration-tests/config/kms/kms_1_otp.yaml b/integration-tests/config/kms/kms_1_otp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7fb15aa208665a61a8cded18c1b3a099e940e760 --- /dev/null +++ b/integration-tests/config/kms/kms_1_otp.yaml @@ -0,0 +1,37 @@ +Id: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" +Name: kms01 +InterComAddr: 0.0.0.0:50910 +QuantumAddr: 0.0.0.0:50911 +AKMS: + RemoteAddress: "https://akms-simulator_1:4444/api/v1/keys/push_ksa_key" + ServerPort: "9696" + ClientTLS: + Active: true + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms1-selfsigned.crt" + KeyFile: "config/ssl/kms/kms1-selfsigned.key" + ServerTLS: + Active: true + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms1-selfsigned.crt" + KeyFile: "config/ssl/kms/kms1-selfsigned.key" +GRPCTimeoutInSeconds: 600 +KSACryptoAlgorithm: OTP +KmsTLS: + Active: false + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms1-selfsigned.crt" + KeyFile: "config/ssl/kms/kms1-selfsigned.key" +Peers: + # peer to kms02 + - PeerId: "5e41c291-6121-4335-84f6-41e04b8bdaa2" + PeerInterComAddr: kms02:50910 + CryptoAlgorithm: OTP + Type: danet + # quantum module of type emulated at the given address + QuantumModule: + Type: emulated + Hostname: quantumlayer_1 +ETSI14Server: + Address: ":1414" + RemoteCKMSID: "5e41c291-6121-4335-84f6-41e04b8bdaa2" diff --git a/integration-tests/config/kms/kms_2.yaml b/integration-tests/config/kms/kms_2.yaml index 58c54adee5ecd726acbb3785ad24970d7c7b25a4..b75d746da67c0c7d384b7e9ce576c78519a90db1 100644 --- a/integration-tests/config/kms/kms_2.yaml +++ b/integration-tests/config/kms/kms_2.yaml @@ -16,6 +16,7 @@ AKMS: CertFile: "config/ssl/kms/kms2-selfsigned.crt" KeyFile: "config/ssl/kms/kms2-selfsigned.key" GRPCTimeoutInSeconds: 600 +KSACryptoAlgorithm: AES_256_GCM KmsTLS: Active: false CAFile: "config/ssl/ca.crt" @@ -25,6 +26,7 @@ Peers: # peer to kms01 - PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" PeerInterComAddr: kms01:50910 + CryptoAlgorithm: AES_256_GCM Type: danet # quantum module of type emulated at the given address QuantumModule: diff --git a/integration-tests/config/kms/kms_2_otp.yaml b/integration-tests/config/kms/kms_2_otp.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1c9dabfac692b70f05a6130419fa4b66a7354dd9 --- /dev/null +++ b/integration-tests/config/kms/kms_2_otp.yaml @@ -0,0 +1,37 @@ +Id: "5e41c291-6121-4335-84f6-41e04b8bdaa2" +Name: kms02 +InterComAddr: 0.0.0.0:50910 +QuantumAddr: 0.0.0.0:50911 +AKMS: + RemoteAddress: "https://akms-simulator_2:4444/api/v1/keys/push_ksa_key" + ServerPort: "9696" + ClientTLS: + Active: true + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms2-selfsigned.crt" + KeyFile: "config/ssl/kms/kms2-selfsigned.key" + ServerTLS: + Active: true + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms2-selfsigned.crt" + KeyFile: "config/ssl/kms/kms2-selfsigned.key" +GRPCTimeoutInSeconds: 600 +KSACryptoAlgorithm: OTP +KmsTLS: + Active: false + CAFile: "config/ssl/ca.crt" + CertFile: "config/ssl/kms/kms2-selfsigned.crt" + KeyFile: "config/ssl/kms/kms2-selfsigned.key" +Peers: + # peer to kms01 + - PeerId: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" + PeerInterComAddr: kms01:50910 + CryptoAlgorithm: OTP + Type: danet + # quantum module of type emulated at the given address + QuantumModule: + Type: emulated + Hostname: quantumlayer_2 +ETSI14Server: + Address: ":1414" + RemoteCKMSID: "0ff33c82-7fe1-482b-a0ca-67565806ee4b" diff --git a/integration-tests/docker-compose-otp.yml b/integration-tests/docker-compose-otp.yml new file mode 100644 index 0000000000000000000000000000000000000000..50f043d1f732a8fb7fc8b8e4e18b1fa05021d472 --- /dev/null +++ b/integration-tests/docker-compose-otp.yml @@ -0,0 +1,111 @@ +services: + kms01: + image: gokms + command: + ["--log", "debug", "--kms_config", "/tmp/kms/config/kms_1_otp.yaml"] + volumes: + - ./config/kms/kms_1_otp.yaml:/tmp/kms/config/kms_1_otp.yaml + - ../artifacts/integration-tests/ssl:/config/ssl + ports: + - "127.0.0.1:7030:7030" + - "127.0.0.1:9696:9696" + - "127.0.0.1:1414:1414" + + kms02: + image: gokms + command: + ["--log", "debug", "--kms_config", "/tmp/kms/config/kms_2_otp.yaml"] + volumes: + - ./config/kms/kms_2_otp.yaml:/tmp/kms/config/kms_2_otp.yaml + - ../artifacts/integration-tests/ssl:/config/ssl + ports: + - "127.0.0.1:7031:7030" + - "127.0.0.1:1415:1414" + + quantumlayer_1: + image: quantumlayer + command: + [ + "--log", + "debug", + "--config", + "/tmp/quantumlayer/config/quantumlayer_1.yaml", + ] + volumes: + - ./config/quantumlayer/quantumlayer_1.yaml:/tmp/quantumlayer/config/quantumlayer_1.yaml + + quantumlayer_2: + image: quantumlayer + command: + [ + "--log", + "debug", + "--config", + "/tmp/quantumlayer/config/quantumlayer_2.yaml", + ] + volumes: + - ./config/quantumlayer/quantumlayer_2.yaml:/tmp/quantumlayer/config/quantumlayer_2.yaml + + akms-simulator_1: + image: akms-simulator + ports: + - "127.0.0.1:4444:4444" + volumes: + - ../artifacts/integration-tests/ssl:/config/ssl + command: + [ + "--ca", + "config/ssl/ca.crt", + "--cert", + "config/ssl/kms/kms2-selfsigned.crt", + "--key", + "config/ssl/kms/kms2-selfsigned.key", + ] + + akms-simulator_2: + image: akms-simulator + volumes: + - ../artifacts/integration-tests/ssl:/config/ssl + ports: + - "127.0.0.1:4445:4444" + command: + [ + "--ca", + "config/ssl/ca.crt", + "--cert", + "config/ssl/kms/kms1-selfsigned.crt", + "--key", + "config/ssl/kms/kms1-selfsigned.key", + ] + + qkdn-controller: + image: registry.code.fbi.h-da.de/demoquandt/qkdn-controller:qkdn-main + volumes: + - ./config/controller/qkdn-gosdn.toml:/app/configs/qkdn-gosdn.toml + - ./config/controller/gNMISubscriptions.txt:/app/configs/gNMISubscriptions.txt + command: --config ./configs/qkdn-gosdn.toml + ports: + - 0.0.0.0:55055:55055 + - 127.0.0.1:8080:8080 + - 127.0.0.1:40000:40000 + environment: + GOSDN_ADMIN_PASSWORD: TestPassword + + plugin-registry: + image: registry.code.fbi.h-da.de/demoquandt/qkdn-controller/plugin-registry:qkdn-main + + mongo: + image: mongo:7 + environment: + MONGO_INITDB_ROOT_USERNAME: root + MONGO_INITDB_ROOT_PASSWORD: example + + rabbitmq: + image: rabbitmq:3-management + + routing-app: + image: registry.code.fbi.h-da.de/demoquandt/qkdn-controller/routing-app:qkdn-main + entrypoint: ["./start_ra_sleep.sh"] + volumes: + - ./config/controller/start_ra_sleep.sh:/app/start_ra_sleep.sh + - ./config/controller/routing-config.yaml:/new/routing-config.yaml