Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[add] Hash only gives wrong result on directories when using CID #4065

Closed
djdv opened this issue Jul 13, 2017 · 4 comments
Closed

[add] Hash only gives wrong result on directories when using CID #4065

djdv opened this issue Jul 13, 2017 · 4 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Milestone

Comments

@djdv
Copy link
Contributor

djdv commented Jul 13, 2017

Version information:

go-ipfs version: 0.4.11-dev-5ba22a0c7
Repo version: 5
System version: amd64/windows
Golang version: go1.8.3

Type:

Bug

Severity:

High

Description:

When using --cid-version=1 combined with -n on a directory and/or with -w, the wrong hash is returned.

>mkdir empty
>ipfs add -r --cid-version=0 empty
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn empty
>ipfs add -r --cid-version=1 empty
added zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi empty
>ipfs add -r -n --cid-version=1 empty
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn empty
@Kubuxu Kubuxu added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue labels Jul 13, 2017
@whyrusleeping whyrusleeping added this to the Ipfs 0.4.12 milestone Aug 30, 2017
@Kubuxu
Copy link
Member

Kubuxu commented Nov 6, 2017

This needs to get fixed. @magik6k do you have time to take a look at it?

@Kubuxu Kubuxu modified the milestones: Ipfs 0.4.12, go-ipfs 0.4.13 Nov 6, 2017
@kevina
Copy link
Contributor

kevina commented Nov 6, 2017

@Kubuxu I can look into this, I am the one responsible for most of the CidV1 code in the adder.

@kevina
Copy link
Contributor

kevina commented Nov 6, 2017

And this appears to be fixed in 0.4.12 (likely due to my code adding CIDv1 support to the files interface which uses related code).

$ ipfs --version
ipfs version 0.4.12-rc2
$ ipfs add -r --cid-version=0 empty
added QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn empty
 0 B / 4.00 KB [-------------------------------------------------------]   0.00%
$ ipfs add -r --cid-version=1 empty
added zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi empty
 0 B / 4.00 KB [-------------------------------------------------------]   0.00%
$ ipfs add -r -n --cid-version=1 empty
added zdj7WbTaiJT1fgatdet9Ei9iDB5hdCxkbVyhyh8YTUnXMiwYi empty
 0 B / 4.00 KB [-------------------------------------------------------]   0.00%

@Kubuxu Kubuxu modified the milestones: go-ipfs 0.4.13, Ipfs 0.4.12 Nov 6, 2017
@Kubuxu
Copy link
Member

Kubuxu commented Nov 6, 2017

Cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

4 participants