Skip to content

Commit caab33d

Browse files
authored
Merge pull request #313 from MaggieNgWu/r2.8-hsm
auto add "sm2_" prefix of ssl key index, fix a bug
2 parents f268aa6 + 1fd3936 commit caab33d

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ext {
3737
// integrationTest.mustRunAfter test
3838
allprojects {
3939
group = 'org.fisco-bcos.java-sdk'
40-
version = '2.8.0-hsm-SNAPSHOT'
40+
version = '2.8.0-SNAPSHOT'
4141
apply plugin: 'maven'
4242
apply plugin: 'maven-publish'
4343
apply plugin: 'idea'

sdk-core/src/main/java/org/fisco/bcos/sdk/network/ConnectionManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ private SslContext initSMSslContext(ConfigOption configOption) throws NetworkExc
275275
return SMSslClientContextFactory.build(
276276
configOption.getCryptoMaterialConfig().getCaInputStream(),
277277
configOption.getCryptoMaterialConfig().getEnSSLCertInputStream(),
278-
configOption.getCryptoMaterialConfig().getEnSslKeyIndex(),
278+
"sm2_" + configOption.getCryptoMaterialConfig().getEnSslKeyIndex(),
279279
configOption.getCryptoMaterialConfig().getSdkCertInputStream(),
280-
configOption.getCryptoMaterialConfig().getSslKeyIndex());
280+
"sm2_" + configOption.getCryptoMaterialConfig().getSslKeyIndex());
281281
} else {
282282
return SMSslClientContextFactory.build(
283283
configOption.getCryptoMaterialConfig().getCaInputStream(),
@@ -293,9 +293,9 @@ private SslContext initSMSslContext(ConfigOption configOption) throws NetworkExc
293293
"initSMSslContext failed, caCert:{}, sslCert: {}, sslKeyIndex: {}, enCert: {}, enSslKeyIndex: {}, error: {}, e: {}",
294294
configOption.getCryptoMaterialConfig().getCaCertPath(),
295295
configOption.getCryptoMaterialConfig().getSdkCertPath(),
296-
configOption.getCryptoMaterialConfig().getEnSslKeyIndex(),
297-
configOption.getCryptoMaterialConfig().getEnSSLCertPath(),
298296
configOption.getCryptoMaterialConfig().getSslKeyIndex(),
297+
configOption.getCryptoMaterialConfig().getEnSSLCertPath(),
298+
configOption.getCryptoMaterialConfig().getEnSslKeyIndex(),
299299
e.getMessage(),
300300
e);
301301
} else {

sdk-crypto/src/main/java/org/fisco/bcos/sdk/crypto/CryptoSuite.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ protected void initCryptoSuite(int cryptoTypeConfig) {
115115
this.signatureImpl = new SDFSM2Signature();
116116
this.hashImpl = new SDFSM3Hash();
117117
this.keyPairFactory = new SDFSM2KeyPair();
118+
this.cryptoTypeConfig = CryptoType.SM_TYPE;
118119
} else {
119120
throw new UnsupportedCryptoTypeException(
120121
"only support "

sdk-service/src/main/java/org/fisco/bcos/sdk/client/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static Client build(
108108
return null;
109109
}
110110
CryptoSuite cryptoSuite = new CryptoSuite(cryptoType, groupManagerService.getConfig());
111-
logger.info("build client success for group {}", groupId);
111+
logger.info("build client success for group {}, crypto type {}", groupId, cryptoType);
112112
return new ClientImpl(
113113
groupManagerService, channel, groupId, cryptoSuite, nodeVersion, eventResource);
114114
}

0 commit comments

Comments
 (0)