2014-12-01 23:55:08 +01:00
|
|
|
|
// swad_password.h: Users' passwords
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_PWD
|
|
|
|
|
#define _SWAD_PWD
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance in Spanish),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2019-01-07 21:52:19 +01:00
|
|
|
|
Copyright (C) 1999-2019 Antonio Ca<EFBFBD>as Vargas
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************* Headers ***********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/************************* Public types and constants ************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-03-07 01:56:41 +01:00
|
|
|
|
#define Pwd_MIN_CHARS_PLAIN_PASSWORD 8
|
|
|
|
|
#define Pwd_MIN_BYTES_PLAIN_PASSWORD Pwd_MIN_CHARS_PLAIN_PASSWORD
|
|
|
|
|
|
|
|
|
|
#define Pwd_MAX_CHARS_PLAIN_PASSWORD (256 - 1)
|
|
|
|
|
#define Pwd_MAX_BYTES_PLAIN_PASSWORD Pwd_MAX_CHARS_PLAIN_PASSWORD
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
2017-03-13 14:22:36 +01:00
|
|
|
|
#define Pwd_BYTES_ENCRYPTED_PASSWORD Cry_LENGTH_ENCRYPTED_STR_SHA512_BASE64
|
2017-03-13 13:33:45 +01:00
|
|
|
|
|
2014-12-01 23:55:08 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
void Pwd_GetParamUsrPwdLogin (void);
|
|
|
|
|
|
|
|
|
|
bool Pwd_CheckCurrentPassword (void);
|
|
|
|
|
bool Pwd_CheckPendingPassword (void);
|
|
|
|
|
void Pwd_AssignMyPendingPasswordToMyCurrentPassword (void);
|
|
|
|
|
|
2018-10-16 08:48:51 +02:00
|
|
|
|
void Pwd_UpdateMyPwd (void);
|
|
|
|
|
void Pwd_UpdateOtherUsrPwd (void);
|
2015-04-02 18:39:49 +02:00
|
|
|
|
|
|
|
|
|
void Pwd_PutLinkToSendNewPasswd (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
void Pwd_ShowFormSendNewPwd (void);
|
|
|
|
|
void Pwd_ChkIdLoginAndSendNewPwd (void);
|
2017-03-07 01:56:41 +01:00
|
|
|
|
int Pwd_SendNewPasswordByEmail (char NewRandomPlainPassword[Pwd_MAX_BYTES_PLAIN_PASSWORD + 1]);
|
|
|
|
|
void Pwd_SetMyPendingPassword (char PlainPassword[Pwd_MAX_BYTES_PLAIN_PASSWORD + 1]);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
|
|
|
|
|
bool Pwd_SlowCheckIfPasswordIsGood (const char *PlainPassword,
|
|
|
|
|
const char *EncryptedPassword,
|
|
|
|
|
long UsrCod);
|
|
|
|
|
bool Pwd_FastCheckIfPasswordSeemsGood (const char *PlainPassword);
|
|
|
|
|
|
2018-10-09 20:32:01 +02:00
|
|
|
|
void Pwd_ShowFormChgMyPwd (void);
|
2015-11-20 21:11:33 +01:00
|
|
|
|
void Pwd_PutFormToGetNewPasswordOnce (void);
|
2014-12-01 23:55:08 +01:00
|
|
|
|
void Pwd_PutFormToGetNewPasswordTwice (void);
|
2018-10-16 01:36:13 +02:00
|
|
|
|
void Pwd_ShowFormChgOtherUsrPwd (void);
|
2015-04-02 18:39:49 +02:00
|
|
|
|
|
2014-12-01 23:55:08 +01:00
|
|
|
|
void Pwd_AskForConfirmationOnDangerousAction (void);
|
|
|
|
|
bool Pwd_GetConfirmationOnDangerousAction (void);
|
|
|
|
|
|
|
|
|
|
#endif
|