"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/osipparser2/osip_authorization.c" between
libosip2-5.0.0.tar.gz and libosip2-5.1.0.tar.gz

About: The GNU oSIP library is an implementation of SIP (RFC3261).

osip_authorization.c  (libosip2-5.0.0):osip_authorization.c  (libosip2-5.1.0)
skipping to change at line 194 skipping to change at line 194
i = __osip_token_set ("nc", space, &(auth->nonce_count), &next); i = __osip_token_set ("nc", space, &(auth->nonce_count), &next);
if (i != 0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
i = __osip_token_set ("version", space, &(auth->version), &next); i = __osip_token_set ("version", space, &(auth->version), &next);
if (i!=0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
i = __osip_quoted_string_set ("targetname", space, &(auth->targetname), &nex t); i = __osip_quoted_string_set ("targetname", space, &(auth->targetname), &nex t);
if (i!=0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
i = __osip_quoted_string_set ("gssapi-data", space, &(auth->gssapi_data), &n ext); i = __osip_quoted_string_set ("gssapi-data", space, &(auth->gssapi_data), &n ext);
if (i!=0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
i = __osip_quoted_string_set ("crand", space, &(auth->crand), &next); i = __osip_quoted_string_set ("crand", space, &(auth->crand), &next);
if (i!=0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
i = __osip_quoted_string_set ("cnum", space, &(auth->cnum), &next); i = __osip_quoted_string_set ("cnum", space, &(auth->cnum), &next);
if (i!=0) if (i != 0)
return i; return i;
if (next == NULL) if (next == NULL)
return OSIP_SUCCESS; /* end of header detected! */ return OSIP_SUCCESS; /* end of header detected! */
else if (next != space) { else if (next != space) {
space = next; space = next;
parse_ok++; parse_ok++;
} }
/* nothing was recognized: /* nothing was recognized:
here, we should handle a list of unknown tokens where: here, we should handle a list of unknown tokens where:
token1 = ( token2 | quoted_text ) */ token1 = ( token2 | quoted_text ) */
/* TODO */ /* TODO */
if (0 == parse_ok) { if (0 == parse_ok) {
const char *quote1, *quote2, *tmp; const char *quote1, *quote2, *tmp;
/* CAUTION */ /* CAUTION */
skipping to change at line 443 skipping to change at line 443
authorization->nonce_count = (char *) nonce_count; authorization->nonce_count = (char *) nonce_count;
} }
char * char *
osip_authorization_get_version (osip_authorization_t * authorization) osip_authorization_get_version (osip_authorization_t * authorization)
{ {
return authorization->version; return authorization->version;
} }
void void
osip_authorization_set_version (osip_authorization_t * authorization, osip_authorization_set_version (osip_authorization_t * authorization, char *vers
char *version) ion)
{ {
authorization->version = (char *) version; authorization->version = (char *) version;
} }
char * char *
osip_authorization_get_targetname (osip_authorization_t * authorization) osip_authorization_get_targetname (osip_authorization_t * authorization)
{ {
return authorization->targetname; return authorization->targetname;
} }
void void
osip_authorization_set_targetname (osip_authorization_t * authorization, osip_authorization_set_targetname (osip_authorization_t * authorization, char *t
char *targetname) argetname)
{ {
authorization->targetname = (char *) targetname; authorization->targetname = (char *) targetname;
} }
char * char *
osip_authorization_get_gssapi_data (osip_authorization_t * authorization) osip_authorization_get_gssapi_data (osip_authorization_t * authorization)
{ {
return authorization->gssapi_data; return authorization->gssapi_data;
} }
void void
osip_authorization_set_gssapi_data (osip_authorization_t * authorization, osip_authorization_set_gssapi_data (osip_authorization_t * authorization, char *
char *gssapi_data) gssapi_data)
{ {
authorization->gssapi_data = (char *) gssapi_data; authorization->gssapi_data = (char *) gssapi_data;
} }
char * char *
osip_authorization_get_crand (osip_authorization_t * authorization) osip_authorization_get_crand (osip_authorization_t * authorization)
{ {
return authorization->crand; return authorization->crand;
} }
void void
osip_authorization_set_crand (osip_authorization_t * authorization, osip_authorization_set_crand (osip_authorization_t * authorization, char *crand)
char *crand)
{ {
authorization->crand = (char *) crand; authorization->crand = (char *) crand;
} }
char * char *
osip_authorization_get_cnum (osip_authorization_t * authorization) osip_authorization_get_cnum (osip_authorization_t * authorization)
{ {
return authorization->cnum; return authorization->cnum;
} }
void void
osip_authorization_set_cnum (osip_authorization_t * authorization, osip_authorization_set_cnum (osip_authorization_t * authorization, char *cnum)
char *cnum)
{ {
authorization->cnum = (char *) cnum; authorization->cnum = (char *) cnum;
} }
/* returns the authorization header as a string. */ /* returns the authorization header as a string. */
/* INPUT : osip_authorization_t *authorization | authorization header. */ /* INPUT : osip_authorization_t *authorization | authorization header. */
/* returns null on error. */ /* returns null on error. */
int int
osip_authorization_to_str (const osip_authorization_t * auth, char **dest) osip_authorization_to_str (const osip_authorization_t * auth, char **dest)
{ {
skipping to change at line 568 skipping to change at line 563
len = len + strlen (auth->cnum) + 7; len = len + strlen (auth->cnum) + 7;
tmp = (char *) osip_malloc (len); tmp = (char *) osip_malloc (len);
if (tmp == NULL) if (tmp == NULL)
return OSIP_NOMEM; return OSIP_NOMEM;
*dest = tmp; *dest = tmp;
tmp = osip_str_append (tmp, auth->auth_type); tmp = osip_str_append (tmp, auth->auth_type);
if (auth->username != NULL) { if (auth->username != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " username=", 10); tmp = osip_strn_append (tmp, " username=", 10);
/* !! username-value must be a quoted string !! */ /* !! username-value must be a quoted string !! */
tmp = osip_str_append (tmp, auth->username); tmp = osip_str_append (tmp, auth->username);
} }
if (auth->realm != NULL) { if (auth->realm != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " realm=", 7); tmp = osip_strn_append (tmp, " realm=", 7);
/* !! realm-value must be a quoted string !! */ /* !! realm-value must be a quoted string !! */
tmp = osip_str_append (tmp, auth->realm); tmp = osip_str_append (tmp, auth->realm);
} }
if (auth->nonce != NULL) { if (auth->nonce != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " nonce=", 7); tmp = osip_strn_append (tmp, " nonce=", 7);
/* !! nonce-value must be a quoted string !! */ /* !! nonce-value must be a quoted string !! */
tmp = osip_str_append (tmp, auth->nonce); tmp = osip_str_append (tmp, auth->nonce);
} }
if (auth->uri != NULL) { if (auth->uri != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " uri=", 5); tmp = osip_strn_append (tmp, " uri=", 5);
/* !! domain-value must be a list of URI in a quoted string !! */ /* !! domain-value must be a list of URI in a quoted string !! */
tmp = osip_str_append (tmp, auth->uri); tmp = osip_str_append (tmp, auth->uri);
} }
if (auth->response != NULL) { if (auth->response != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " response=", 10); tmp = osip_strn_append (tmp, " response=", 10);
/* !! domain-value must be a list of URI in a quoted string !! */ /* !! domain-value must be a list of URI in a quoted string !! */
tmp = osip_str_append (tmp, auth->response); tmp = osip_str_append (tmp, auth->response);
} }
if (auth->digest != NULL) { if (auth->digest != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " digest=", 8); tmp = osip_strn_append (tmp, " digest=", 8);
/* !! domain-value must be a list of URI in a quoted string !! */ /* !! domain-value must be a list of URI in a quoted string !! */
tmp = osip_str_append (tmp, auth->digest); tmp = osip_str_append (tmp, auth->digest);
} }
if (auth->algorithm != NULL) { if (auth->algorithm != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " algorithm=", 11); tmp = osip_strn_append (tmp, " algorithm=", 11);
tmp = osip_str_append (tmp, auth->algorithm); tmp = osip_str_append (tmp, auth->algorithm);
} }
if (auth->cnonce != NULL) { if (auth->cnonce != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " cnonce=", 8); tmp = osip_strn_append (tmp, " cnonce=", 8);
tmp = osip_str_append (tmp, auth->cnonce); tmp = osip_str_append (tmp, auth->cnonce);
} }
if (auth->opaque != NULL) { if (auth->opaque != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " opaque=", 8); tmp = osip_strn_append (tmp, " opaque=", 8);
tmp = osip_str_append (tmp, auth->opaque); tmp = osip_str_append (tmp, auth->opaque);
} }
if (auth->message_qop != NULL) { if (auth->message_qop != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " qop=", 5); tmp = osip_strn_append (tmp, " qop=", 5);
tmp = osip_str_append (tmp, auth->message_qop); tmp = osip_str_append (tmp, auth->message_qop);
} }
if (auth->nonce_count != NULL) { if (auth->nonce_count != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " nc=", 4); tmp = osip_strn_append (tmp, " nc=", 4);
tmp = osip_str_append (tmp, auth->nonce_count); tmp = osip_str_append (tmp, auth->nonce_count);
} }
if (auth->version != NULL) { if (auth->version != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " version=", 9); tmp = osip_strn_append (tmp, " version=", 9);
tmp = osip_str_append (tmp, auth->version); tmp = osip_str_append (tmp, auth->version);
} }
if (auth->targetname != NULL) { if (auth->targetname != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " targetname=", 12); tmp = osip_strn_append (tmp, " targetname=", 12);
tmp = osip_str_append (tmp, auth->targetname); tmp = osip_str_append (tmp, auth->targetname);
} }
if (auth->gssapi_data != NULL) { if (auth->gssapi_data != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " gssapi-data=", 13); tmp = osip_strn_append (tmp, " gssapi-data=", 13);
tmp = osip_str_append (tmp, auth->gssapi_data); tmp = osip_str_append (tmp, auth->gssapi_data);
} }
if (auth->crand != NULL) { if (auth->crand != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " crand=", 7); tmp = osip_strn_append (tmp, " crand=", 7);
tmp = osip_str_append (tmp, auth->crand); tmp = osip_str_append (tmp, auth->crand);
} }
if (auth->cnum != NULL) { if (auth->cnum != NULL) {
if(!first) if (!first)
tmp = osip_strn_append (tmp, ",", 1); tmp = osip_strn_append (tmp, ",", 1);
first = 0; first = 0;
tmp = osip_strn_append (tmp, " cnum=", 6); tmp = osip_strn_append (tmp, " cnum=", 6);
tmp = osip_str_append (tmp, auth->cnum); tmp = osip_str_append (tmp, auth->cnum);
} }
return OSIP_SUCCESS; return OSIP_SUCCESS;
} }
/* deallocates a osip_authorization_t structure. */ /* deallocates a osip_authorization_t structure. */
/* INPUT : osip_authorization_t *authorization | authorization. */ /* INPUT : osip_authorization_t *authorization | authorization. */
 End of changes. 36 change blocks. 
46 lines changed or deleted 44 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)