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