[#203] refs: Change support for different signature schemes

Remove `UNSPECIFIED` value from `SignatureScheme` enum. Make
`ECDSA_SHA512` to be default signature scheme (zero value).

Define `SignatureRFC6979` type for RFC-6979 signatures. Use it in
`Container` service.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-03-02 12:30:05 +03:00 committed by Alex Vanin
parent f6dad19bef
commit b28ce35524
4 changed files with 39 additions and 25 deletions

View file

@ -97,8 +97,7 @@ message PutRequest {
container.Container container = 1;
// Signature of a stable-marshalled container according to RFC-6979.
// Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256.
neo.fs.v2.refs.Signature signature =2;
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
}
// Body of container put request message.
Body body = 1;
@ -146,8 +145,7 @@ message DeleteRequest {
neo.fs.v2.refs.ContainerID container_id = 1;
// `ContainerID` signed with the container owner's key according to RFC-6979.
// Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256.
neo.fs.v2.refs.Signature signature = 2;
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
}
// Body of container delete request message.
Body body = 1;
@ -210,8 +208,7 @@ message GetResponse {
Container container = 1;
// Signature of a stable-marshalled container according to RFC-6979.
// Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256.
neo.fs.v2.refs.Signature signature = 2;
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
// Session token if the container was created within a session
neo.fs.v2.session.SessionToken session_token = 3;
@ -279,8 +276,7 @@ message SetExtendedACLRequest {
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL table according to RFC-6979.
// Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256.
neo.fs.v2.refs.Signature signature = 2;
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
}
// Body of set extended acl request message.
Body body = 1;
@ -346,8 +342,7 @@ message GetExtendedACLResponse {
neo.fs.v2.acl.EACLTable eacl = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979.
// Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256.
neo.fs.v2.refs.Signature signature = 2;
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
// Session token if Extended ACL was set within a session
neo.fs.v2.session.SessionToken session_token = 3;