Skip to content

Commit 8b89e76

Browse files
oncillaromshark
andauthored
proto/crypto: rename HeaderAndBody (scionproto#4840)
Rename the internal message HeaderAndBodyInternal to HeaderAndBody. While it is internal and does not appear on the wire, we still need to reference the message in the specification. Having internal in the name can be confusing. --------- Co-authored-by: Roman Sharkov <roman.scharkov@gmail.com>
1 parent 0f98660 commit 8b89e76

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

pkg/proto/crypto/signed.pb.go

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/scrypto/signed/msg.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func Sign(hdr Header, body []byte, signer crypto.Signer,
8181
if err != nil {
8282
return nil, serrors.Wrap("packing header", err)
8383
}
84-
hdrAndBody := &cryptopb.HeaderAndBodyInternal{
84+
hdrAndBody := &cryptopb.HeaderAndBody{
8585
Header: rawHdr,
8686
Body: body,
8787
}
@@ -205,7 +205,7 @@ func extractHeaderAndBody(signed *cryptopb.SignedMessage) (*Header, []byte, erro
205205
if signed == nil {
206206
return nil, nil, serrors.New("nil message")
207207
}
208-
var hdrAndBody cryptopb.HeaderAndBodyInternal
208+
var hdrAndBody cryptopb.HeaderAndBody
209209
if err := proto.Unmarshal(signed.HeaderAndBody, &hdrAndBody); err != nil {
210210
return nil, nil, err
211211
}

pkg/scrypto/signed/msg_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func TestVerify(t *testing.T) {
361361
priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
362362
require.NoError(t, err)
363363

364-
hdrAndBody := &cryptopb.HeaderAndBodyInternal{
364+
hdrAndBody := &cryptopb.HeaderAndBody{
365365
Header: []byte("someweirdmalformedthingy"),
366366
Body: []byte("body"),
367367
}

private/mgmtapi/segments/api/api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func TestAPI(t *testing.T) {
187187
if err != nil {
188188
return nil, serrors.Wrap("packing header", err)
189189
}
190-
hdrAndBody := &cryptopb.HeaderAndBodyInternal{
190+
hdrAndBody := &cryptopb.HeaderAndBody{
191191
Header: rawHdr,
192192
Body: msg,
193193
}

proto/crypto/v1/signed.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ message Header {
5656

5757
// Low-level representation of HeaderAndBody used for signature computation
5858
// input. This should not be used by external code.
59-
message HeaderAndBodyInternal {
59+
message HeaderAndBody {
6060
// Enocded header suitable for signature computation.
6161
bytes header = 1;
6262
// Raw payload suitable for signature computation.

0 commit comments

Comments
 (0)