Added SRP_VBASE_add0_user()
Signed-off-by: Antoine Salon <asalon@vmware.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7522)
This commit is contained in:
parent
495a1e5c3a
commit
51f03f1227
5 changed files with 21 additions and 2 deletions
|
@ -514,6 +514,13 @@ static SRP_user_pwd *find_user(SRP_VBASE *vb, char *username)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd)
|
||||
{
|
||||
if (sk_SRP_user_pwd_push(vb->users_pwd, user_pwd) <= 0)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
/*
|
||||
* DEPRECATED: use SRP_VBASE_get1_by_user instead.
|
||||
|
|
|
@ -6,6 +6,7 @@ SRP_VBASE_new,
|
|||
SRP_VBASE_free,
|
||||
SRP_user_pwd_free,
|
||||
SRP_VBASE_init,
|
||||
SRP_VBASE_add0_user,
|
||||
SRP_VBASE_get1_by_user,
|
||||
SRP_VBASE_get_by_user
|
||||
- Functions to create and manage a stack of SRP user verifier information
|
||||
|
@ -20,6 +21,7 @@ SRP_VBASE_get_by_user
|
|||
|
||||
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
|
||||
|
||||
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
|
||||
SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
|
||||
SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
|
||||
|
||||
|
@ -47,6 +49,10 @@ where the flag can be 'V' (valid) or 'R' (revoked).
|
|||
Note that the base64 encoding used here is non-standard so it is recommended
|
||||
to use L<srp(1)> to generate this file.
|
||||
|
||||
The SRP_VBASE_add0_user() function adds the B<user_pwd> verifier information
|
||||
to the B<vb> structure.
|
||||
The library takes ownership of B<user_pwd>, it should not be freed by the caller.
|
||||
|
||||
The SRP_VBASE_get1_by_user() function returns the password info for the user
|
||||
whose username matches B<username>. It replaces the deprecated
|
||||
SRP_VBASE_get_by_user().
|
||||
|
@ -69,6 +75,8 @@ B<SRP_ERR_VBASE_INCOMPLETE_FILE> if the file could not be parsed,
|
|||
B<SRP_ERR_MEMORY> on memory allocation failure and B<SRP_ERR_VBASE_BN_LIB>
|
||||
for invalid decoded parameter values.
|
||||
|
||||
SRP_VBASE_add0_user() returns 1 on success and 0 on failure.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<srp(1)>,
|
||||
|
@ -77,7 +85,9 @@ L<SSL_CTX_set_srp_password(3)>
|
|||
|
||||
=head1 HISTORY
|
||||
|
||||
These functions were first added to OpenSSL 1.0.1.
|
||||
SRP_VBASE_add0_user() was first added to OpenSSL 1.2.0.
|
||||
|
||||
All other functions were first added to OpenSSL 1.0.1.
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ omitted for clarity):
|
|||
pwd->v = verifier;
|
||||
pwd->info = NULL;
|
||||
|
||||
sk_SRP_user_pwd_push(srpData->users_pwd, pwd);
|
||||
SRP_VBASE_add0_user(srpData, pwd);
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ SRP_VBASE *SRP_VBASE_new(char *seed_key);
|
|||
void SRP_VBASE_free(SRP_VBASE *vb);
|
||||
int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
|
||||
|
||||
int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
|
||||
/* This method ignores the configured seed and fails for an unknown user. */
|
||||
DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username))
|
||||
/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/
|
||||
|
|
|
@ -4598,3 +4598,4 @@ EVP_MAC_do_all_sorted 4551 1_1_2 EXIST::FUNCTION:
|
|||
EVP_str2ctrl 4552 1_1_2 EXIST::FUNCTION:
|
||||
EVP_hex2ctrl 4553 1_1_2 EXIST::FUNCTION:
|
||||
EVP_PKEY_supports_digest_nid 4554 1_1_2 EXIST::FUNCTION:
|
||||
SRP_VBASE_add0_user 4555 1_1_2 EXIST::FUNCTION:SRP
|
||||
|
|
Loading…
Reference in a new issue