From 4aea595cc6ab836b168ddf0b0ab9ef9cd94ec930 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 4 Sep 2020 11:09:22 +0300 Subject: [PATCH] [#67] Use tuple of header and signature in object head response Object.Head method returns either full header or short header. Since it can't return anything else, signature must be paired with full header in explicit tuple message. Signed-off-by: Alex Vanin --- object/service.proto | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/object/service.proto b/object/service.proto index f6a47a6..1a12d4e 100644 --- a/object/service.proto +++ b/object/service.proto @@ -239,23 +239,29 @@ message HeadRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } +// Tuple of full object header and signature of object ID. +message HeaderWithSignature { + // Full object header + Header header = 1; + + // Signed object_id to verify full header's authenticity through following steps: + // 1. Calculate SHA-256 of marshalled Headers structure. + // 2. Check if the resulting hash matched ObjectID + // 3. Check if ObjectID's signature in signature field is correct. + neo.fs.v2.refs.Signature signature = 2; +} + // Head response message HeadResponse { // Response body message Body { // Carries the requested object header or it's part oneof head{ - // Full object header - Header header = 1; + // Full object header with object ID signature + Header HeaderWithSignature = 1; // Short object header ShortHeader short_header = 2; - - // Signed object_id to verify full header's authenticity through following steps: - // 1. Calculate SHA-256 of marshalled Headers structure. - // 2. Check if the resulting hash matched ObjectID - // 3. Check if ObjectID's signature in signature field is correct. - neo.fs.v2.refs.Signature signature = 3; } } // Body of head object response message.