[
https://issues.apache.org/jira/browse/CLOUDSTACK-9632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15710060#comment-15710060
]
ASF GitHub Bot commented on CLOUDSTACK-9632:
--------------------------------------------
Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1799#discussion_r90338425
--- Diff: server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java
---
@@ -240,68 +245,71 @@ public void deleteSslCert(DeleteSslCertCmd
deleteSslCertCmd) {
}
if (projectId != null) {
- Project project = _projectMgr.getProject(projectId);
+ final Project project = _projectMgr.getProject(projectId);
if (project == null) {
throw new InvalidParameterValueException("Found no project
with id: " + projectId);
}
- List<SslCertVO> projectCertVOList =
_sslCertDao.listByAccountId(project.getProjectAccountId());
- if (projectCertVOList == null || projectCertVOList.isEmpty())
+ final List<SslCertVO> projectCertVOList =
_sslCertDao.listByAccountId(project.getProjectAccountId());
+ if (projectCertVOList == null || projectCertVOList.isEmpty()) {
return certResponseList;
+ }
_accountMgr.checkAccess(caller,
SecurityChecker.AccessType.UseEntry, true, projectCertVOList.get(0));
- for (SslCertVO cert : projectCertVOList) {
+ for (final SslCertVO cert : projectCertVOList) {
certLbMap = _lbCertDao.listByCertId(cert.getId());
certResponseList.add(createCertResponse(cert, certLbMap));
}
return certResponseList;
}
//reached here look by accountId
- List<SslCertVO> certVOList =
_sslCertDao.listByAccountId(accountId);
- if (certVOList == null || certVOList.isEmpty())
+ final List<SslCertVO> certVOList =
_sslCertDao.listByAccountId(accountId);
+ if (certVOList == null || certVOList.isEmpty()) {
return certResponseList;
+ }
_accountMgr.checkAccess(caller,
SecurityChecker.AccessType.UseEntry, true, certVOList.get(0));
- for (SslCertVO cert : certVOList) {
+ for (final SslCertVO cert : certVOList) {
certLbMap = _lbCertDao.listByCertId(cert.getId());
certResponseList.add(createCertResponse(cert, certLbMap));
}
return certResponseList;
}
- private void validate(String certInput, String keyInput, String
password, String chainInput) {
+ private void validate(final String certInput, final String keyInput,
final String password, final String chainInput) {
Certificate cert;
PrivateKey key;
List<Certificate> chain = null;
try {
cert = parseCertificate(certInput);
- key = parsePrivateKey(keyInput, password);
+ key = parsePrivateKey(keyInput);
--- End diff --
Please consider consolidating the declaration of the `cert` and `key`
variables into the `try` block, as well as, pulling lines 298-303 into the
`try` block.
> Upgrade bountycastle to 1.55+
> -----------------------------
>
> Key: CLOUDSTACK-9632
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9632
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: Rohit Yadav
> Assignee: Rohit Yadav
> Fix For: Future, 4.10.0.0
>
>
> Upgrade bountycastle library to latest versions.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)