Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Revert " CodeQl issue fixed: Use of password hash with insufficient computational effort" #40

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/app-modules/user-login/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
matInput
[type]="hide ? 'password' : 'text'"
placeholder=""
formControlName="code"
formControlName="password"
id="password"
/>
<button
Expand Down Expand Up @@ -78,9 +78,9 @@
loginForm.controls.userName.value !== undefined &&
loginForm.controls.userName.value !== null &&
loginForm.controls.userName.value !== '' &&
loginForm.controls.code.value !== undefined &&
loginForm.controls.code.value !== null &&
loginForm.controls.code.value !== ''
loginForm.controls.password.value !== undefined &&
loginForm.controls.password.value !== null &&
loginForm.controls.password.value !== ''
)
"
type="submit"
Expand Down
8 changes: 4 additions & 4 deletions src/app/app-modules/user-login/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@

encryptWithIvSalt(salt:any, iv:any, passPhrase:any, plainText:any) {
let key = this.generateKey(salt, passPhrase);
let encrypted = CryptoJS.AES.encrypt(plainText, key, {

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort High

Password from
an access to password
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
iv: CryptoJS.enc.Hex.parse(iv)
});
return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
Expand All @@ -149,14 +149,14 @@

loginForm = this.fb.group({
userName: [''],
code: [''],
password: [''],
});

/**
* Calling user authentication API
*/
public onSubmit(): void {
let encryptedPwd = this.encrypt(this.Key_IV, this.loginForm.controls.code.value)
let encryptedPwd = this.encrypt(this.Key_IV, this.loginForm.controls.password.value)
let reqObj = {
userName: this.loginForm.controls.userName.value,
password: encryptedPwd,
Expand Down Expand Up @@ -209,7 +209,7 @@
.userLogoutPreviousSession(this.loginForm.controls.userName.value)
.subscribe((logOutFromPreviousSession: any) => {
if (logOutFromPreviousSession.statusCode === 200) {
let encryptedPwd = this.encrypt(this.Key_IV, this.loginForm.controls.code.value)
let encryptedPwd = this.encrypt(this.Key_IV, this.loginForm.controls.password.value)
let loginReqObj = {
userName: this.loginForm.controls.userName.value,
password: encryptedPwd,
Expand Down Expand Up @@ -310,7 +310,7 @@
*/


this.ctiService.getCTILoginToken(this.loginForm.controls.userName.value, this.loginForm.controls.code.value).subscribe((response:any) => {
this.ctiService.getCTILoginToken(this.loginForm.controls.userName.value, this.loginForm.controls.password.value).subscribe((response:any) => {
if(response && response.data) {
this.loginService.loginKey = response.data.login_key;
}
Expand Down
Loading