Skip to content

Commit 4491e28

Browse files
committed
Fix Issue FAB-919 Failed to read CertificatePair
The function "ReadCertificatePair" in fabric/membersrvc/ca/ecap.go indicates that only one columns-- "cert" should be returned, but instead, there are two columns-- "cert, kdfkey" being read out at function "readCertificates" of fabric/membersrvc/ca/ca.go. https://jira.hyperledger.org/browse/FAB-919 Change-Id: I2bbb865a2da47cff73dd3de344a3ddab969c21d0 Signed-off-by: Hangyu Li <[email protected]>
1 parent 70f6a23 commit 4491e28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

membersrvc/ca/ca.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ func (ca *CA) readCertificates(id string, opt ...int64) (*sql.Rows, error) {
490490
defer mutex.RUnlock()
491491

492492
if len(opt) > 0 && opt[0] != 0 {
493-
return ca.db.Query("SELECT cert, kdfkey FROM Certificates WHERE id=? AND timestamp=? ORDER BY usage", id, opt[0])
493+
return ca.db.Query("SELECT cert FROM Certificates WHERE id=? AND timestamp=? ORDER BY usage", id, opt[0])
494494
}
495495

496-
return ca.db.Query("SELECT cert, kdfkey FROM Certificates WHERE id=?", id)
496+
return ca.db.Query("SELECT cert FROM Certificates WHERE id=?", id)
497497
}
498498

499499
func (ca *CA) readCertificateSets(id string, start, end int64) (*sql.Rows, error) {
@@ -502,7 +502,7 @@ func (ca *CA) readCertificateSets(id string, start, end int64) (*sql.Rows, error
502502
mutex.RLock()
503503
defer mutex.RUnlock()
504504

505-
return ca.db.Query("SELECT cert, kdfKey, timestamp FROM Certificates WHERE id=? AND timestamp BETWEEN ? AND ? ORDER BY timestamp", id, start, end)
505+
return ca.db.Query("SELECT cert, timestamp FROM Certificates WHERE id=? AND timestamp BETWEEN ? AND ? ORDER BY timestamp", id, start, end)
506506
}
507507

508508
func (ca *CA) readCertificateByHash(hash []byte) ([]byte, error) {

0 commit comments

Comments
 (0)