SRP_CREATE_VERIFIER(3ossl)
๐ SRP_CREATE_VERIFIER ๐
okay so bestie, welcome to the SRP_CREATE_VERIFIER(3ossl) page โ it's part of the OpenSSL manual, and it's all about the SRP authentication primitives. yes, that SRP. Secure Remote Password. the whole friend group of functions that make a password verifier happen. ๐
Also real talk up front: all of these are deprecated, and there's genuinely nothing to replace them with. not a "use this instead" situation. just... deprecated. ๐ keep that in mind, iykyk.
โจ NAME โจ
So the whole squad on this page is: 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.
Together? They're the SRP authentication primitives. that's the vibe. ๐
๐ธ SYNOPSIS ๐ธ
first things first, you gotta include the header, obviously:
#include <openssl/srp.h>
๐ซถ heads up bestie: the functions below have been deprecated since OpenSSL 3.0, and you can hide them entirely by definingOPENSSL_API_COMPATwith a suitable version value โ seeopenssl_user_macros(7).
here's the full lineup, character for character, no cap:
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 ๐ฆ
All of the functions described on this page are deprecated. and like, there are no available replacement functions at this time. none. nada. so yeah. ๐ญ say it with me: deprecated, deprecated, deprecated.
๐ง the verifier-makers
SRP_create_verifier_BN_ex() creates an SRP password verifier from the parameters you hand it, exactly as defined in section 2.4 of RFC 5054, and it does it using the library context libctx and the property query string propq. any cryptographic algorithms that need to be fetched will use that libctx and propq. if you wanna go deeper, check out "ALGORITHM FETCHING" in crypto(7). โญ
SRP_create_verifier_BN() is literally the same as SRP_create_verifier_BN_ex() except it uses the default library context and property query string. that's the only difference. slay. ๐
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. but if *salt is not NULL, then the provided salt is used instead. ๐ง and bestie, the caller is responsible for freeing the allocated *salt and *verifier BIGNUMs (use BN_free(3)). don't forget, that's an actual leak otherwise.
๐ the base64 one (historical, dw)
SRP_create_verifier() is similar to SRP_create_verifier_BN(), but all numeric parameters are in a non-standard base64 encoding โ originally designed for compatibility with libsrp. it's mainly here for historical compatibility, and its use is discouraged. ๐ฅ like it's iconic in a museum-piece way but please don't.
You can pass NULL as N and an SRP group id as g instead, to load the appropriate gN values (see SRP_get_default_gN()). and if both N and g are NULL, the 8192-bit SRP group parameters are used. ๐
For this one, the caller is responsible for freeing the allocated *salt and *verifier (use OPENSSL_free(3) โ note that's OPENSSL_free, not BN_free, this is the string-ish one, okay? ๐).
๐ the checker and the getter
SRP_check_known_gN_param() checks that g and N are valid SRP group parameters from RFC 5054 appendix A. vibe check for your group params. โจ
SRP_get_default_gN() 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 list, memorize it or screenshot it 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-NULL value on success:"*"ifNis notNULL, the selected group id otherwise. this value should not be freed. ๐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. (again!! do not free it!!)SRP_get_default_gN()returnsNULLifidis not a valid group size, or the 8192-bit group parameters ifidisNULL.
๐ EXAMPLES ๐
okay here's the moment you've been waiting for โ generate and store an 8192 bit password verifier (error handling omitted for clarity, because we're keeping it cute and readable ๐ซถ):
#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);
it's giving main character energy, honestly. ๐
๐ฎ SEE ALSO ๐ฎ
go read these next, bestie, they're the supporting cast:
โญ 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. (yes, again. it's important. ๐ญ)
๐ 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>.
and that's the whole page, diva ๐ โ this was SRP_CREATE_VERIFIER(3ossl) from OpenSSL version 3.5.6, dated 2026-04-07. go forth andโฆ honestly, maybe don't use these, they're deprecated. but now you understand them, and that's the whole point. mwah. ๐ซถโจ
๐ฆ where this page comes from
- freebsd 15.1: base 15.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms