Code Monkey home page Code Monkey logo

examples's People

Contributors

dajiaji avatar ivajloip avatar jfhammell avatar jimsch avatar or13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

examples's Issues

file Examples/ecdsa-examples/ecdsa-sig-01.json

This file says:

     "key":{
        "kty":"EC",
        "kid":"11",

but, page 38 of draft-ietf-cose-msg-24.txt says:

o  The 'kty' field MUST be present and it MUST be 'EC2'.

while the kty field is not part of the signature this did raise some concern that I'm verifying with the wrong group! Please confirm that this file using the NIST 'nistp256' curve? (not secp256XX?)

I'm feeding the following digest into the signature validation:
(byebug) sha256.unpack("H*")
["45e243bb7071e72a288416ccb9cfbd2932fe1926916fe85b344141ecce91e4bb"]

(byebug) sig01_pub_key
#<ECDSA::Point: nistp256, 0xbac5b11cad8f99f9c72b05cf4b9e26d244dc189f745228255a219a86d6a09eff, 0x20138b0b706db558af8254ab7804a3a64b6d72ccf5adbedbb4a2eff045f8>

(byebug) signature
#<ECDSA::Signature:0x00000001f1df00 @s=51765963774164195565914350724151000343397507914291589008366842864028004758943, @r=106251839252054433277813174560343063247957774643926440805394321619487281072353>

I wonder if I've gotten something trivial screwed up? Order or r/s maybe.

Label for "kid" in encryption examples is wrong

In the following example, the unprotected map has two items, the "alg" and "kid":

"unprotected":{
"alg":"direct",
"kid":"our-secret"
}

But in the encoded data, we find label 5:

"cbor_diag":"16([h'A0', {1: 1, 5: h'02D1F7E6F26C43D4868D87CE'}, h'60973A94BB2898009EE52ECFD9AB1DD25867374B24BEE54AA5D797C8DC845929ACAA47EF'])",

According to https://www.iana.org/assignments/cose/cose.xhtml#header-parameters, "kid" is 4 and "IV" is 5.

Missing LICENSE file

I am trying to implement my own COSE library and I would like to include these examples in my repository for testing purposes and bits of them in unit tests, however, there is clear no license associated with these examples, so I am not sure if I am allowed to copy or transform them in any way.

ecdsa-01 and ecdsa-02 have changed from cose_sign1 to cose_sign.

A previous version of this repo had ecdsa-01 (or probably -02) using cose_sign1.
The latest version is using cose_sign, which moves the algorithm identifiers into the array[4], rather than the global protected bucket. Bad on my code for not handling both, but I wanted to make sure that the change was intentional, and query whether there are any cose_sign1 examples.

ecdsa-01.json has invalid base64 for y value

The y-value listed in the file:

 "y":"IBOL-C3BttVivg-lSreASjpkttcsz-1rb7btKLv8EX4",

is not valid base64! "-" is not a base64 character according to https://en.wikipedia.org/wiki/Base64 and RFC4648. My ruby decoding does not automatically process it. Your encoding is base64url encoded.

Base64.urlsafe_decode64(str) solves this problem, but I wonder if the examples should be coded
into stock base64?

Why ./sign1-tests/sign-pass-01.json is categorized as a valid/pass scenario?

From https://datatracker.ietf.org/doc/html/rfc8152#section-3.1 alg:

This parameter MUST be authenticated where the ability to do so exists... This authentication can be done either by placing the header in the protected header bucket or as part of the externally supplied data.

But the example https://github.com/cose-wg/Examples/blob/master/sign1-tests/sign-pass-01.json puts the alg in the unprotected bucket, the protected bucket is a0 (empty) and there is no externally supplied data.

Also, what does "Redo protected" mean in "title":"sign-pass-01: Redo protected"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.