SRP_VBASE_new.3ossl 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "SRP_VBASE_NEW 3ossl"
  58. .TH SRP_VBASE_NEW 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. SRP_VBASE_new,
  65. SRP_VBASE_free,
  66. SRP_VBASE_init,
  67. SRP_VBASE_add0_user,
  68. SRP_VBASE_get1_by_user,
  69. SRP_VBASE_get_by_user
  70. \&\- Functions to create and manage a stack of SRP user verifier information
  71. .SH SYNOPSIS
  72. .IX Header "SYNOPSIS"
  73. .Vb 1
  74. \& #include <openssl/srp.h>
  75. .Ve
  76. .PP
  77. The following functions have been deprecated since OpenSSL 3.0, and can be
  78. hidden entirely by defining \fBOPENSSL_API_COMPAT\fR with a suitable version value,
  79. see \fBopenssl_user_macros\fR\|(7):
  80. .PP
  81. .Vb 2
  82. \& SRP_VBASE *SRP_VBASE_new(char *seed_key);
  83. \& void SRP_VBASE_free(SRP_VBASE *vb);
  84. \&
  85. \& int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);
  86. \&
  87. \& int SRP_VBASE_add0_user(SRP_VBASE *vb, SRP_user_pwd *user_pwd);
  88. \& SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);
  89. \& SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
  90. .Ve
  91. .SH DESCRIPTION
  92. .IX Header "DESCRIPTION"
  93. All of the functions described on this page are deprecated. There are no
  94. available replacement functions at this time.
  95. .PP
  96. The \fBSRP_VBASE_new()\fR function allocates a structure to store server side SRP
  97. verifier information.
  98. If \fBseed_key\fR is not NULL a copy is stored and used to generate dummy parameters
  99. for users that are not found by \fBSRP_VBASE_get1_by_user()\fR. This allows the server
  100. to hide the fact that it doesn't have a verifier for a particular username,
  101. as described in section 2.5.1.3 'Unknown SRP' of RFC 5054.
  102. The seed string should contain random NUL terminated binary data (therefore
  103. the random data should not contain NUL bytes!).
  104. .PP
  105. The \fBSRP_VBASE_free()\fR function frees up the \fBvb\fR structure.
  106. If \fBvb\fR is NULL, nothing is done.
  107. .PP
  108. The \fBSRP_VBASE_init()\fR function parses the information in a verifier file and
  109. populates the \fBvb\fR structure.
  110. The verifier file is a text file containing multiple entries, whose format is:
  111. flag base64(verifier) base64(salt) username gNid userinfo(optional)
  112. where the flag can be 'V' (valid) or 'R' (revoked).
  113. Note that the base64 encoding used here is non-standard so it is recommended
  114. to use \fBopenssl\-srp\fR\|(1) to generate this file.
  115. .PP
  116. The \fBSRP_VBASE_add0_user()\fR function adds the \fBuser_pwd\fR verifier information
  117. to the \fBvb\fR structure. See \fBSRP_user_pwd_new\fR\|(3) to create and populate this
  118. record.
  119. The library takes ownership of \fBuser_pwd\fR, it should not be freed by the caller.
  120. .PP
  121. The \fBSRP_VBASE_get1_by_user()\fR function returns the password info for the user
  122. whose username matches \fBusername\fR. It replaces the deprecated
  123. \&\fBSRP_VBASE_get_by_user()\fR.
  124. If no matching user is found but a seed_key and default gN parameters have been
  125. set, dummy authentication information is generated from the seed_key, allowing
  126. the server to hide the fact that it doesn't have a verifier for a particular
  127. username. When using SRP as a TLS authentication mechanism, this will cause
  128. the handshake to proceed normally but the first client will be rejected with
  129. a "bad_record_mac" alert, as if the password was incorrect.
  130. If no matching user is found and the seed_key is not set, NULL is returned.
  131. Ownership of the returned pointer is released to the caller, it must be freed
  132. with \fBSRP_user_pwd_free()\fR.
  133. .SH "RETURN VALUES"
  134. .IX Header "RETURN VALUES"
  135. \&\fBSRP_VBASE_init()\fR returns \fBSRP_NO_ERROR\fR (0) on success and a positive value
  136. on failure.
  137. The error codes are \fBSRP_ERR_OPEN_FILE\fR if the file could not be opened,
  138. \&\fBSRP_ERR_VBASE_INCOMPLETE_FILE\fR if the file could not be parsed,
  139. \&\fBSRP_ERR_MEMORY\fR on memory allocation failure and \fBSRP_ERR_VBASE_BN_LIB\fR
  140. for invalid decoded parameter values.
  141. .PP
  142. \&\fBSRP_VBASE_add0_user()\fR returns 1 on success and 0 on failure.
  143. .SH "SEE ALSO"
  144. .IX Header "SEE ALSO"
  145. \&\fBopenssl\-srp\fR\|(1),
  146. \&\fBSRP_create_verifier\fR\|(3),
  147. \&\fBSRP_user_pwd_new\fR\|(3),
  148. \&\fBSSL_CTX_set_srp_password\fR\|(3)
  149. .SH HISTORY
  150. .IX Header "HISTORY"
  151. The \fBSRP_VBASE_add0_user()\fR function was added in OpenSSL 3.0.
  152. .PP
  153. All other functions were added in OpenSSL 1.0.1.
  154. .PP
  155. All of these functions were deprecated in OpenSSL 3.0.
  156. .SH COPYRIGHT
  157. .IX Header "COPYRIGHT"
  158. Copyright 2018\-2021 The OpenSSL Project Authors. All Rights Reserved.
  159. .PP
  160. Licensed under the Apache License 2.0 (the "License"). You may not use
  161. this file except in compliance with the License. You can obtain a copy
  162. in the file LICENSE in the source distribution or at
  163. <https://www.openssl.org/source/license.html>.