소스 검색

* Cleanse the buffer used for the temporary salted pass

Bryan Drewery 17 년 전
부모
커밋
7473b413b6
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      src/userrec.c

+ 2 - 3
src/userrec.c

@@ -340,10 +340,9 @@ int u_pass_match(struct userrec *u, char *in)
 
     strlcpy(pass, in, sizeof(pass));
 
-    if (strlen(pass) > MAXPASSLEN)
-      pass[MAXPASSLEN] = 0;
     /* Pass the salted pass in so the same salt can be used */
-    char* newpass = encrypt_pass(u, pass, &cmp[1]);
+    char* newpass = encrypt_pass(u, in, &cmp[1]);
+    OPENSSL_cleanse(pass, sizeof(pass));
     if (!strcmp(cmp, newpass)) {
       free(newpass);
       return 1;