sdf fix
This commit is contained in:
parent
29c5fb261f
commit
aabc9c56e1
@ -151,6 +151,7 @@ public class TmkService {
|
|||||||
}
|
}
|
||||||
res.setStatus(DeviceTmkStatus.finished);
|
res.setStatus(DeviceTmkStatus.finished);
|
||||||
} else {
|
} else {
|
||||||
|
log.debug("tmk not init, start encrypt and import test ...");
|
||||||
byte[] random = sdfApi.generateRandom(hs, 16);
|
byte[] random = sdfApi.generateRandom(hs, 16);
|
||||||
EccCipher eccCipher = sdfApi.externalEncryptECC(hs, pubKey, random);
|
EccCipher eccCipher = sdfApi.externalEncryptECC(hs, pubKey, random);
|
||||||
String hk = sdfApi.importKeyWithISKECC(hs, check.getEncKeyIdx(), eccCipher);
|
String hk = sdfApi.importKeyWithISKECC(hs, check.getEncKeyIdx(), eccCipher);
|
||||||
@ -177,7 +178,9 @@ public class TmkService {
|
|||||||
device.setServiceIp("127.0.0.1");
|
device.setServiceIp("127.0.0.1");
|
||||||
device.setServicePort(8889);
|
device.setServicePort(8889);
|
||||||
device.setAccessCredentials("543");
|
device.setAccessCredentials("543");
|
||||||
device.setEncTmk(CodecUtils.encodeHex(getSoftDeviceEncTmk()));
|
if (isTmkInit()) {
|
||||||
|
device.setEncTmk(CodecUtils.encodeHex(getSoftDeviceEncTmk()));
|
||||||
|
}
|
||||||
return device;
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,10 +73,12 @@ public abstract class DeviceDTO {
|
|||||||
* 管理端口
|
* 管理端口
|
||||||
*/
|
*/
|
||||||
private Integer managePort;
|
private Integer managePort;
|
||||||
|
@NotNull(message = "加密密钥索引不能为空")
|
||||||
private Integer encKeyIdx;
|
private Integer encKeyIdx;
|
||||||
/**
|
/**
|
||||||
* 访问凭证
|
* 访问凭证
|
||||||
*/
|
*/
|
||||||
|
@NotBlank(message = "访问凭证不能为空")
|
||||||
private String accessCredentials;
|
private String accessCredentials;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
|
@ -20,6 +20,7 @@ import java.time.Duration;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author liulu
|
* @author liulu
|
||||||
@ -50,8 +51,8 @@ public class DeviceTask implements InitializingBean {
|
|||||||
if (CollectionUtils.isEmpty(records)) {
|
if (CollectionUtils.isEmpty(records)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (Device record : records) {
|
Executors.newSingleThreadExecutor().execute(() -> {
|
||||||
threadPoolTaskExecutor.execute(() -> {
|
for (Device record : records) {
|
||||||
DeviceCheckRes checkRes = tmkService.checkDevice(record);
|
DeviceCheckRes checkRes = tmkService.checkDevice(record);
|
||||||
Device up = new Device();
|
Device up = new Device();
|
||||||
up.setId(record.getId());
|
up.setId(record.getId());
|
||||||
@ -69,8 +70,8 @@ public class DeviceTask implements InitializingBean {
|
|||||||
}
|
}
|
||||||
up.setEncTmk(checkRes.getEncTmk());
|
up.setEncTmk(checkRes.getEncTmk());
|
||||||
spDeviceMapper.updateById(up);
|
spDeviceMapper.updateById(up);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,6 +140,7 @@ logging:
|
|||||||
level:
|
level:
|
||||||
root: info
|
root: info
|
||||||
com.sunyard.chsm.mapper: debug
|
com.sunyard.chsm.mapper: debug
|
||||||
|
com.sunyard.chsm.service.TmkService: debug
|
||||||
# org.springframework.web: trace
|
# org.springframework.web: trace
|
||||||
# config: classpath:log4j2.xml
|
# config: classpath:log4j2.xml
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user