sip_auth.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. /*
  2. * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
  3. * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #ifndef __PJSIP_AUTH_SIP_AUTH_H__
  20. #define __PJSIP_AUTH_SIP_AUTH_H__
  21. /**
  22. * @file pjsip_auth.h
  23. * @brief SIP Authorization Module.
  24. */
  25. #include <pjsip/sip_config.h>
  26. #include <pjsip/sip_auth_msg.h>
  27. PJ_BEGIN_DECL
  28. /**
  29. * @addtogroup PJSIP_AUTH
  30. * @ingroup PJSIP_CORE
  31. * @brief Client and server side authentication framework.
  32. */
  33. /**
  34. * @defgroup PJSIP_AUTH_API Authentication API's
  35. * @ingroup PJSIP_AUTH
  36. * @brief Structures and functions to perform authentication.
  37. * @{
  38. */
  39. /** Length of digest MD5 string. */
  40. #define PJSIP_MD5STRLEN 32
  41. /** Length of digest SHA256 string. */
  42. #define PJSIP_SHA256STRLEN 64
  43. /** Type of data in the credential information in #pjsip_cred_info. */
  44. typedef enum pjsip_cred_data_type
  45. {
  46. PJSIP_CRED_DATA_PLAIN_PASSWD=0, /**< Plain text password. */
  47. PJSIP_CRED_DATA_DIGEST =1, /**< Hashed digest. */
  48. PJSIP_CRED_DATA_EXT_AKA =16 /**< Extended AKA info is available */
  49. } pjsip_cred_data_type;
  50. /** Authentication's quality of protection (qop) type. */
  51. typedef enum pjsip_auth_qop_type
  52. {
  53. PJSIP_AUTH_QOP_NONE, /**< No quality of protection. */
  54. PJSIP_AUTH_QOP_AUTH, /**< Authentication. */
  55. PJSIP_AUTH_QOP_AUTH_INT, /**< Authentication with integrity protection. */
  56. PJSIP_AUTH_QOP_UNKNOWN /**< Unknown protection. */
  57. } pjsip_auth_qop_type;
  58. /**
  59. * Type of callback function to create authentication response.
  60. * Application can specify this callback in \a cb field of the credential info
  61. * (#pjsip_cred_info) and specifying PJSIP_CRED_DATA_DIGEST_CALLBACK as
  62. * \a data_type. When this function is called, most of the fields in the
  63. * \a auth authentication response will have been filled by the framework.
  64. * Application normally should just need to calculate the response digest
  65. * of the authentication response.
  66. *
  67. * @param pool Pool to allocate memory from if application needs to.
  68. * @param chal The authentication challenge sent by server in 401
  69. * or 401 response, in either Proxy-Authenticate or
  70. * WWW-Authenticate header.
  71. * @param cred The credential that has been selected by the framework
  72. * to authenticate against the challenge.
  73. * @param auth The authentication response which application needs to
  74. * calculate the response digest.
  75. *
  76. * @return Application may return non-PJ_SUCCESS to abort the
  77. * authentication process. When this happens, the
  78. * framework will return failure to the original function
  79. * that requested authentication.
  80. */
  81. typedef pj_status_t (*pjsip_cred_cb)(pj_pool_t *pool,
  82. const pjsip_digest_challenge *chal,
  83. const pjsip_cred_info *cred,
  84. const pj_str_t *method,
  85. pjsip_digest_credential *auth);
  86. /**
  87. * This structure describes credential information.
  88. * A credential information is a static, persistent information that identifies
  89. * username and password required to authorize to a specific realm.
  90. *
  91. * Note that since PJSIP 0.7.0.1, it is possible to make a credential that is
  92. * valid for any realms, by setting the realm to star/wildcard character,
  93. * i.e. realm = pj_str("*");.
  94. */
  95. struct pjsip_cred_info
  96. {
  97. pj_str_t realm; /**< Realm. Use "*" to make a credential that
  98. can be used to authenticate against any
  99. challenges. */
  100. pj_str_t scheme; /**< Scheme (e.g. "digest"). */
  101. pj_str_t username; /**< User name. */
  102. int data_type; /**< Type of data (0 for plaintext passwd). */
  103. pj_str_t data; /**< The data, which can be a plaintext
  104. password or a hashed digest. */
  105. /** Extended data */
  106. union {
  107. /** Digest AKA credential information. Note that when AKA credential
  108. * is being used, the \a data field of this #pjsip_cred_info is
  109. * not used, but it still must be initialized to an empty string.
  110. * Please see \ref PJSIP_AUTH_AKA_API for more information.
  111. */
  112. struct {
  113. pj_str_t k; /**< Permanent subscriber key. */
  114. pj_str_t op; /**< Operator variant key. */
  115. pj_str_t amf; /**< Authentication Management Field */
  116. pjsip_cred_cb cb; /**< Callback to create AKA digest. */
  117. } aka;
  118. } ext;
  119. };
  120. /**
  121. * This structure describes cached value of previously sent Authorization
  122. * or Proxy-Authorization header. The authentication framework keeps a list
  123. * of this structure and will resend the same header to the same server
  124. * as long as the method, uri, and nonce stays the same.
  125. */
  126. typedef struct pjsip_cached_auth_hdr
  127. {
  128. /** Standard list member */
  129. PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth_hdr);
  130. pjsip_method method; /**< To quickly see the method. */
  131. pjsip_authorization_hdr *hdr; /**< The cached header. */
  132. } pjsip_cached_auth_hdr;
  133. /**
  134. * This structure describes authentication information for the specified
  135. * realm. Each instance of this structure describes authentication "session"
  136. * between this endpoint and remote server. This "session" information is
  137. * usefull to keep information that persists for more than one challenge,
  138. * such as nonce-count and cnonce value.
  139. *
  140. * Other than that, this structure also keeps the last authorization headers
  141. * that have been sent in the cache list.
  142. */
  143. typedef struct pjsip_cached_auth
  144. {
  145. /** Standard list member */
  146. PJ_DECL_LIST_MEMBER(struct pjsip_cached_auth);
  147. pj_pool_t *pool; /**< Pool for cached auth */
  148. pj_str_t realm; /**< Realm. */
  149. pj_bool_t is_proxy; /**< Server type (401/407) */
  150. pjsip_auth_qop_type qop_value; /**< qop required by server. */
  151. unsigned stale_cnt; /**< Number of stale retry. */
  152. #if PJSIP_AUTH_QOP_SUPPORT
  153. pj_uint32_t nc; /**< Nonce count. */
  154. pj_str_t cnonce; /**< Cnonce value. */
  155. #endif
  156. pjsip_www_authenticate_hdr *last_chal; /**< Last challenge seen. */
  157. #if PJSIP_AUTH_HEADER_CACHING
  158. pjsip_cached_auth_hdr cached_hdr;/**< List of cached header for
  159. each method. */
  160. #endif
  161. } pjsip_cached_auth;
  162. /**
  163. * This structure describes client authentication session preference.
  164. * The preference can be set by calling #pjsip_auth_clt_set_prefs().
  165. */
  166. typedef struct pjsip_auth_clt_pref
  167. {
  168. /**
  169. * If this flag is set, the authentication client framework will
  170. * send an empty Authorization header in each initial request.
  171. * Default is no.
  172. */
  173. pj_bool_t initial_auth;
  174. /**
  175. * Specify the algorithm to use when empty Authorization header
  176. * is to be sent for each initial request (see above)
  177. */
  178. pj_str_t algorithm;
  179. } pjsip_auth_clt_pref;
  180. /**
  181. * Duplicate a client authentication preference setting.
  182. *
  183. * @param pool The memory pool.
  184. * @param dst Destination client authentication preference.
  185. * @param src Source client authentication preference.
  186. */
  187. PJ_DECL(void) pjsip_auth_clt_pref_dup(pj_pool_t *pool,
  188. pjsip_auth_clt_pref *dst,
  189. const pjsip_auth_clt_pref *src);
  190. /**
  191. * This structure describes client authentication sessions. It keeps
  192. * all the information needed to authorize the client against all downstream
  193. * servers.
  194. */
  195. typedef struct pjsip_auth_clt_sess
  196. {
  197. pj_pool_t *pool; /**< Pool to use. */
  198. pjsip_endpoint *endpt; /**< Endpoint where this belongs. */
  199. pjsip_auth_clt_pref pref; /**< Preference/options. */
  200. unsigned cred_cnt; /**< Number of credentials. */
  201. pjsip_cred_info *cred_info; /**< Array of credential information*/
  202. pjsip_cached_auth cached_auth; /**< Cached authorization info. */
  203. } pjsip_auth_clt_sess;
  204. /**
  205. * Duplicate a credential info.
  206. *
  207. * @param pool The memory pool.
  208. * @param dst Destination credential.
  209. * @param src Source credential.
  210. */
  211. PJ_DECL(void) pjsip_cred_info_dup(pj_pool_t *pool,
  212. pjsip_cred_info *dst,
  213. const pjsip_cred_info *src);
  214. /**
  215. * Compare two credential infos.
  216. *
  217. * @param cred1 The credential info to compare.
  218. * @param cred2 The credential info to compare.
  219. *
  220. * @return 0 if both credentials are equal.
  221. */
  222. PJ_DECL(int) pjsip_cred_info_cmp(const pjsip_cred_info *cred1,
  223. const pjsip_cred_info *cred2);
  224. /**
  225. * Type of function to lookup credential for the specified name.
  226. *
  227. * @param pool Pool to initialize the credential info.
  228. * @param realm Realm to find the account.
  229. * @param acc_name Account name to look for.
  230. * @param cred_info The structure to put the credential when it's found.
  231. *
  232. * @return The function MUST return PJ_SUCCESS when it found
  233. * a correct credential for the specified account and
  234. * realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUND
  235. * or PJSIP_EAUTHACCDISABLED.
  236. */
  237. typedef pj_status_t pjsip_auth_lookup_cred( pj_pool_t *pool,
  238. const pj_str_t *realm,
  239. const pj_str_t *acc_name,
  240. pjsip_cred_info *cred_info );
  241. /**
  242. * This structure describes input param for credential lookup.
  243. */
  244. typedef struct pjsip_auth_lookup_cred_param
  245. {
  246. pj_str_t realm; /**< Realm to find the account. */
  247. pj_str_t acc_name; /**< Account name to look for. */
  248. pjsip_rx_data *rdata; /**< Incoming request to be authenticated. */
  249. } pjsip_auth_lookup_cred_param;
  250. /**
  251. * Type of function to lookup credential for the specified name.
  252. *
  253. * @param pool Pool to initialize the credential info.
  254. * @param param The input param for credential lookup.
  255. * @param cred_info The structure to put the credential when it's found.
  256. *
  257. * @return The function MUST return PJ_SUCCESS when it found
  258. * a correct credential for the specified account and
  259. * realm. Otherwise it may return PJSIP_EAUTHACCNOTFOUND
  260. * or PJSIP_EAUTHACCDISABLED.
  261. */
  262. typedef pj_status_t pjsip_auth_lookup_cred2(
  263. pj_pool_t *pool,
  264. const pjsip_auth_lookup_cred_param *param,
  265. pjsip_cred_info *cred_info );
  266. /** Flag to specify that server is a proxy. */
  267. #define PJSIP_AUTH_SRV_IS_PROXY 1
  268. /**
  269. * This structure describes server authentication information.
  270. */
  271. typedef struct pjsip_auth_srv
  272. {
  273. pj_str_t realm; /**< Realm to serve. */
  274. pj_bool_t is_proxy; /**< Will issue 407 instead of 401 */
  275. pjsip_auth_lookup_cred *lookup; /**< Lookup function. */
  276. pjsip_auth_lookup_cred2 *lookup2; /**< Lookup function with additional
  277. info in its input param. */
  278. } pjsip_auth_srv;
  279. /**
  280. * Initialize client authentication session data structure, and set the
  281. * session to use pool for its subsequent memory allocation. The argument
  282. * options should be set to zero for this PJSIP version.
  283. *
  284. * @param sess The client authentication session.
  285. * @param endpt Endpoint where this session belongs.
  286. * @param pool Pool to use.
  287. * @param options Must be zero.
  288. *
  289. * @return PJ_SUCCESS on success.
  290. */
  291. PJ_DECL(pj_status_t) pjsip_auth_clt_init( pjsip_auth_clt_sess *sess,
  292. pjsip_endpoint *endpt,
  293. pj_pool_t *pool,
  294. unsigned options);
  295. /**
  296. * Deinitialize client authentication session data structure.
  297. *
  298. * @param sess The client authentication session.
  299. *
  300. * @return PJ_SUCCESS on success.
  301. */
  302. PJ_DECL(pj_status_t) pjsip_auth_clt_deinit( pjsip_auth_clt_sess *sess);
  303. /**
  304. * Clone client initialization session.
  305. *
  306. * @param pool Pool to use.
  307. * @param sess Structure to put the duplicated session.
  308. * @param rhs The client session to be cloned.
  309. *
  310. * @return PJ_SUCCESS on success;
  311. */
  312. PJ_DECL(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool,
  313. pjsip_auth_clt_sess *sess,
  314. const pjsip_auth_clt_sess *rhs);
  315. /**
  316. * Set the credentials to be used during the session. This will duplicate
  317. * the specified credentials using client authentication's pool.
  318. *
  319. * @param sess The client authentication session.
  320. * @param cred_cnt Number of credentials.
  321. * @param c Array of credentials.
  322. *
  323. * @return PJ_SUCCESS on success.
  324. */
  325. PJ_DECL(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess,
  326. int cred_cnt,
  327. const pjsip_cred_info *c);
  328. /**
  329. * Set the preference for the client authentication session.
  330. *
  331. * @param sess The client authentication session.
  332. * @param p Preference.
  333. *
  334. * @return PJ_SUCCESS on success.
  335. */
  336. PJ_DECL(pj_status_t) pjsip_auth_clt_set_prefs(pjsip_auth_clt_sess *sess,
  337. const pjsip_auth_clt_pref *p);
  338. /**
  339. * Get the preference for the client authentication session.
  340. *
  341. * @param sess The client authentication session.
  342. * @param p Pointer to receive the preference.
  343. *
  344. * @return PJ_SUCCESS on success.
  345. */
  346. PJ_DECL(pj_status_t) pjsip_auth_clt_get_prefs(pjsip_auth_clt_sess *sess,
  347. pjsip_auth_clt_pref *p);
  348. /**
  349. * Initialize new request message with authorization headers.
  350. * This function will put Authorization/Proxy-Authorization headers to the
  351. * outgoing request message. If caching is enabled (PJSIP_AUTH_HEADER_CACHING)
  352. * and the session has previously sent Authorization/Proxy-Authorization header
  353. * with the same method, then the same Authorization/Proxy-Authorization header
  354. * will be resent from the cache only if qop is not present. If the stack is
  355. * configured to automatically generate next Authorization/Proxy-Authorization
  356. * headers (PJSIP_AUTH_AUTO_SEND_NEXT flag), then new Authorization/Proxy-
  357. * Authorization headers are calculated and generated when they are not present
  358. * in the case or if authorization session has qop.
  359. *
  360. * If both PJSIP_AUTH_HEADER_CACHING flag and PJSIP_AUTH_AUTO_SEND_NEXT flag
  361. * are not set, this function will do nothing. The stack then will only send
  362. * Authorization/Proxy-Authorization to respond 401/407 response.
  363. *
  364. * @param sess The client authentication session.
  365. * @param tdata The request message to be initialized.
  366. *
  367. * @return PJ_SUCCESS if successfull.
  368. */
  369. PJ_DECL(pj_status_t) pjsip_auth_clt_init_req( pjsip_auth_clt_sess *sess,
  370. pjsip_tx_data *tdata );
  371. /**
  372. * Call this function when a transaction failed with 401 or 407 response.
  373. * This function will reinitialize the original request message with the
  374. * authentication challenge found in the response message, and add the
  375. * new authorization header in the authorization cache.
  376. *
  377. * Note that upon return the reference counter of the new transmit data
  378. * will be set to 1.
  379. *
  380. * @param sess The client authentication session.
  381. * @param rdata The response message containing 401/407 status.
  382. * @param old_request The original request message, which will be re-
  383. * created with authorization info.
  384. * @param new_request Pointer to receive new request message which
  385. * will contain all required authorization headers.
  386. *
  387. * @return PJ_SUCCESS if new request can be successfully
  388. * created to respond all the authentication
  389. * challenges.
  390. */
  391. PJ_DECL(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
  392. const pjsip_rx_data *rdata,
  393. pjsip_tx_data *old_request,
  394. pjsip_tx_data **new_request );
  395. /**
  396. * Initialize server authorization session data structure to serve the
  397. * specified realm and to use lookup_func function to look for the credential
  398. * info.
  399. *
  400. * @param pool Pool used to initialize the authentication server.
  401. * @param auth_srv The authentication server structure.
  402. * @param realm Realm to be served by the server.
  403. * @param lookup Account lookup function.
  404. * @param options Options, bitmask of:
  405. * - PJSIP_AUTH_SRV_IS_PROXY: to specify that the server
  406. * will authorize clients as a proxy server (instead of
  407. * as UAS), which means that Proxy-Authenticate will
  408. * be used instead of WWW-Authenticate.
  409. *
  410. * @return PJ_SUCCESS on success.
  411. */
  412. PJ_DECL(pj_status_t) pjsip_auth_srv_init( pj_pool_t *pool,
  413. pjsip_auth_srv *auth_srv,
  414. const pj_str_t *realm,
  415. pjsip_auth_lookup_cred *lookup,
  416. unsigned options );
  417. /**
  418. * This structure describes initialization settings of server authorization
  419. * session.
  420. */
  421. typedef struct pjsip_auth_srv_init_param
  422. {
  423. /**
  424. * Realm to be served by the server.
  425. */
  426. const pj_str_t *realm;
  427. /**
  428. * Account lookup function.
  429. */
  430. pjsip_auth_lookup_cred2 *lookup2;
  431. /**
  432. * Options, bitmask of:
  433. * - PJSIP_AUTH_SRV_IS_PROXY: to specify that the server will authorize
  434. * clients as a proxy server (instead of as UAS), which means that
  435. * Proxy-Authenticate will be used instead of WWW-Authenticate.
  436. */
  437. unsigned options;
  438. } pjsip_auth_srv_init_param;
  439. /**
  440. * Initialize server authorization session data structure to serve the
  441. * specified realm and to use lookup_func function to look for the credential
  442. * info.
  443. *
  444. * @param pool Pool used to initialize the authentication server.
  445. * @param auth_srv The authentication server structure.
  446. * @param param The initialization param.
  447. *
  448. * @return PJ_SUCCESS on success.
  449. */
  450. PJ_DECL(pj_status_t) pjsip_auth_srv_init2(
  451. pj_pool_t *pool,
  452. pjsip_auth_srv *auth_srv,
  453. const pjsip_auth_srv_init_param *param);
  454. /**
  455. * Request the authorization server framework to verify the authorization
  456. * information in the specified request in rdata.
  457. *
  458. * @param auth_srv The server authentication structure.
  459. * @param rdata Incoming request to be authenticated.
  460. * @param status_code When not null, it will be filled with suitable
  461. * status code to be sent to the client.
  462. *
  463. * @return PJ_SUCCESS if request is successfully authenticated.
  464. * Otherwise the function may return one of the
  465. * following error codes:
  466. * - PJSIP_EAUTHNOAUTH
  467. * - PJSIP_EINVALIDAUTHSCHEME
  468. * - PJSIP_EAUTHACCNOTFOUND
  469. * - PJSIP_EAUTHACCDISABLED
  470. * - PJSIP_EAUTHINVALIDREALM
  471. * - PJSIP_EAUTHINVALIDDIGEST
  472. */
  473. PJ_DECL(pj_status_t) pjsip_auth_srv_verify( pjsip_auth_srv *auth_srv,
  474. pjsip_rx_data *rdata,
  475. int *status_code );
  476. /**
  477. * Add authentication challenge headers to the outgoing response in tdata.
  478. * Application may specify its customized nonce and opaque for the challenge,
  479. * or can leave the value to NULL to make the function fills them in with
  480. * random characters.
  481. *
  482. * @param auth_srv The server authentication structure.
  483. * @param qop Optional qop value.
  484. * @param nonce Optional nonce value.
  485. * @param opaque Optional opaque value.
  486. * @param stale Stale indication.
  487. * @param tdata The outgoing response message. The response must have
  488. * 401 or 407 response code.
  489. *
  490. * @return PJ_SUCCESS on success.
  491. */
  492. PJ_DECL(pj_status_t) pjsip_auth_srv_challenge( pjsip_auth_srv *auth_srv,
  493. const pj_str_t *qop,
  494. const pj_str_t *nonce,
  495. const pj_str_t *opaque,
  496. pj_bool_t stale,
  497. pjsip_tx_data *tdata);
  498. /**
  499. * Helper function to create MD5 digest out of the specified
  500. * parameters.
  501. *
  502. * @param result String to store the response digest. This string
  503. * must have been preallocated by caller with the
  504. * buffer at least PJSIP_MD5STRLEN (32 bytes) in size.
  505. * @param nonce Optional nonce.
  506. * @param nc Nonce count.
  507. * @param cnonce Optional cnonce.
  508. * @param qop Optional qop.
  509. * @param uri URI.
  510. * @param realm Realm.
  511. * @param cred_info Credential info.
  512. * @param method SIP method.
  513. *
  514. * @return PJ_SUCCESS on success.
  515. */
  516. PJ_DECL(pj_status_t) pjsip_auth_create_digest(pj_str_t *result,
  517. const pj_str_t *nonce,
  518. const pj_str_t *nc,
  519. const pj_str_t *cnonce,
  520. const pj_str_t *qop,
  521. const pj_str_t *uri,
  522. const pj_str_t *realm,
  523. const pjsip_cred_info *cred_info,
  524. const pj_str_t *method);
  525. /**
  526. * Helper function to create SHA-256 digest out of the specified
  527. * parameters.
  528. *
  529. * @param result String to store the response digest. This string
  530. * must have been preallocated by caller with the
  531. * buffer at least PJSIP_SHA256STRLEN (64 bytes) in size.
  532. * @param nonce Optional nonce.
  533. * @param nc Nonce count.
  534. * @param cnonce Optional cnonce.
  535. * @param qop Optional qop.
  536. * @param uri URI.
  537. * @param realm Realm.
  538. * @param cred_info Credential info.
  539. * @param method SIP method.
  540. *
  541. * @return PJ_SUCCESS on success.
  542. */
  543. PJ_DEF(pj_status_t) pjsip_auth_create_digestSHA256(pj_str_t* result,
  544. const pj_str_t* nonce,
  545. const pj_str_t* nc,
  546. const pj_str_t* cnonce,
  547. const pj_str_t* qop,
  548. const pj_str_t* uri,
  549. const pj_str_t* realm,
  550. const pjsip_cred_info* cred_info,
  551. const pj_str_t* method);
  552. /**
  553. * @}
  554. */
  555. PJ_END_DECL
  556. #endif /* __PJSIP_AUTH_SIP_AUTH_H__ */