-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-3228] Fix/clarify CA pathlen constraints
The name of the pathlen fields were wrong in the default config file. This change set corrects the field names and adds documentation to the generated config file and the user's guide to describe the values. It also adds a test case which shows that by default a root CA allows intermediate CAs to be enrolled, but enrolling an intermediate CA with an intermediate CA will fail (by default). The pathlen constraints of a CA allow the depth of a CA hierarchy to be limited. The CA hierarchy refers to the root CA having child intermediate CAs which can in turn have child intermediate CAs. Change-Id: I1ed202946a738ae49e91a94cca312c0b393d2325 Signed-off-by: Keith Smith <[email protected]>
- Loading branch information
Keith Smith
committed
Jun 3, 2017
1 parent
07f1a83
commit 22dc710
Showing
3 changed files
with
167 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
FABRIC_CA="$GOPATH/src/github.com/hyperledger/fabric-ca" | ||
SCRIPTDIR="$FABRIC_CA/scripts/fvt" | ||
. $SCRIPTDIR/fabric-ca_utils | ||
RC=0 | ||
|
||
TDIR=intermediateca-tests | ||
|
||
mkdir -p $TDIR/root | ||
cd $TDIR/root | ||
fabric-ca-server start -b admin:adminpw -d > server.log 2>&1& | ||
cd ../.. | ||
sleep 1 | ||
|
||
mkdir -p $TDIR/int1 | ||
cd $TDIR/int1 | ||
fabric-ca-server start -b admin:adminpw -u http://admin:adminpw@localhost:7054 -p 7055 -d > server.log 2>&1& | ||
cd ../.. | ||
sleep 1 | ||
|
||
fabric-ca-client getcacert -u http://admin:adminpw@localhost:7055 | ||
test $? -ne 0 && ErrorExit "Failed to talk to intermediate CA1" | ||
|
||
fabric-ca-server init -b admin:adminpw -u http://admin:adminpw@localhost:7055 -d | ||
test $? -eq 0 && ErrorExit "CA2 should have failed to initialize" | ||
|
||
$SCRIPTDIR/fabric-ca_setup.sh -R | ||
|
||
CleanUp $RC | ||
exit $RC |