Skip to content

Commit

Permalink
Merge pull request #15 from rtckit/v0.5.1
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
cdosoftei authored Oct 1, 2021
2 parents 0a6ee6c + e9cbcb2 commit 0a47d9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rtckit/sip",
"description": "Parser/Renderer for SIP protocol written in PHP",
"version": "0.5.0",
"version": "0.5.1",
"type": "library",
"keywords": [
"sip",
Expand Down
4 changes: 2 additions & 2 deletions src/Header/AuthHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function render(string $hname): string
}

if (isset($value->algorithm)) {
$params[] = "algorithm=\"{$value->algorithm}\"";
$params[] = "algorithm={$value->algorithm}";
}

if (isset($value->cnonce)) {
Expand All @@ -245,7 +245,7 @@ public function render(string $hname): string
}

if (isset($value->nc)) {
$params[] = sprintf('nc=%08s', $value->nc);
$params[] = "nc={$value->nc}";
}

if (isset($value->opaque)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/Header/AuthHeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function testShouldRenderWellFormedValues()
$this->assertNotNull($rendered);
$this->assertIsString($rendered);
$this->assertEquals(
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm="MD5",cnonce="7900f98e",qop="auth-int",nc=00000042,opaque="misc"' . "\r\n",
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm=MD5,cnonce="7900f98e",qop="auth-int",nc=42,opaque="misc"' . "\r\n",
$rendered
);

Expand All @@ -204,7 +204,7 @@ public function testShouldRenderWellFormedValues()
$this->assertNotNull($rendered);
$this->assertIsString($rendered);
$this->assertEquals(
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm="MD5",cnonce="7900f98e",qop="auth-int",nc=00000042,opaque="misc"' . "\r\n" .
'Authorization: Digest username="bob",realm="sip.domain.net",domain="sip:sip.domain.net",nonce="a61e5e040207",uri="sip:sip.domain.net",response="KJHAFgHFIUAG",stale=TRUE,algorithm=MD5,cnonce="7900f98e",qop="auth-int",nc=42,opaque="misc"' . "\r\n" .
'Authorization: Basic MiScCreds' . "\r\n",
$rendered
);
Expand Down
4 changes: 2 additions & 2 deletions tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ public function testShouldRenderWellFormedRequests()
'Authorization: Digest username="bob",realm="atlanta.example.com",nonce="ea9c8e88df84f1cec4341ae6cbe5a359",uri="sips:ss2.biloxi.example.com",response="dfe56131d1958046689d83306477ecc",opaque=""' . "\r\n" .
'Date: Thu, 21 Feb 2002 13:02:03 GMT' . "\r\n" .
'Error-Info: <sip:[email protected]>' . "\r\n" .
'Proxy-Authenticate: Digest realm="atlanta.example.com",nonce="f84f1cec41e6cbe5aea9c8e88d359",stale=FALSE,algorithm="MD5",qop="auth",opaque=""' . "\r\n" .
'Proxy-Authenticate: Digest realm="atlanta.example.com",nonce="f84f1cec41e6cbe5aea9c8e88d359",stale=FALSE,algorithm=MD5,qop="auth",opaque=""' . "\r\n" .
'Proxy-Authorization: Digest username="alice",realm="atlanta.example.com",nonce="wf84f1ceczx41ae6cbe5aea9c8e88d359",uri="sip:[email protected]",response="42ce3cef44b22f50c6a6071bc8",opaque=""' . "\r\n" .
'Record-Route: <sip:ss2.biloxi.example.com;lr>' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
Expand All @@ -461,7 +461,7 @@ public function testShouldRenderWellFormedRequests()
'Subject: Hello' . "\r\n" .
'User-Agent: RTCKit\\SIP' . "\r\n" .
'Warning: 301 isi.edu "Incompatible network address type \'E.164\'"' . "\r\n" .
'WWW-Authenticate: Digest realm="atlanta.example.com",nonce="84f1c1ae6cbe5ua9c8e88dfa3ecm3459",stale=FALSE,algorithm="MD5",qop="auth",opaque=""' . "\r\n" .
'WWW-Authenticate: Digest realm="atlanta.example.com",nonce="84f1c1ae6cbe5ua9c8e88dfa3ecm3459",stale=FALSE,algorithm=MD5,qop="auth",opaque=""' . "\r\n" .
'X-Custom-Header: Something truly important' . "\r\n\r\n",
$rendered
);
Expand Down

0 comments on commit 0a47d9d

Please sign in to comment.