SRP_CREATE_VERIFIER(3ossl)
π SRP_CREATE_VERIFIER π
okay so bestie, welcome to SRP_CREATE_VERIFIER(3ossl) β yes that's the 3ossl manual section, we're in OpenSSL land now π. This page is all about the SRP authentication primitives, and before you get too excited: literally every function here is deprecated π. But you still gotta know it, so let's go.
β¨ NAME β¨
SRP_create_verifier_ex, SRP_create_verifier, SRP_create_verifier_BN_ex, SRP_create_verifier_BN, SRP_check_known_gN_param, SRP_get_default_gN β the SRP authentication primitives, together at last π«Ά
πΈ SYNOPSIS πΈ
#include <openssl/srp.h>
okay so quick heads up before the code block: these functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β see openssl_user_macros(7) if you wanna do that π
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);
(yes SRP_create_verifier_BN_ex returns int and SRP_create_verifier_BN returns char * β that's not me being chaotic, that's literally the manpage, don't come for me π)
π¦ DESCRIPTION π¦
the vibe check: all of the functions on this page are deprecated. There are no available replacement functions at this time. so likeβ¦ bestie, be aware π
π the verifier-maker functions
SRP_create_verifier_BN_ex() 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 libctx and propq β see "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. no custom vibes, just defaults π
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 salt you provided is used instead. The caller is responsible for freeing the allocated *salt and *verifier BIGNUMs β use BN_free(3) π«Ά
SRP_create_verifier() is similar to SRP_create_verifier_BN() but all the 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 π (it's giving legacy, ngl). 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()). 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) π
π§ the checker & the getter
SRP_check_known_gN_param() checks that g and N are valid SRP group parameters from RFC 5054 appendix A β
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" π₯
π 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, 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. π ββοΈ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, 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);
ate, no crumbs π
π SEE ALSO π
openssl-srp(1), SRP_VBASE_new(3), SRP_user_pwd_new(3)
π 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>.
and that's the whole page bestie, go forth and be iconic with your verifiers π β¨
signing off from OpenSSL 3.5.0, dated 2026-09-25, on the SRP_CREATE_VERIFIER(3ossl) page β mwah π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms