After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696289 - should return 412 if NOTIFY does not have proper SID
should return 412 if NOTIFY does not have proper SID
Status: RESOLVED FIXED
Product: GUPnP
Classification: Other
Component: gupnp
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GUPnP Maintainers
GUPnP Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-21 13:47 UTC by Jussi Kukkonen
Modified: 2013-05-29 13:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Ensure NOTIFY message has a proper SID (1.07 KB, patch)
2013-03-21 13:48 UTC, Jussi Kukkonen
committed Details | Review

Description Jussi Kukkonen 2013-03-21 13:47:50 UTC
NOTIFY messages should have a SID. SID should start with "uuid:" and should have a unique value after that (The uuid format is also defined but unfortunately only in 1.1). Messages without a proper SID should be replied to with 412 - precondition failed.

This is tested by DLNA CTT test 7.2.16.1, and seems like a sane policy to me (as in I don't see how enforcing this could break anything that was working before).

Christophe: I don't have a CTT test setup yet, if it's easy for you to test this patch next time you run CTT, that would be great.
Comment 1 Jussi Kukkonen 2013-03-21 13:48:35 UTC
Created attachment 239469 [details] [review]
Ensure NOTIFY message has a proper SID
Comment 2 Christophe Prigent 2013-04-11 13:55:16 UTC
Christophe G. checked the patch, it partially fixes it as it allows the test tool to go further with the HTTP error codes testing.

Please find below the headers sent by the test tool and the HTTP error codes expected to have the TC successful:

SID HDR = (null)
-> HTTP 412 

SID HDR = uuid:
-> HTTP 412

SID HDR = uuid:BADsid
-> HTTP 412

NT HDR = (null)
-> HTTP 400

NT HDR = upnp:BADevent
-> HTTP 412

NTS HDR = (null)
-> HTTP 400

NTS HDR = upnp:BADpropchange
-> HTTP 412
Comment 3 Jens Georg 2013-04-17 09:01:12 UTC
Isn't that a separate bug? I mean yes, it's the same testcase falling but for different reasons.
Comment 4 Jussi Kukkonen 2013-04-17 11:10:47 UTC
(In reply to comment #3)
> Isn't that a separate bug? I mean yes, it's the same testcase falling but for
> different reasons.

I agree. I can file new bugs for any remaining things.

(In reply to comment #2)
> SID HDR = (null)
> -> HTTP 412 
> 
> SID HDR = uuid:
> -> HTTP 412

These should now pass.

> SID HDR = uuid:BADsid
> -> HTTP 412

This can only be handled if we check the version in USER-AGENT first: uuid format was only defined in UPnP/1.1. I guess we could do that.

> NT HDR = (null)
> -> HTTP 400
> 
> NTS HDR = (null)
> -> HTTP 400

We reply 412 to these currently and spec is indeed clear: Missing NT or NTS should result in a NOTIFY should result in 400. I'll fix this in another patch.

> NT HDR = upnp:BADevent
> -> HTTP 412

Should work already.

> NTS HDR = upnp:BADpropchange
> -> HTTP 412

Should work already.
Comment 5 Jussi Kukkonen 2013-04-17 20:08:27 UTC
(In reply to comment #4)
> > SID HDR = uuid:BADsid
> > -> HTTP 412
> 
> This can only be handled if we check the version in USER-AGENT first: uuid
> format was only defined in UPnP/1.1. I guess we could do that.

...now that I checked, NOTIFYs don't have USER-AGENT. Subscription responses do have one (called SERVER to be exact) so we could use that. Unfortunately at least at my place all services advertise "UPnP/1.0" -- even the gupnp based services.

> > NT HDR = (null)
> > -> HTTP 400
> > 
> > NTS HDR = (null)
> > -> HTTP 400
> 
> We reply 412 to these currently and spec is indeed clear: Missing NT or NTS
> should result in a NOTIFY should result in 400. I'll fix this in another patch.

I've filed bug 698192.
Comment 6 Jens Georg 2013-04-18 08:48:28 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > > SID HDR = uuid:BADsid
> > > -> HTTP 412
> > 
> > This can only be handled if we check the version in USER-AGENT first: uuid
> > format was only defined in UPnP/1.1. I guess we could do that.
> 
> ...now that I checked, NOTIFYs don't have USER-AGENT. Subscription responses do
> have one (called SERVER to be exact) so we could use that. Unfortunately at
> least at my place all services advertise "UPnP/1.0" -- even the gupnp based
> services.

1.1 isn't really widespread, unfortunately. GUPnP also only implements 1.0.

> 
> > > NT HDR = (null)
> > > -> HTTP 400
> > > 
> > > NTS HDR = (null)
> > > -> HTTP 400
> > 
> > We reply 412 to these currently and spec is indeed clear: Missing NT or NTS
> > should result in a NOTIFY should result in 400. I'll fix this in another patch.
> 
> I've filed bug 698192.

Thanks
Comment 7 Jens Georg 2013-05-29 13:37:29 UTC
Attachment 239469 [details] pushed as be0665b - Ensure NOTIFY message has a proper SID