]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SRP_VBASE_new.pod
Update copyright year
[thirdparty/openssl.git] / doc / man3 / SRP_VBASE_new.pod
CommitLineData
495a1e5c
AS
1=pod
2
3=head1 NAME
4
5SRP_VBASE_new,
6SRP_VBASE_free,
495a1e5c 7SRP_VBASE_init,
51f03f12 8SRP_VBASE_add0_user,
495a1e5c
AS
9SRP_VBASE_get1_by_user,
10SRP_VBASE_get_by_user
11- Functions to create and manage a stack of SRP user verifier information
12
13=head1 SYNOPSIS
14
15 #include <openssl/srp.h>
16
13888e79
MC
17Deprecated since OpenSSL 3.0, can be hidden entirely by defining
18B<OPENSSL_API_COMPAT> with a suitable version value, see
19L<openssl_user_macros(7)>:
20
495a1e5c
AS
21 SRP_VBASE *SRP_VBASE_new(char *seed_key);
22 void SRP_VBASE_free(SRP_VBASE *vb);
495a1e5c
AS
23
24 int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
25
51f03f12 26 int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
495a1e5c
AS
27 SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
28 SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
29
30=head1 DESCRIPTION
31
13888e79
MC
32All of the functions described on this page are deprecated. There are no
33available replacement functions at this time.
34
495a1e5c 35The SRP_VBASE_new() function allocates a structure to store server side SRP
ebfd055b
AS
36verifier information.
37If B<seed_key> is not NULL a copy is stored and used to generate dummy parameters
38for users that are not found by SRP_VBASE_get1_by_user(). This allows the server
39to hide the fact that it doesn't have a verifier for a particular username,
40as described in section 2.5.1.3 'Unknown SRP' of RFC 5054.
495a1e5c
AS
41The seed string should contain random NUL terminated binary data (therefore
42the random data should not contain NUL bytes!).
43
44The SRP_VBASE_free() function frees up the B<vb> structure.
45If B<vb> is NULL, nothing is done.
46
495a1e5c
AS
47The SRP_VBASE_init() function parses the information in a verifier file and
48populates the B<vb> structure.
49The verifier file is a text file containing multiple entries, whose format is:
50flag base64(verifier) base64(salt) username gNid userinfo(optional)
51where the flag can be 'V' (valid) or 'R' (revoked).
52Note that the base64 encoding used here is non-standard so it is recommended
1903a9b7 53to use L<openssl-srp(1)> to generate this file.
495a1e5c 54
51f03f12 55The SRP_VBASE_add0_user() function adds the B<user_pwd> verifier information
ebfd055b
AS
56to the B<vb> structure. See L<SRP_user_pwd_new(3)> to create and populate this
57record.
51f03f12
AS
58The library takes ownership of B<user_pwd>, it should not be freed by the caller.
59
495a1e5c
AS
60The SRP_VBASE_get1_by_user() function returns the password info for the user
61whose username matches B<username>. It replaces the deprecated
62SRP_VBASE_get_by_user().
63If no matching user is found but a seed_key and default gN parameters have been
64set, dummy authentication information is generated from the seed_key, allowing
65the server to hide the fact that it doesn't have a verifier for a particular
66username. When using SRP as a TLS authentication mechanism, this will cause
67the handshake to proceed normally but the first client will be rejected with
68a "bad_record_mac" alert, as if the password was incorrect.
69If no matching user is found and the seed_key is not set, NULL is returned.
70Ownership of the returned pointer is released to the caller, it must be freed
71with SRP_user_pwd_free().
72
73=head1 RETURN VALUES
74
75SRP_VBASE_init() returns B<SRP_NO_ERROR> (0) on success and a positive value
76on failure.
77The error codes are B<SRP_ERR_OPEN_FILE> if the file could not be opened,
78B<SRP_ERR_VBASE_INCOMPLETE_FILE> if the file could not be parsed,
79B<SRP_ERR_MEMORY> on memory allocation failure and B<SRP_ERR_VBASE_BN_LIB>
80for invalid decoded parameter values.
81
51f03f12
AS
82SRP_VBASE_add0_user() returns 1 on success and 0 on failure.
83
495a1e5c
AS
84=head1 SEE ALSO
85
1903a9b7 86L<openssl-srp(1)>,
495a1e5c 87L<SRP_create_verifier(3)>,
ebfd055b 88L<SRP_user_pwd_new(3)>,
495a1e5c
AS
89L<SSL_CTX_set_srp_password(3)>
90
91=head1 HISTORY
92
4674aaf4 93The SRP_VBASE_add0_user() function was added in OpenSSL 3.0.
51f03f12 94
fc5ecadd 95All other functions were added in OpenSSL 1.0.1.
495a1e5c 96
13888e79
MC
97All of these functions were deprecated in OpenSSL 3.0.
98
495a1e5c
AS
99=head1 COPYRIGHT
100
a28d06f3 101Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
495a1e5c 102
4746f25a 103Licensed under the Apache License 2.0 (the "License"). You may not use
495a1e5c
AS
104this file except in compliance with the License. You can obtain a copy
105in the file LICENSE in the source distribution or at
106L<https://www.openssl.org/source/license.html>.
107
108=cut