Debian Codegraph @

upstream/debian-unstable/man3/SRP_create_verifier.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SRP_CREATE_VERIFIER 3SSL"
58 .TH SRP_CREATE_VERIFIER 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 SRP_create_verifier_ex,
65 SRP_create_verifier,
66 SRP_create_verifier_BN_ex,
67 SRP_create_verifier_BN,
68 SRP_check_known_gN_param,
69 SRP_get_default_gN
70 \&\- SRP authentication primitives
71 .SH SYNOPSIS
72 .IX Header "SYNOPSIS"
73 .Vb 1
74 \& #include <openssl/srp.h>
75 .Ve
76 .PP
77 The following functions have been deprecated since OpenSSL 3.0, and can be
78 hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
79 see \fBopenssl_user_macros\fR\|(7):
80 .PP
81 .Vb 11
82 \& int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
83 \& BIGNUM **verifier, const BIGNUM *N,
84 \& const BIGNUM *g, OSSL_LIB_CTX *libctx,
85 \& const char *propq);
86 \& char *SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
87 \& BIGNUM **verifier, const BIGNUM *N, const BIGNUM *g);
88 \& char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
89 \& char **verifier, const char *N, const char *g,
90 \& OSSL_LIB_CTX *libctx, const char *propq);
91 \& char *SRP_create_verifier(const char *user, const char *pass, char **salt,
92 \& char **verifier, const char *N, const char *g);
93 \&
94 \& char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
95 \& SRP_gN *SRP_get_default_gN(const char *id);
96 .Ve
97 .SH DESCRIPTION
98 .IX Header "DESCRIPTION"
99 All of the functions described on this page are deprecated. There are no
100 available replacement functions at this time.
101 .PP
102 The \fBSRP_create_verifier_BN_ex()\fR function creates an SRP password verifier from
103 the supplied parameters as defined in section 2.4 of RFC 5054 using the library
104 context \fIlibctx\fR and property query string \fIpropq\fR. Any cryptographic
105 algorithms that need to be fetched will use the \fIlibctx\fR and \fIpropq\fR. See
106 "ALGORITHM FETCHING" in \fBcrypto\fR\|(7).
107 .PP
108 \&\fBSRP_create_verifier_BN()\fR is the same as \fBSRP_create_verifier_BN_ex()\fR except the
109 default library context and property query string is used.
110 .PP
111 On successful exit \fI*verifier\fR will point to a newly allocated BIGNUM containing
112 the verifier and (if a salt was not provided) \fI*salt\fR will be populated with a
113 newly allocated BIGNUM containing a random salt. If \fI*salt\fR is not NULL then
114 the provided salt is used instead.
115 The caller is responsible for freeing the allocated \fI*salt\fR and \fI*verifier\fR
116 BIGNUMS (use \fBBN_free\fR\|(3)).
117 .PP
118 The \fBSRP_create_verifier()\fR function is similar to \fBSRP_create_verifier_BN()\fR but
119 all numeric parameters are in a non-standard base64 encoding originally designed
120 for compatibility with libsrp. This is mainly present for historical compatibility
121 and its use is discouraged.
122 It is possible to pass NULL as \fIN\fR and an SRP group id as \fIg\fR instead to
123 load the appropriate gN values (see \fBSRP_get_default_gN()\fR).
124 If both \fIN\fR and \fIg\fR are NULL the 8192\-bit SRP group parameters are used.
125 The caller is responsible for freeing the allocated \fI*salt\fR and \fI*verifier\fR
126 (use \fBOPENSSL_free\fR\|(3)).
127 .PP
128 The \fBSRP_check_known_gN_param()\fR function checks that \fIg\fR and \fIN\fR are valid
129 SRP group parameters from RFC 5054 appendix A.
130 .PP
131 The \fBSRP_get_default_gN()\fR function returns the gN parameters for the RFC 5054 \fIid\fR
132 SRP group size.
133 The known ids are "1024", "1536", "2048", "3072", "4096", "6144" and "8192".
134 .SH "RETURN VALUES"
135 .IX Header "RETURN VALUES"
136 \&\fBSRP_create_verifier_BN_ex()\fR and \fBSRP_create_verifier_BN()\fR return 1 on success and
137 0 on failure.
138 .PP
139 \&\fBSRP_create_verifier_ex()\fR and \fBSRP_create_verifier()\fR return NULL on failure and a
140 non-NULL value on success:
141 "*" if \fIN\fR is not NULL, the selected group id otherwise. This value should
142 not be freed.
143 .PP
144 \&\fBSRP_check_known_gN_param()\fR returns the text representation of the group id
145 (i.e. the prime bit size) or NULL if the arguments are not valid SRP group parameters.
146 This value should not be freed.
147 .PP
148 \&\fBSRP_get_default_gN()\fR returns NULL if \fIid\fR is not a valid group size,
149 or the 8192\-bit group parameters if \fIid\fR is NULL.
150 .SH EXAMPLES
151 .IX Header "EXAMPLES"
152 Generate and store a 8192 bit password verifier (error handling
153 omitted for clarity):
154 .PP
155 .Vb 2
156 \& #include <openssl/bn.h>
157 \& #include <openssl/srp.h>
158 \&
159 \& const char *username = "username";
160 \& const char *password = "password";
161 \&
162 \& SRP_VBASE *srpData = SRP_VBASE_new(NULL);
163 \&
164 \& SRP_gN *gN = SRP_get_default_gN("8192");
165 \&
166 \& BIGNUM *salt = NULL, *verifier = NULL;
167 \& SRP_create_verifier_BN_ex(username, password, &salt, &verifier, gN\->N, gN\->g,
168 \& NULL, NULL);
169 \&
170 \& SRP_user_pwd *pwd = SRP_user_pwd_new();
171 \& SRP_user_pwd_set1_ids(pwd, username, NULL);
172 \& SRP_user_pwd_set0_sv(pwd, salt, verifier);
173 \& SRP_user_pwd_set_gN(pwd, gN\->g, gN\->N);
174 \&
175 \& SRP_VBASE_add0_user(srpData, pwd);
176 .Ve
177 .SH "SEE ALSO"
178 .IX Header "SEE ALSO"
179 \&\fBopenssl\-srp\fR\|(1),
180 \&\fBSRP_VBASE_new\fR\|(3),
181 \&\fBSRP_user_pwd_new\fR\|(3)
182 .SH HISTORY
183 .IX Header "HISTORY"
184 \&\fBSRP_create_verifier_BN_ex()\fR and \fBSRP_create_verifier_ex()\fR were introduced in
185 OpenSSL 3.0. All other functions were added in OpenSSL 1.0.1.
186 .PP
187 All of these functions were deprecated in OpenSSL 3.0.
188 .SH COPYRIGHT
189 .IX Header "COPYRIGHT"
190 Copyright 2018\-2021 The OpenSSL Project Authors. All Rights Reserved.
191 .PP
192 Licensed under the Apache License 2.0 (the "License"). You may not use
193 this file except in compliance with the License. You can obtain a copy
194 in the file LICENSE in the source distribution or at
195 <https://www.openssl.org/source/license.html>.