Skip to content

Commit

Permalink
[FAB-4409] update vendored package cfssl
Browse files Browse the repository at this point in the history
Updated cfssl package to the latest revision cfssl to pull the changes
required by fab-3026

Change-Id: I8b95769c254cacd2d58cd8442d1d601db143d475
Signed-off-by: Anil Ambati <[email protected]>
  • Loading branch information
Anil Ambati committed Jul 25, 2017
1 parent e99ae75 commit 2abc451
Show file tree
Hide file tree
Showing 726 changed files with 11,759 additions and 103,989 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,30 @@ Run `go tool pprof -h` to view the options supported by the pprof tool. For more
See [FVT tests](scripts/fvt/README.md) for information on functional verification test cases.


### Updating the cfssl vendored package
Following are the steps to update cfssl package using version 1.0.8 of govendor tool.

* Remove cfssl from vendor folder
* cd $GOPATH/src/github.com/hyperledger/fabric-ca/vendor
* govendor remove github.com/cloudflare/cfssl/...
* rm -rf github.com/cloudflare/cfssl/

<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
s
* Clone cfssl repo
* cd $GOPATH/src/github.com/
* mkdir cloudflare
* cd cloudflare
* git clone https://github.com/cloudflare/cfssl.git

* Add cfssl from $GOPATH to the vendor folder
* cd $GOPATH/src/github.com/hyperledger/fabric-ca/vendor
* govendor add github.com/cloudflare/cfssl/^
* You can optionally specify revision or tag to add a particular revision of code to the vendor folder
* govendor add github.com/cloudflare/cfssl/^@abc12032

* Remove sqlx package from cfssl vendor folder. This is because certsql.NewAccessor (called by fabric-ca) requires sqlx.db object to be passed from the same package. If we were to have sqlx package both in fabric-ca and cfssl vendor folder, go compiler will throw an error
* rm -rf github.com/cloudflare/cfssl/vendor/github.com/jmoiron/sqlx

* Remove the packages that are added to the fabric-ca vendor folder that are not needed by fabric-ca


<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
18 changes: 18 additions & 0 deletions lib/certdbaccessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,24 @@ func (d *CertDBAccessor) GetUnexpiredCertificates() (crs []certdb.CertificateRec
return crs, err
}

// GetRevokedAndUnexpiredCertificates returns all revoked and unexpired certificates
func (d *CertDBAccessor) GetRevokedAndUnexpiredCertificates() ([]certdb.CertificateRecord, error) {
crs, err := d.accessor.GetRevokedAndUnexpiredCertificates()
if err != nil {
return nil, err
}
return crs, err
}

// GetRevokedAndUnexpiredCertificatesByLabel returns revoked and unexpired certificates matching the label
func (d *CertDBAccessor) GetRevokedAndUnexpiredCertificatesByLabel(label string) ([]certdb.CertificateRecord, error) {
crs, err := d.accessor.GetRevokedAndUnexpiredCertificatesByLabel(label)
if err != nil {
return nil, err
}
return crs, err
}

// RevokeCertificatesByID updates all certificates for a given ID and marks them revoked.
func (d *CertDBAccessor) RevokeCertificatesByID(id string, reasonCode int) (crs []CertRecord, err error) {
log.Debugf("DB: Revoke certificate by ID (%s)", id)
Expand Down
2 changes: 1 addition & 1 deletion lib/dbutil/dbutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func createSQLiteDBTables(datasource string) error {
}
log.Debug("Created affiliation table")

if _, err := db.Exec("CREATE TABLE IF NOT EXISTS certificates (id VARCHAR(64), serial_number bytea NOT NULL, authority_key_identifier bytea NOT NULL, ca_label bytea, status bytea NOT NULL, reason int, expiry timestamp, revoked_at timestamp, pem bytea NOT NULL, PRIMARY KEY(serial_number, authority_key_identifier))"); err != nil {
if _, err := db.Exec("CREATE TABLE IF NOT EXISTS certificates (id VARCHAR(64), serial_number blob NOT NULL, authority_key_identifier blob NOT NULL, ca_label blob, status blob NOT NULL, reason int, expiry timestamp, revoked_at timestamp, pem blob NOT NULL, PRIMARY KEY(serial_number, authority_key_identifier))"); err != nil {
return fmt.Errorf("Error creating certificates table: %s", err)
}
log.Debug("Created certificates table")
Expand Down
4 changes: 0 additions & 4 deletions vendor/github.com/cloudflare/cfssl/.dockerignore

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/github.com/cloudflare/cfssl/.gitignore

This file was deleted.

77 changes: 0 additions & 77 deletions vendor/github.com/cloudflare/cfssl/.travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions vendor/github.com/cloudflare/cfssl/BUILDING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/cloudflare/cfssl/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions vendor/github.com/cloudflare/cfssl/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions vendor/github.com/cloudflare/cfssl/api/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2abc451

Please sign in to comment.