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

Commit

Permalink
CodeQl issue fixed: Use of password hash with insufficient computatio…
Browse files Browse the repository at this point in the history
…nal effort
  • Loading branch information
Pramit Kumar Dutta authored Jan 29, 2024
1 parent 64c50bc commit 51db5a9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/app/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import * as CryptoJS from 'crypto-js';
export class loginContentClass implements OnInit {
model: any = {};
userID: any;
password: any;
code: any;
serviceProviderID: any;
status: any;
dynamictype: any = 'password';
Expand Down Expand Up @@ -139,8 +139,8 @@ export class loginContentClass implements OnInit {
return salt + iv + ciphertext;
}

login(userId: any, password: any, doLogout) {
this.encryptPassword = this.encrypt(this.Key_IV, password)
login(userId: any, tempCode: any, doLogout) {
this.encryptPassword = this.encrypt(this.Key_IV, tempCode)
if (userId.toLowerCase() === 'SUPERADMIN'.toLowerCase()) {

// this.loginservice.superAdminAuthenticate(userId, password, doLogout)
Expand Down
4 changes: 2 additions & 2 deletions src/app/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="btn-center"> <img src="assets/images/Piramal-logo-login.png" alt="Logo"> </div>
</md-card-title>
<md-card-content>
<form class="form-horizontal cu-form-horizontal-label-left" name="loginForm" (ngSubmit)="f.form.valid && login(userID,password,false)"
<form class="form-horizontal cu-form-horizontal-label-left" name="loginForm" (ngSubmit)="f.form.valid && login(userID,code,false)"
#f="ngForm" autocomplete='off'>
<div class="row">
<div class="col-xs-1 col-md-1 col-sm-1">
Expand All @@ -80,7 +80,7 @@
</div>
<div class="col-xs-11 col-md-11 col-sm-11">
<md-input-container class="full-width">
<input mdInput type="{{dynamictype}}" id="password" placeholder="Enter Password" [(ngModel)]="password" name="password" />
<input mdInput type="{{dynamictype}}" id="code" placeholder="Enter Password" [(ngModel)]="code" name="code" />
<md-icon id="eye" mdSuffix class="mat-icon material-icons cursorPointer" role="img" aria-hidden="true" mdTooltip="Show Password"
(mousedown)='showPWD()' style="color:gray">visibility</md-icon>
</md-input-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4>Reset User Password</h4>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-3 m-t-20">
<md-input-container class="width100">
<input mdInput placeholder="Enter Password" [(ngModel)]="code" name="password" minlength="8" maxlength="12" #pwrd="ngModel"
<input mdInput placeholder="Enter Password" [(ngModel)]="code" name="code" minlength="8" maxlength="12" #pwrd="ngModel"
[pattern]="passwordPattern" required>
<md-hint>
<span class="error_text" *ngIf="pwrd.errors && !(pwrd.hasError('pattern')) && pwrd.touched">Password is required</span>
Expand Down
4 changes: 2 additions & 2 deletions src/app/reset-user-password/reset-user-password.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ export class ResetUserPasswordComponent implements OnInit {


/*Reset Password*/
resetPassword(userName, password) {
resetPassword(userName, code) {
let resetObj = {
"userName": userName,
"password": this.encrypt(this.Key_IV, password),
"password": this.encrypt(this.Key_IV, code),
// "password": password,
// this.encryptPassword = this.encrypt(this.Key_IV, password)
//"statusID": 1
Expand Down

0 comments on commit 51db5a9

Please sign in to comment.