1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos SRP_create_verifier_ex, 6 1.1 christos SRP_create_verifier, 7 1.1 christos SRP_create_verifier_BN_ex, 8 1.1 christos SRP_create_verifier_BN, 9 1.1 christos SRP_check_known_gN_param, 10 1.1 christos SRP_get_default_gN 11 1.1 christos - SRP authentication primitives 12 1.1 christos 13 1.1 christos =head1 SYNOPSIS 14 1.1 christos 15 1.1 christos #include <openssl/srp.h> 16 1.1 christos 17 1.1 christos The following functions have been deprecated since OpenSSL 3.0, and can be 18 1.1 christos hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 19 1.1 christos see L<openssl_user_macros(7)>: 20 1.1 christos 21 1.1 christos int SRP_create_verifier_BN_ex(const char *user, const char *pass, BIGNUM **salt, 22 1.1 christos BIGNUM **verifier, const BIGNUM *N, 23 1.1 christos const BIGNUM *g, OSSL_LIB_CTX *libctx, 24 1.1 christos const char *propq); 25 1.1 christos char *SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 26 1.1 christos BIGNUM **verifier, const BIGNUM *N, const BIGNUM *g); 27 1.1 christos char *SRP_create_verifier_ex(const char *user, const char *pass, char **salt, 28 1.1 christos char **verifier, const char *N, const char *g, 29 1.1 christos OSSL_LIB_CTX *libctx, const char *propq); 30 1.1 christos char *SRP_create_verifier(const char *user, const char *pass, char **salt, 31 1.1 christos char **verifier, const char *N, const char *g); 32 1.1 christos 33 1.1 christos char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N); 34 1.1 christos SRP_gN *SRP_get_default_gN(const char *id); 35 1.1 christos 36 1.1 christos =head1 DESCRIPTION 37 1.1 christos 38 1.1 christos All of the functions described on this page are deprecated. There are no 39 1.1 christos available replacement functions at this time. 40 1.1 christos 41 1.1 christos The SRP_create_verifier_BN_ex() function creates an SRP password verifier from 42 1.1 christos the supplied parameters as defined in section 2.4 of RFC 5054 using the library 43 1.1 christos context I<libctx> and property query string I<propq>. Any cryptographic 44 1.1 christos algorithms that need to be fetched will use the I<libctx> and I<propq>. See 45 1.1 christos L<crypto(7)/ALGORITHM FETCHING>. 46 1.1 christos 47 1.1 christos SRP_create_verifier_BN() is the same as SRP_create_verifier_BN_ex() except the 48 1.1 christos default library context and property query string is used. 49 1.1 christos 50 1.1 christos On successful exit I<*verifier> will point to a newly allocated BIGNUM containing 51 1.1 christos the verifier and (if a salt was not provided) I<*salt> will be populated with a 52 1.1 christos newly allocated BIGNUM containing a random salt. If I<*salt> is not NULL then 53 1.1 christos the provided salt is used instead. 54 1.1 christos The caller is responsible for freeing the allocated I<*salt> and I<*verifier> 55 1.1 christos BIGNUMS (use L<BN_free(3)>). 56 1.1 christos 57 1.1 christos The SRP_create_verifier() function is similar to SRP_create_verifier_BN() but 58 1.1 christos all numeric parameters are in a non-standard base64 encoding originally designed 59 1.1 christos for compatibility with libsrp. This is mainly present for historical compatibility 60 1.1 christos and its use is discouraged. 61 1.1 christos It is possible to pass NULL as I<N> and an SRP group id as I<g> instead to 62 1.1 christos load the appropriate gN values (see SRP_get_default_gN()). 63 1.1 christos If both I<N> and I<g> are NULL the 8192-bit SRP group parameters are used. 64 1.1 christos The caller is responsible for freeing the allocated I<*salt> and I<*verifier> 65 1.1 christos (use L<OPENSSL_free(3)>). 66 1.1 christos 67 1.1 christos The SRP_check_known_gN_param() function checks that I<g> and I<N> are valid 68 1.1 christos SRP group parameters from RFC 5054 appendix A. 69 1.1 christos 70 1.1 christos The SRP_get_default_gN() function returns the gN parameters for the RFC 5054 I<id> 71 1.1 christos SRP group size. 72 1.1 christos The known ids are "1024", "1536", "2048", "3072", "4096", "6144" and "8192". 73 1.1 christos 74 1.1 christos =head1 RETURN VALUES 75 1.1 christos 76 1.1 christos SRP_create_verifier_BN_ex() and SRP_create_verifier_BN() return 1 on success and 77 1.1 christos 0 on failure. 78 1.1 christos 79 1.1 christos SRP_create_verifier_ex() and SRP_create_verifier() return NULL on failure and a 80 1.1 christos non-NULL value on success: 81 1.1 christos "*" if I<N> is not NULL, the selected group id otherwise. This value should 82 1.1 christos not be freed. 83 1.1 christos 84 1.1 christos SRP_check_known_gN_param() returns the text representation of the group id 85 1.1 christos (i.e. the prime bit size) or NULL if the arguments are not valid SRP group parameters. 86 1.1 christos This value should not be freed. 87 1.1 christos 88 1.1 christos SRP_get_default_gN() returns NULL if I<id> is not a valid group size, 89 1.1 christos or the 8192-bit group parameters if I<id> is NULL. 90 1.1 christos 91 1.1 christos =head1 EXAMPLES 92 1.1 christos 93 1.1 christos Generate and store a 8192 bit password verifier (error handling 94 1.1 christos omitted for clarity): 95 1.1 christos 96 1.1 christos #include <openssl/bn.h> 97 1.1 christos #include <openssl/srp.h> 98 1.1 christos 99 1.1 christos const char *username = "username"; 100 1.1 christos const char *password = "password"; 101 1.1 christos 102 1.1 christos SRP_VBASE *srpData = SRP_VBASE_new(NULL); 103 1.1 christos 104 1.1 christos SRP_gN *gN = SRP_get_default_gN("8192"); 105 1.1 christos 106 1.1 christos BIGNUM *salt = NULL, *verifier = NULL; 107 1.1 christos SRP_create_verifier_BN_ex(username, password, &salt, &verifier, gN->N, gN->g, 108 1.1 christos NULL, NULL); 109 1.1 christos 110 1.1 christos SRP_user_pwd *pwd = SRP_user_pwd_new(); 111 1.1 christos SRP_user_pwd_set1_ids(pwd, username, NULL); 112 1.1 christos SRP_user_pwd_set0_sv(pwd, salt, verifier); 113 1.1 christos SRP_user_pwd_set_gN(pwd, gN->g, gN->N); 114 1.1 christos 115 1.1 christos SRP_VBASE_add0_user(srpData, pwd); 116 1.1 christos 117 1.1 christos =head1 SEE ALSO 118 1.1 christos 119 1.1 christos L<openssl-srp(1)>, 120 1.1 christos L<SRP_VBASE_new(3)>, 121 1.1 christos L<SRP_user_pwd_new(3)> 122 1.1 christos 123 1.1 christos =head1 HISTORY 124 1.1 christos 125 1.1 christos SRP_create_verifier_BN_ex() and SRP_create_verifier_ex() were introduced in 126 1.1 christos OpenSSL 3.0. All other functions were added in OpenSSL 1.0.1. 127 1.1 christos 128 1.1 christos All of these functions were deprecated in OpenSSL 3.0. 129 1.1 christos 130 1.1 christos =head1 COPYRIGHT 131 1.1 christos 132 1.1 christos Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved. 133 1.1 christos 134 1.1 christos Licensed under the Apache License 2.0 (the "License"). You may not use 135 1.1 christos this file except in compliance with the License. You can obtain a copy 136 1.1 christos in the file LICENSE in the source distribution or at 137 1.1 christos L<https://www.openssl.org/source/license.html>. 138 1.1 christos 139 1.1 christos =cut 140