Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
quant
Commits
c507171c
Commit
c507171c
authored
Jul 26, 2024
by
Martin Stiemerling
Browse files
Options
Downloads
Patches
Plain Diff
Added propagation over error via platfrom KeyDelivery
parent
967de7f9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!237
Adding initial ETSI 20 border node protocol and mechanics
Pipeline
#218759
failed
Jul 26, 2024
Stage: build
Stage: test
Stage: analyze
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
goKMS/kms/kms.go
+7
-1
7 additions, 1 deletion
goKMS/kms/kms.go
goKMS/kms/kmsintercom.go
+6
-1
6 additions, 1 deletion
goKMS/kms/kmsintercom.go
with
13 additions
and
2 deletions
goKMS/kms/kms.go
+
7
−
1
View file @
c507171c
...
@@ -642,7 +642,7 @@ func (kms *KMS) sendKSAKeysToPlatformKmsPeer(kmsPeerAddress, platformKeyID, requ
...
@@ -642,7 +642,7 @@ func (kms *KMS) sendKSAKeysToPlatformKmsPeer(kmsPeerAddress, platformKeyID, requ
md
:=
metadata
.
Pairs
(
"hostname"
,
kms
.
kmsName
)
md
:=
metadata
.
Pairs
(
"hostname"
,
kms
.
kmsName
)
ctx
=
metadata
.
NewOutgoingContext
(
ctx
,
md
)
ctx
=
metadata
.
NewOutgoingContext
(
ctx
,
md
)
defer
cancel
()
defer
cancel
()
_
,
err
=
remoteClient
.
KeyDelivery
(
ctx
,
&
pbIC
.
KeyDeliveryRequest
{
keyDeliveryReponse
,
err
:
=
remoteClient
.
KeyDelivery
(
ctx
,
&
pbIC
.
KeyDeliveryRequest
{
KeyId
:
platformKeyID
,
KeyId
:
platformKeyID
,
RequestId
:
requestID
,
RequestId
:
requestID
,
KmsId
:
kms
.
kmsUUID
.
String
(),
KmsId
:
kms
.
kmsUUID
.
String
(),
...
@@ -655,6 +655,11 @@ func (kms *KMS) sendKSAKeysToPlatformKmsPeer(kmsPeerAddress, platformKeyID, requ
...
@@ -655,6 +655,11 @@ func (kms *KMS) sendKSAKeysToPlatformKmsPeer(kmsPeerAddress, platformKeyID, requ
return
err
return
err
}
}
// check for errors that happened remote CKMS for ETSI20
if
!
keyDeliveryReponse
.
E20FwdOk
{
return
fmt
.
Errorf
(
"(ETSI20) forwarded key requests to remote CKMS but processing error on remote side"
)
}
return
nil
return
nil
}
}
...
@@ -722,6 +727,7 @@ func (kms *KMS) exchangeKeyAfterETSI20GetKeyRequest(receivingCKMSID uuid.UUID, r
...
@@ -722,6 +727,7 @@ func (kms *KMS) exchangeKeyAfterETSI20GetKeyRequest(receivingCKMSID uuid.UUID, r
err
=
kms
.
shipKSAKeytoPlatformKmsPeer
(
receivingCKMSID
,
pathID
,
requestID
,
keysToFwd
,
initSaedID
,
targetSaedIDs
)
err
=
kms
.
shipKSAKeytoPlatformKmsPeer
(
receivingCKMSID
,
pathID
,
requestID
,
keysToFwd
,
initSaedID
,
targetSaedIDs
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Printf
(
"(ETSI20) failed while shipping to platform KMS peer: %s"
,
err
)
log
.
Printf
(
"(ETSI20) failed while shipping to platform KMS peer: %s"
,
err
)
return
err
}
}
log
.
Printf
(
"(ETSI20) shipped platform keys to KMS peer: %s"
,
receivingCKMSID
)
log
.
Printf
(
"(ETSI20) shipped platform keys to KMS peer: %s"
,
receivingCKMSID
)
...
...
This diff is collapsed.
Click to expand it.
goKMS/kms/kmsintercom.go
+
6
−
1
View file @
c507171c
...
@@ -318,6 +318,8 @@ func (s *kmsTalkerServer) KeyDelivery(ctx context.Context, in *pb.KeyDeliveryReq
...
@@ -318,6 +318,8 @@ func (s *kmsTalkerServer) KeyDelivery(ctx context.Context, in *pb.KeyDeliveryReq
}
}
}
}
e20result
:=
false
if
s
.
kms
.
keyStoreChannel
!=
nil
&&
in
.
GetRequestId
()
==
etsi014RequestID
{
if
s
.
kms
.
keyStoreChannel
!=
nil
&&
in
.
GetRequestId
()
==
etsi014RequestID
{
log
.
Debugf
(
"(ETSI14) Pushing to KeyStoreChannel: %v in %s"
,
s
.
kms
.
keyStoreChannel
,
s
.
kms
.
kmsName
)
log
.
Debugf
(
"(ETSI14) Pushing to KeyStoreChannel: %v in %s"
,
s
.
kms
.
keyStoreChannel
,
s
.
kms
.
kmsName
)
s
.
kms
.
keyStoreChannel
<-
akmsKSAKeys
s
.
kms
.
keyStoreChannel
<-
akmsKSAKeys
...
@@ -334,12 +336,15 @@ func (s *kmsTalkerServer) KeyDelivery(ctx context.Context, in *pb.KeyDeliveryReq
...
@@ -334,12 +336,15 @@ func (s *kmsTalkerServer) KeyDelivery(ctx context.Context, in *pb.KeyDeliveryReq
err
=
e20bnClient
.
ETSI20ForwardExternal
(
initID
,
targetID
,
akmsKSAKeys
)
err
=
e20bnClient
.
ETSI20ForwardExternal
(
initID
,
targetID
,
akmsKSAKeys
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Errorf
(
"(ETSI20 cannot forward to ETSI20 bordnernode %s due to %s"
,
httpAString
,
err
)
log
.
Errorf
(
"(ETSI20 cannot forward to ETSI20 bordnernode %s due to %s"
,
httpAString
,
err
)
e20result
=
false
}
else
{
e20result
=
true
}
}
}
else
if
s
.
kms
.
ckmsAkmsClient
!=
nil
{
}
else
if
s
.
kms
.
ckmsAkmsClient
!=
nil
{
go
s
.
kms
.
ckmsAkmsClient
.
SendKSAKeysToRequestingInstances
(
in
.
GetRequestId
(),
platformKey
.
ProcessId
,
akmsKSAKeys
)
//nolint:errcheck
go
s
.
kms
.
ckmsAkmsClient
.
SendKSAKeysToRequestingInstances
(
in
.
GetRequestId
(),
platformKey
.
ProcessId
,
akmsKSAKeys
)
//nolint:errcheck
}
}
return
&
pb
.
KeyDeliveryResponse
{
Timestamp
:
time
.
Now
()
.
Unix
()},
nil
return
&
pb
.
KeyDeliveryResponse
{
Timestamp
:
time
.
Now
()
.
Unix
()
,
E20FwdOk
:
e20result
},
nil
}
}
func
(
s
*
kmsTalkerServer
)
getDecryptedKey
(
keyForDecryption
[]
byte
,
cryptoAlgorithm
crypto
.
CryptoAlgorithm
,
encryptedKey
*
pb
.
Key
)
([]
byte
,
error
)
{
func
(
s
*
kmsTalkerServer
)
getDecryptedKey
(
keyForDecryption
[]
byte
,
cryptoAlgorithm
crypto
.
CryptoAlgorithm
,
encryptedKey
*
pb
.
Key
)
([]
byte
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment