-
Notifications
You must be signed in to change notification settings - Fork 55
Vulnerability fixes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |
| import com.iemr.common.model.user.LoginRequestModel; | ||
| import com.iemr.common.model.user.LoginResponseModel; | ||
| import com.iemr.common.service.users.IEMRAdminUserService; | ||
| import com.iemr.common.utils.encryption.AESUtil; | ||
| import com.iemr.common.utils.exception.IEMRException; | ||
| import com.iemr.common.utils.mapper.InputMapper; | ||
| import com.iemr.common.utils.mapper.OutputMapper; | ||
|
|
@@ -54,6 +55,13 @@ public class IEMRAdminController { | |
| private InputMapper inputMapper = new InputMapper(); | ||
|
|
||
| private IEMRAdminUserService iemrAdminUserServiceImpl; | ||
|
|
||
| private AESUtil aesUtil; | ||
|
|
||
| @Autowired | ||
| public void setAesUtil(AESUtil aesUtil) { | ||
| this.aesUtil = aesUtil; | ||
| } | ||
|
|
||
| @Autowired | ||
| public void setIemrAdminUserService(IEMRAdminUserService iemrAdminUserService) { | ||
|
|
@@ -92,7 +100,9 @@ public String userAuthenticate( | |
| OutputResponse response = new OutputResponse(); | ||
| logger.info("userAuthenticate request - " + m_User + " " + m_User.getUserName() + " " + m_User.getPassword()); | ||
| try { | ||
| List<User> mUser = iemrAdminUserServiceImpl.userAuthenticate(m_User.getUserName(), m_User.getPassword()); | ||
| String decryptPassword = aesUtil.decrypt("Piramal12Piramal", m_User.getPassword()); | ||
| logger.info("decryptPassword : " + decryptPassword); | ||
| List<User> mUser = iemrAdminUserServiceImpl.userAuthenticate(m_User.getUserName(), decryptPassword); | ||
| JSONObject resMap = new JSONObject(); | ||
| JSONObject serviceRoleMultiMap = new JSONObject(); | ||
| JSONObject serviceRoleMap = new JSONObject(); | ||
|
|
@@ -275,7 +285,8 @@ public String superUserAuthenticate( | |
| if (!m_User.getUserName().equalsIgnoreCase("SuperAdmin")) { | ||
| throw new IEMRException("Please log with admin credentials"); | ||
| } | ||
| User mUser = iemrAdminUserServiceImpl.superUserAuthenticate(m_User.getUserName(), m_User.getPassword()); | ||
| String decryptPassword = aesUtil.decrypt("Piramal12Piramal", m_User.getPassword()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ravishanigarapu The username seems to be hardcoded here. Please check and correct. |
||
| User mUser = iemrAdminUserServiceImpl.superUserAuthenticate(m_User.getUserName(), decryptPassword); | ||
| JSONObject resMap = new JSONObject(); | ||
| JSONObject previlegeObj = new JSONObject(); | ||
| //condition added to check for concurrent login | ||
|
|
@@ -429,8 +440,9 @@ public String setPassword( | |
| } | ||
| User mUser = mUsers.get(0); | ||
| String setStatus; | ||
| noOfRowModified = iemrAdminUserServiceImpl.setForgetPassword(mUser, m_user.getPassword(), | ||
| m_user.getTransactionId(),m_user.getIsAdmin()); | ||
| String decryptPassword = aesUtil.decrypt("Piramal12Piramal", m_user.getPassword()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ravishanigarapu The username seems to be hardcoded here. Please check and correct. |
||
| noOfRowModified = iemrAdminUserServiceImpl.setForgetPassword(mUser, decryptPassword, | ||
| m_user.getTransactionId(), m_user.getIsAdmin()); | ||
| if (noOfRowModified > 0) { | ||
| setStatus = "Password Changed"; | ||
| } else { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ravishanigarapu The username seems to be hardcoded here. Please check and correct.