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

use ed25519 keys by default #7579

Merged
merged 3 commits into from
Aug 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
name: Installing dependencies
command: |
npm init -y
npm install ipfs@^0.48.1
npm install ipfs@^0.49.1-rc.2
npm install ipfs-interop@^2.0.1
npm install mocha-circleci-reporter@0.0.3
working_directory: ~/ipfs/go-ipfs/interop
Expand Down
2 changes: 1 addition & 1 deletion cmd/ipfs/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

const (
algorithmDefault = options.RSAKey
petar marked this conversation as resolved.
Show resolved Hide resolved
algorithmDefault = options.Ed25519Key
algorithmOptionName = "algorithm"
bitsOptionName = "bits"
emptyRepoOptionName = "empty-repo"
Expand Down
2 changes: 1 addition & 1 deletion core/commands/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type KeyRenameOutput struct {
}

const (
keyStoreAlgorithmDefault = options.RSAKey
keyStoreAlgorithmDefault = options.Ed25519Key
keyStoreTypeOptionName = "type"
keyStoreSizeOptionName = "size"
oldKeyOptionName = "oldkey"
Expand Down
12 changes: 6 additions & 6 deletions test/sharness/t0020-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test_ipfs_init_flags() {
ipfs init --algorithm=ed25519 --empty-repo >actual_init
;;
*)
ipfs init --bits="$RSA_BITS" --empty-repo >actual_init
ipfs init --empty-repo >actual_init
;;
esac
'
Expand Down Expand Up @@ -166,7 +166,7 @@ test_ipfs_init_flags() {
test_cmp ed25519_expected actual_init
;;
*)
test_cmp rsa_expected actual_init
test_cmp ed25519_expected actual_init
;;
esac
'
Expand All @@ -190,14 +190,14 @@ test_ipfs_init_flags ''
# test init profiles
test_expect_success "'ipfs init --profile' with invalid profile fails" '
RSA_BITS="2048" &&
test_must_fail ipfs init --bits="$RSA_BITS" --profile=nonexistent_profile 2> invalid_profile_out
test_must_fail ipfs init --profile=nonexistent_profile 2> invalid_profile_out
EXPECT="Error: invalid configuration profile: nonexistent_profile" &&
grep "$EXPECT" invalid_profile_out
'

test_expect_success "'ipfs init --profile' succeeds" '
RSA_BITS="2048" &&
ipfs init --bits="$RSA_BITS" --profile=server
ipfs init --profile=server
'

test_expect_success "'ipfs config Swarm.AddrFilters' looks good" '
Expand All @@ -211,7 +211,7 @@ test_expect_success "clean up ipfs dir" '

test_expect_success "'ipfs init --profile=test' succeeds" '
RSA_BITS="2048" &&
ipfs init --bits="$RSA_BITS" --profile=test
ipfs init --profile=test
'

test_expect_success "'ipfs config Bootstrap' looks good" '
Expand Down Expand Up @@ -244,7 +244,7 @@ test_expect_success "clean up ipfs dir" '

test_expect_success "'ipfs init --profile=lowpower' succeeds" '
RSA_BITS="2048" &&
ipfs init --bits="$RSA_BITS" --profile=lowpower
ipfs init --profile=lowpower
'

test_expect_success "'ipfs config Discovery.Routing' looks good" '
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0022-init-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test_expect_success "ipfs init succeeds" '
export IPFS_PATH="$(pwd)/.ipfs" &&
echo "IPFS_PATH: \"$IPFS_PATH\"" &&
BITS="2048" &&
ipfs init --bits="$BITS" >actual_init ||
ipfs init >actual_init ||
test_fsh cat actual_init
'

Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0025-datastores.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_description="Test non-standard datastores"

test_expect_success "'ipfs init --profile=badgerds' succeeds" '
BITS="2048" &&
ipfs init --bits="$BITS" --profile=badgerds
ipfs init --profile=badgerds
'

test_expect_success "'ipfs pin ls' works" '
Expand Down
6 changes: 3 additions & 3 deletions test/sharness/t0160-resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test_expect_success "resolve: prepare files" '
echo "a/b/c" >a/b/c &&
a_hash=$(ipfs add -q -r a | tail -n1) &&
b_hash=$(ipfs add -q -r a/b | tail -n1) &&
c_hash=$(ipfs add -q -r a/b/c | tail -n1)
a_hash_b32=$(cid-fmt -v 1 -b b %s $a_hash)
b_hash_b32=$(cid-fmt -v 1 -b b %s $b_hash)
c_hash=$(ipfs add -q -r a/b/c | tail -n1) &&
a_hash_b32=$(cid-fmt -v 1 -b b %s $a_hash) &&
b_hash_b32=$(cid-fmt -v 1 -b b %s $b_hash) &&
c_hash_b32=$(cid-fmt -v 1 -b b %s $c_hash)
'

Expand Down
6 changes: 2 additions & 4 deletions test/sharness/t0184-http-proxy-over-p2p.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ test_expect_success 'setup p2p listener on the receiver' '
'

test_expect_success 'setup environment' '
RECEIVER_ID="$(iptb attr get 1 id)"
aschmahmann marked this conversation as resolved.
Show resolved Hide resolved
RECEIVER_ID=$(ipfsi 1 id -f="<id>" --peerid-base=b58mh)
RECEIVER_ID_CIDv1=$(ipfsi 1 id -f="<id>" --peerid-base=base36)
'

test_expect_success 'handle proxy http request sends bad-gateway when remote server not available ' '
Expand Down Expand Up @@ -215,9 +216,6 @@ test_expect_success 'handle multipart/form-data http request' '
curl_send_multipart_form_request 200
'

# subdomain gateway at *.p2p.example.com requires PeerdID in base32
RECEIVER_ID_CIDv1=$( ipfs cid format -v 1 --codec libp2p-key -b base36 -- $RECEIVER_ID)

# OK: $peerid.p2p.example.com/http/index.txt
test_expect_success "handle http request to a subdomain gateway" '
serve_content "SUBDOMAIN PROVIDES ORIGIN ISOLATION PER RECEIVER_ID" &&
Expand Down