SRP_CREATE_VERIFIER(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… 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() and SRP_create_verifier_BN() β€” return 1 on success and 0 on failure πŸ’€
  • SRP_create_verifier_ex() and SRP_create_verifier() β€” return NULL on failure and a non-NULL value on success: "*" if N is not NULL, 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) or NULL if the arguments are not valid SRP group parameters. This value should not be freed. πŸ™…β€β™€οΈ
  • SRP_get_default_gN() β€” returns NULL if id is not a valid group size, or the 8192-bit group parameters if id is NULL 🌸

πŸ“ 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() and SRP_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 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