SRP_CREATE_VERIFIER(3SSL)
πΈ SRP_CREATE_VERIFIER β SRP authentication primitives πΈ
okay bestie, welcome to SRP_CREATE_VERIFIER(3SSL), like the manual page for the SRP squad in OpenSSL π
this is the 3SSL section, so we're talkin' library functions, not commands. buckle up.
The girls on this page are: SRP_create_verifier_ex, SRP_create_verifier, SRP_create_verifier_BN_ex, SRP_create_verifier_BN, SRP_check_known_gN_param, and SRP_get_default_gN. they do SRP authentication primitives. periodt.
β¨ SYNOPSIS β¨
#include <openssl/srp.h>
so. real talk. The following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β go see openssl_user_macros(7) for the deets π«Ά
int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N,
const BIGNUM *g, OSSL_LIB_CTX *libctx,
const char *propq);
char *SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,
BIGNUM **verifier, const BIGNUM *N, const BIGNUM *g);
char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g,
OSSL_LIB_CTX *libctx, const char *propq);
char *SRP_create_verifier(const char *user, const char *pass, char **salt,
char **verifier, const char *N, const char *g);
char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N);
SRP_gN *SRP_get_default_gN(const char *id);
π¦ DESCRIPTION π¦
okay so first thing, and I need you to hear me on this one: all of the functions described on this page are deprecated. there are no available replacement functions at this time. the vibes are archival, bestie π
the verifier makers π
The SRP_create_verifier_BN_ex() function creates an SRP password verifier from the supplied parameters, exactly as defined in section 2.4 of RFC 5054, using the library context libctx and property query string propq. Any cryptographic algorithms that need to be fetched will use that libctx and propq. (peep "ALGORITHM FETCHING" in crypto(7) for the whole lore β¨)
SRP_create_verifier_BN() is the same as SRP_create_verifier_BN_ex() except it just uses the default library context and property query string. no custom settings, just vibes.
On successful exit, *verifier will point to a newly allocated BIGNUM containing the verifier, and β if a salt was not provided β *salt will be populated with a newly allocated BIGNUM containing a random salt. If *salt is not NULL then the provided salt is used instead. The caller is responsible for freeing the allocated *salt and *verifier BIGNUMs β use BN_free(3). don't be the girl who leaks memory, it's not cute π
the base64 one (historical, ngl) π§
The SRP_create_verifier() function is similar to SRP_create_verifier_BN() but all numeric parameters are in a non-standard base64 encoding originally designed for compatibility with libsrp. This is mainly present for historical compatibility and its use is discouraged. like, we're keeping it for the elders, that's it.
It is possible to pass NULL as N and an SRP group id as g instead, to load the appropriate gN values (see SRP_get_default_gN()). If both N and g are NULL, the 8192-bit SRP group parameters are used. The caller is responsible for freeing the allocated *salt and *verifier β use OPENSSL_free(3) this time, not BN_free(3), okay? different cleanup, different function, do not mix them up π
the little helpers π
The SRP_check_known_gN_param() function checks that g and N are valid SRP group parameters from RFC 5054 appendix A.
The SRP_get_default_gN() function returns the gN parameters for the RFC 5054 id SRP group size. The known ids are "1024", "1536", "2048", "3072", "4096", "6144" and "8192". that's the whole menu, bestie π
π RETURN VALUES π
SRP_create_verifier_BN_ex()andSRP_create_verifier_BN()return1on success and0on failure.SRP_create_verifier_ex()andSRP_create_verifier()returnNULLon failure and a non-NULLvalue on success:"*"if N is notNULL, and the selected group id otherwise. This value should not be freed. hands off πSRP_check_known_gN_param()returns the text representation of the group id (i.e. the prime bit size) orNULLif the arguments are not valid SRP group parameters. This value should not be freed either. same rule, same energy.SRP_get_default_gN()returnsNULLif id is not a valid group size, or the 8192-bit group parameters if id isNULL.
π EXAMPLES π
Generate and store a 8192 bit password verifier (error handling omitted for clarity):
#include <openssl/bn.h>
#include <openssl/srp.h>
const char *username = "username";
const char *password = "password";
SRP_VBASE *srpData = SRP_VBASE_new(NULL);
SRP_gN *gN = SRP_get_default_gN("8192");
BIGNUM *salt = NULL, *verifier = NULL;
SRP_create_verifier_BN_ex(username, password, &salt, &verifier, gN->N, gN->g,
NULL, NULL);
SRP_user_pwd *pwd = SRP_user_pwd_new();
SRP_user_pwd_set1_ids(pwd, username, NULL);
SRP_user_pwd_set0_sv(pwd, salt, verifier);
SRP_user_pwd_set_gN(pwd, gN->g, gN->N);
SRP_VBASE_add0_user(srpData, pwd);
π SEE ALSO π
the whole friend group, go say hi π«Ά
π HISTORY π
SRP_create_verifier_BN_ex()andSRP_create_verifier_ex()were introduced in OpenSSL 3.0.- All other functions were added in OpenSSL 1.0.1.
- All of these functions were deprecated in OpenSSL 3.0.
π COPYRIGHT π
Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
β οΈ friendly reminder bestie: everything on this page is deprecated and there's no replacement yet, so if you're out here calling these, you're basically reading the group chat from 3.0 era. still iconic, still works, but lowkey plan accordingly π
okay that's the whole page, love u, go free your BIGNUMs π
β signed, sealed, delivered from OpenSSL 4.0.3, dated 2026-09-29, manual page SRP_CREATE_VERIFIER(3SSL). bye bestie!! πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms