SRP_user_pwd_new.pod 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. =pod
  2. =head1 NAME
  3. SRP_user_pwd_new,
  4. SRP_user_pwd_free,
  5. SRP_user_pwd_set1_ids,
  6. SRP_user_pwd_set_gN,
  7. SRP_user_pwd_set0_sv
  8. - Functions to create a record of SRP user verifier information
  9. =head1 SYNOPSIS
  10. #include <openssl/srp.h>
  11. SRP_user_pwd *SRP_user_pwd_new(void);
  12. void SRP_user_pwd_free(SRP_user_pwd *user_pwd);
  13. int SRP_user_pwd_set1_ids(SRP_user_pwd *user_pwd, const char *id, const char *info);
  14. void SRP_user_pwd_set_gN(SRP_user_pwd *user_pwd, const BIGNUM *g, const BIGNUM *N);
  15. int SRP_user_pwd_set0_sv(SRP_user_pwd *user_pwd, BIGNUM *s, BIGNUM *v);
  16. =head1 DESCRIPTION
  17. The SRP_user_pwd_new() function allocates a structure to store a user verifier
  18. record.
  19. The SRP_user_pwd_free() function frees up the B<user_pwd> structure.
  20. If B<user_pwd> is NULL, nothing is done.
  21. The SRP_user_pwd_set1_ids() function sets the username to B<id> and the optional
  22. user info to B<info> for B<user_pwd>.
  23. The library allocates new copies of B<id> and B<info>, the caller still
  24. owns the original memory.
  25. The SRP_user_pwd_set0_sv() function sets the user salt to B<s> and the verifier
  26. to B<v> for B<user_pwd>.
  27. The library takes ownership of the values, they should not be freed by the caller.
  28. The SRP_user_pwd_set_gN() function sets the SRP group parameters for B<user_pwd>.
  29. The memory is not freed by SRP_user_pwd_free(), the caller must make sure it is
  30. freed once it is no longer used.
  31. =head1 RETURN VALUES
  32. SRP_user_pwd_set1_ids() returns 1 on success and 0 on failure or if B<id> was NULL.
  33. SRP_user_pwd_set0_sv() returns 1 if both B<s> and B<v> are not NULL, 0 otherwise.
  34. =head1 SEE ALSO
  35. L<openssl-srp(1)>,
  36. L<SRP_create_verifier(3)>,
  37. L<SRP_VBASE_new(3)>,
  38. L<SSL_CTX_set_srp_password(3)>
  39. =head1 HISTORY
  40. These functions were made public in OpenSSL 3.0.
  41. =head1 COPYRIGHT
  42. Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
  43. Licensed under the Apache License 2.0 (the "License"). You may not use
  44. this file except in compliance with the License. You can obtain a copy
  45. in the file LICENSE in the source distribution or at
  46. L<https://www.openssl.org/source/license.html>.
  47. =cut