Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is >0, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "SSL_CTX_SET_SRP_PASSWORD 3ossl"
SSL_CTX_SET_SRP_PASSWORD 3ossl "2023-09-19" "3.0.11" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
SSL_CTX_set_srp_username, SSL_CTX_set_srp_password, SSL_CTX_set_srp_strength, SSL_CTX_set_srp_cb_arg, SSL_CTX_set_srp_username_callback, SSL_CTX_set_srp_client_pwd_callback, SSL_CTX_set_srp_verify_param_callback, SSL_set_srp_server_param, SSL_set_srp_server_param_pw, SSL_get_srp_g, SSL_get_srp_N, SSL_get_srp_username, SSL_get_srp_userinfo \- SRP control operations
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/ssl.h> .Ve

The following functions have been deprecated since OpenSSL 3.0, and can be hidden entirely by defining \s-1OPENSSL_API_COMPAT\s0 with a suitable version value, see openssl_user_macros\|(7):

.Vb 10 int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name); int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password); int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength); int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg); int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx, int (*cb) (SSL *s, int *ad, void *arg)); int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx, char *(*cb) (SSL *s, void *arg)); int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx, int (*cb) (SSL *s, void *arg)); \& int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g, BIGNUM *sa, BIGNUM *v, char *info); int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass, const char *grp); \& BIGNUM *SSL_get_srp_g(SSL *s); BIGNUM *SSL_get_srp_N(SSL *s); \& char *SSL_get_srp_username(SSL *s); char *SSL_get_srp_userinfo(SSL *s); .Ve

"DESCRIPTION"
Header "DESCRIPTION" All of the functions described on this page are deprecated. There are no available replacement functions at this time.

These functions provide access to \s-1SRP\s0 (Secure Remote Password) parameters, an alternate authentication mechanism for \s-1TLS. SRP\s0 allows the use of usernames and passwords over unencrypted channels without revealing the password to an eavesdropper. \s-1SRP\s0 also supplies a shared secret at the end of the authentication sequence that can be used to generate encryption keys.

The \s-1SRP\s0 protocol, version 3 is specified in \s-1RFC 2945. SRP\s0 version 6 is described in \s-1RFC 5054\s0 with applications to \s-1TLS\s0 authentication.

The SSL_CTX_set_srp_username() function sets the \s-1SRP\s0 username for ctx. This should be called on the client prior to creating a connection to the server. The length of name must be shorter or equal to 255 characters.

The SSL_CTX_set_srp_password() function sets the \s-1SRP\s0 password for ctx. This may be called on the client prior to creating a connection to the server. This overrides the effect of SSL_CTX_set_srp_client_pwd_callback().

The SSL_CTX_set_srp_strength() function sets the \s-1SRP\s0 strength for ctx. This is the minimal length of the \s-1SRP\s0 prime in bits. If not specified 1024 is used. If not satisfied by the server key exchange the connection will be rejected.

The SSL_CTX_set_srp_cb_arg() function sets an extra parameter that will be passed to all following callbacks as arg.

The SSL_CTX_set_srp_username_callback() function sets the server side callback that is invoked when an \s-1SRP\s0 username is found in a ClientHello. The callback parameters are the \s-1SSL\s0 connection s, a writable error flag ad and the extra argument arg set by SSL_CTX_set_srp_cb_arg(). This callback should setup the server for the key exchange by calling \fBSSL_set_srp_server_param() with the appropriate parameters for the received username. The username can be obtained by calling SSL_get_srp_username(). See SRP_VBASE_init\|(3) to parse the verifier file created by openssl-srp\|(1) or \fBSRP_create_verifier\|(3) to generate it. The callback should return \s-1SSL_ERROR_NONE\s0 to proceed with the server key exchange, \fB\s-1SSL3_AL_FATAL\s0 for a fatal error or any value < 0 for a retryable error. In the event of a \s-1SSL3_AL_FATAL\s0 the alert flag given by *al will be sent back. By default this will be \s-1SSL_AD_UNKNOWN_PSK_IDENTITY\s0.

The SSL_CTX_set_srp_client_pwd_callback() function sets the client password callback on the client. The callback parameters are the \s-1SSL\s0 connection s and the extra argument arg set by SSL_CTX_set_srp_cb_arg(). The callback will be called as part of the generation of the client secrets. It should return the client password in text form or \s-1NULL\s0 to abort the connection. The resulting memory will be freed by the library as part of the callback resolution. This overrides the effect of SSL_CTX_set_srp_password().

