Home | History | Annotate | Line # | Download | only in man3
      1  1.1  christos =pod
      2  1.1  christos 
      3  1.1  christos =head1 NAME
      4  1.1  christos 
      5  1.1  christos SRP_VBASE_new,
      6  1.1  christos SRP_VBASE_free,
      7  1.1  christos SRP_VBASE_init,
      8  1.1  christos SRP_VBASE_add0_user,
      9  1.1  christos SRP_VBASE_get1_by_user,
     10  1.1  christos SRP_VBASE_get_by_user
     11  1.1  christos - Functions to create and manage a stack of SRP user verifier information
     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  SRP_VBASE *SRP_VBASE_new(char *seed_key);
     22  1.1  christos  void SRP_VBASE_free(SRP_VBASE *vb);
     23  1.1  christos 
     24  1.1  christos  int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
     25  1.1  christos 
     26  1.1  christos  int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
     27  1.1  christos  SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
     28  1.1  christos  SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
     29  1.1  christos 
     30  1.1  christos =head1 DESCRIPTION
     31  1.1  christos 
     32  1.1  christos All of the functions described on this page are deprecated. There are no
     33  1.1  christos available replacement functions at this time.
     34  1.1  christos 
     35  1.1  christos The SRP_VBASE_new() function allocates a structure to store server side SRP
     36  1.1  christos verifier information.
     37  1.1  christos If B<seed_key> is not NULL a copy is stored and used to generate dummy parameters
     38  1.1  christos for users that are not found by SRP_VBASE_get1_by_user(). This allows the server
     39  1.1  christos to hide the fact that it doesn't have a verifier for a particular username,
     40  1.1  christos as described in section 2.5.1.3 'Unknown SRP' of RFC 5054.
     41  1.1  christos The seed string should contain random NUL terminated binary data (therefore
     42  1.1  christos the random data should not contain NUL bytes!).
     43  1.1  christos 
     44  1.1  christos The SRP_VBASE_free() function frees up the B<vb> structure.
     45  1.1  christos If B<vb> is NULL, nothing is done.
     46  1.1  christos 
     47  1.1  christos The SRP_VBASE_init() function parses the information in a verifier file and
     48  1.1  christos populates the B<vb> structure.
     49  1.1  christos The verifier file is a text file containing multiple entries, whose format is:
     50  1.1  christos flag base64(verifier) base64(salt) username gNid userinfo(optional)
     51  1.1  christos where the flag can be 'V' (valid) or 'R' (revoked).
     52  1.1  christos Note that the base64 encoding used here is non-standard so it is recommended
     53  1.1  christos to use L<openssl-srp(1)> to generate this file.
     54  1.1  christos 
     55  1.1  christos The SRP_VBASE_add0_user() function adds the B<user_pwd> verifier information
     56  1.1  christos to the B<vb> structure. See L<SRP_user_pwd_new(3)> to create and populate this
     57  1.1  christos record.
     58  1.1  christos The library takes ownership of B<user_pwd>, it should not be freed by the caller.
     59  1.1  christos 
     60  1.1  christos The SRP_VBASE_get1_by_user() function returns the password info for the user
     61  1.1  christos whose username matches B<username>. It replaces the deprecated
     62  1.1  christos SRP_VBASE_get_by_user().
     63  1.1  christos If no matching user is found but a seed_key and default gN parameters have been
     64  1.1  christos set, dummy authentication information is generated from the seed_key, allowing
     65  1.1  christos the server to hide the fact that it doesn't have a verifier for a particular
     66  1.1  christos username. When using SRP as a TLS authentication mechanism, this will cause
     67  1.1  christos the handshake to proceed normally but the first client will be rejected with
     68  1.1  christos a "bad_record_mac" alert, as if the password was incorrect.
     69  1.1  christos If no matching user is found and the seed_key is not set, NULL is returned.
     70  1.1  christos Ownership of the returned pointer is released to the caller, it must be freed
     71  1.1  christos with SRP_user_pwd_free().
     72  1.1  christos 
     73  1.1  christos =head1 RETURN VALUES
     74  1.1  christos 
     75  1.1  christos SRP_VBASE_init() returns B<SRP_NO_ERROR> (0) on success and a positive value
     76  1.1  christos on failure.
     77  1.1  christos The error codes are B<SRP_ERR_OPEN_FILE> if the file could not be opened,
     78  1.1  christos B<SRP_ERR_VBASE_INCOMPLETE_FILE> if the file could not be parsed,
     79  1.1  christos B<SRP_ERR_MEMORY> on memory allocation failure and B<SRP_ERR_VBASE_BN_LIB>
     80  1.1  christos for invalid decoded parameter values.
     81  1.1  christos 
     82  1.1  christos SRP_VBASE_add0_user() returns 1 on success and 0 on failure.
     83  1.1  christos 
     84  1.1  christos =head1 SEE ALSO
     85  1.1  christos 
     86  1.1  christos L<openssl-srp(1)>,
     87  1.1  christos L<SRP_create_verifier(3)>,
     88  1.1  christos L<SRP_user_pwd_new(3)>,
     89  1.1  christos L<SSL_CTX_set_srp_password(3)>
     90  1.1  christos 
     91  1.1  christos =head1 HISTORY
     92  1.1  christos 
     93  1.1  christos The SRP_VBASE_add0_user() function was added in OpenSSL 3.0.
     94  1.1  christos 
     95  1.1  christos All other functions were added in OpenSSL 1.0.1.
     96  1.1  christos 
     97  1.1  christos All of these functions were deprecated in OpenSSL 3.0.
     98  1.1  christos 
     99  1.1  christos =head1 COPYRIGHT
    100  1.1  christos 
    101  1.1  christos Copyright 2018-2021 The OpenSSL Project Authors. All Rights Reserved.
    102  1.1  christos 
    103  1.1  christos Licensed under the Apache License 2.0 (the "License").  You may not use
    104  1.1  christos this file except in compliance with the License.  You can obtain a copy
    105  1.1  christos in the file LICENSE in the source distribution or at
    106  1.1  christos L<https://www.openssl.org/source/license.html>.
    107  1.1  christos 
    108  1.1  christos =cut
    109