The SSL_CTX_set_srp_verify_param_callback() sets the \s-1SRP\s0 gN parameter verification callback on the client. This allows the client to perform custom verification when receiving the server \s-1SRP\s0 proposed parameters. The callback parameters are the \s-1SSL\s0 connection s and the extra argument arg set by SSL_CTX_set_srp_cb_arg(). The callback should return a positive value to accept the server parameters. Returning 0 or a negative value will abort the connection. The server parameters can be obtained by calling SSL_get_srp_N() and SSL_get_srp_g(). Sanity checks are already performed by the library after the handshake (B % N non zero, check against the strength parameter) and are not necessary. If no callback is set the g and N parameters will be checked against known \s-1RFC 5054\s0 values.

The SSL_set_srp_server_param() function sets all \s-1SRP\s0 parameters for the connection s. N and g are the \s-1SRP\s0 group parameters, sa is the user salt, v the password verifier and info is the optional user info.

The SSL_set_srp_server_param_pw() function sets all \s-1SRP\s0 parameters for the connection s by generating a random salt and a password verifier. \fBuser is the username, pass the password and grp the \s-1SRP\s0 group parameters identifier for SRP_get_default_gN\|(3).

The SSL_get_srp_g() function returns the \s-1SRP\s0 group generator for s, or from the underlying \s-1SSL_CTX\s0 if it is \s-1NULL.\s0

The SSL_get_srp_N() function returns the \s-1SRP\s0 prime for s, or from the underlying \s-1SSL_CTX\s0 if it is \s-1NULL.\s0

The SSL_get_srp_username() function returns the \s-1SRP\s0 username for s, or from the underlying \s-1SSL_CTX\s0 if it is \s-1NULL.\s0

The SSL_get_srp_userinfo() function returns the \s-1SRP\s0 user info for s, or from the underlying \s-1SSL_CTX\s0 if it is \s-1NULL.\s0

"RETURN VALUES"
Header "RETURN VALUES" All SSL_CTX_set_* functions return 1 on success and 0 on failure.

\fBSSL_set_srp_server_param() returns 1 on success and -1 on failure.

The SSL_get_SRP_* functions return a pointer to the requested data, the memory is owned by the library and should not be freed by the caller.

"EXAMPLES"
Header "EXAMPLES" Setup \s-1SRP\s0 parameters on the client:

.Vb 1 #include <openssl/ssl.h> \& const char *username = "username"; const char *password = "password"; \& SSL_CTX *ctx = SSL_CTX_new(TLS_client_method()); if (!ctx) /* Error */ if (!SSL_CTX_set_srp_username(ctx, username)) /* Error */ if (!SSL_CTX_set_srp_password(ctx, password)) /* Error */ .Ve

Setup \s-1SRP\s0 server with verifier file:

.Vb 2 #include <openssl/srp.h> #include <openssl/ssl.h> \& const char *srpvfile = "password.srpv"; \& int srpServerCallback(SSL *s, int *ad, void *arg) { SRP_VBASE *srpData = (SRP_VBASE*) arg; char *username = SSL_get_srp_username(s); \& SRP_user_pwd *user_pwd = SRP_VBASE_get1_by_user(srpData, username); if (!user_pwd) /* Error */ return SSL3_AL_FATAL; \& if (SSL_set_srp_server_param(s, user_pwd->N, user_pwd->g, user_pwd->s, user_pwd->v, user_pwd->info) < 0) /* Error */ \& SRP_user_pwd_free(user_pwd); return SSL_ERROR_NONE; } \& SSL_CTX *ctx = SSL_CTX_new(TLS_server_method()); if (!ctx) /* Error */ \& /* * seedKey should contain a NUL terminated sequence * of random non NUL bytes */ const char *seedKey; \& SRP_VBASE *srpData = SRP_VBASE_new(seedKey); if (SRP_VBASE_init(srpData, (char*) srpvfile) != SRP_NO_ERROR) /* Error */ \& SSL_CTX_set_srp_cb_arg(ctx, srpData); SSL_CTX_set_srp_username_callback(ctx, srpServerCallback); .Ve

"SEE ALSO"
Header "SEE ALSO" \fBssl\|(7), \fBopenssl-srp\|(1), \fBSRP_VBASE_new\|(3), \fBSRP_create_verifier\|(3)
"HISTORY"
Header "HISTORY" These functions were added in OpenSSL 1.0.1 and deprecated in OpenSSL 3.0.
"COPYRIGHT"
Header "COPYRIGHT" Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use this file except in compliance with the License. You can obtain a copy in the file \s-1LICENSE\s0 in the source distribution or at <https://www.openssl.org/source/license.html>.