Allow link file within package 08/63908/7 accepted/tizen/common/20160406.145308 accepted/tizen/ivi/20160407.001135 accepted/tizen/mobile/20160407.000919 accepted/tizen/tv/20160407.000943 accepted/tizen/wearable/20160407.000956 submit/tizen/20160406.110739
authorsangwan.kwon <sangwan.kwon@samsung.com>
Fri, 18 Mar 2016 04:30:45 +0000 (13:30 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Wed, 6 Apr 2016 10:59:30 +0000 (19:59 +0900)
Change-Id: I58488519188fac7f0af51b24b116e0e90bdef55b
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
25 files changed:
packaging/cert-svc.spec
tests/vcore/CMakeLists.txt
tests/vcore/resource/wgt_negative_link/author-signature.xml [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/config.xml [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/css/style.css [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/icon.png [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/images/tizen_32.png [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/index.html [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/js/main.js [new file with mode: 0644]
tests/vcore/resource/wgt_negative_link/outboundLink [new symlink]
tests/vcore/resource/wgt_negative_link/signature1.xml [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/author-signature.xml [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/config.xml [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/css/style.css [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/icon.png [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/images/tizen_32.png [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/index.html [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/js/main.js [new file with mode: 0644]
tests/vcore/resource/wgt_positive_link/link [new symlink]
tests/vcore/resource/wgt_positive_link/signature1.xml [new file with mode: 0644]
tests/vcore/test-common.cpp
tests/vcore/test-common.h
tests/vcore/test-signature-validator.cpp
vcore/vcore/ReferenceValidator.cpp
vcore/vcore/ReferenceValidator.h

index a995b3f..2c5eb41 100644 (file)
@@ -31,7 +31,7 @@ Requires: ca-certificates-tizen
 %global TZ_SYS_ETC              %{?TZ_SYS_ETC:%TZ_SYS_ETC}%{!?TZ_SYS_ETC:/opt/etc}
 %global TZ_SYS_SHARE            %{?TZ_SYS_SHARE:%TZ_SYS_SHARE}%{!?TZ_SYS_SHARE:/opt/share}
 %global TZ_SYS_RO_SHARE         %{?TZ_SYS_RO_SHARE:%TZ_SYS_RO_SHARE}%{!?TZ_SYS_RO_SHARE:%_datadir}
-%global TZ_SYS_RW_APP           %{?TZ_SYS_RW_APP:%TZ_SYS_RW_APP}%!?TZ_SYS_RW_APP:/opt/usr/apps}
+%global TZ_SYS_RW_APP           %{?TZ_SYS_RW_APP:%TZ_SYS_RW_APP}%{!?TZ_SYS_RW_APP:/opt/usr/apps}
 
 %global TZ_SYS_CA_CERTS         %{?TZ_SYS_CA_CERTS:%TZ_SYS_CA_CERTS}%{!?TZ_SYS_CA_CERTS:%TZ_SYS_ETC/ssl/certs}
 %global TZ_SYS_RO_CA_CERTS_ORIG %{?TZ_SYS_RO_CA_CERTS_ORIG:%TZ_SYS_RO_CA_CERTS_ORIG}%{!?TZ_SYS_CA_RO_CERTS_ORGIN:%TZ_SYS_RO_SHARE/ca-certificates/certs}
index c5b23db..5b78409 100644 (file)
@@ -62,6 +62,8 @@ INSTALL(
         resource/wgt_negative_certificate
         resource/wgt_partner
         resource/wgt_platform
+        resource/wgt_positive_link
+        resource/wgt_negative_link
         resource/tpk
         resource/attacked-tpk
         resource/tpk-with-userdata
diff --git a/tests/vcore/resource/wgt_negative_link/author-signature.xml b/tests/vcore/resource/wgt_negative_link/author-signature.xml
new file mode 100644 (file)
index 0000000..c516425
--- /dev/null
@@ -0,0 +1,82 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="AuthorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3tBypO7GkqT8R7QzlWtIHR1vTTBV8+U2/iNt6xCTHWY=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Yc5/Km/O7fXXLzDC0Xc34K+k00+3OFIEkRFZXNT7pAI=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="images%2Ftizen_32.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>eDr9ZPFlGlapLDnI1BiALwqovNdBvx3Aspc/lWOH3WI=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>vK73PtP7FGlsIb2sihFvwAJX+Ks+GVb8TmdIxtcPGAA=</DigestValue>
+</Reference>
+<Reference URI="js%2Fmain.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>w1nM4fGtFaoLC3nYKx+3P5twAWunve6foHDsA5kJReY=</DigestValue>
+</Reference>
+<Reference URI="outboundLink">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+Xi8Z7uZlb5zbpnptgwGCwtxXMSb/ES9tcOJDgHu9htcYZz1iByEdW4DlJB+B9LpmLMWm5iUC/TZ1
+Ly1qUw/Q24qeVFKbqZOiK2w74CwEdOUs7h1gSuBh2ABxkoaNsJ9mCaxFHRVmEQc1jmWsbnXnCdh7
+8I6XAu1O9AWkyhXFo40=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIIClTCCAX2gAwIBAgIGAVODJIU1MA0GCSqGSIb3DQEBBQUAMFYxGjAYBgNVBAoMEVRpemVuIEFz
+c29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4gRGV2
+ZWxvcGVycyBDQTAeFw0xMjExMDEwMDAwMDBaFw0xOTAxMDEwMDAwMDBaMBExDzANBgNVBAMMBmF1
+dGhvcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqFd1i8Gps0Kb6WIAzCHSB1vbfjVbigOd
+kmOx/ESTS4XHPgA8LfqzjATrsASnCovZjxOkqlBEqENnwHirBAAKFGAfjiJWMrNtpBzpvGWYYe5W
+qqct0AxL8XjmMR2IQo0XjeTMT1MwLf7VsjINYeSiKr0YXDIQvjiHM4zxllfml08CAwEAAaMyMDAw
+DAYDVR0TAQH/BAIwADALBgNVHQ8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwDQYJKoZIhvcN
+AQEFBQADggEBAG1lTFDWrlOobNHe1ZYXGFFfe0z6QHXXjdQcrbooZGgKYGLxuXrRFXkv101RNSu1
+XwCUhOsYVbHzDGHi/VngrbzYrFVPfNaF4HhfD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TDHyrmQDtFziqPY3xWlJBqJtEqXiT7Y+Ljpe66e+Ee/OjQMlZe8gu21/8cKklH
+95RxjopMWCVedXDUbWdvS2+CdyvVW/quT2E0tjqIzXDekUTYwwhlPWlGxvfj3VsxqSFq3p8Brl04
+1Gx5RKAGyKVsMfTLhbbwSWwApuBUxYfcNpKwLWGPXkysu+HctY03OKv4/xKBnVWiN8ex/Sgesi0M
++OBAOMdZMPK32uJBTeKFx1xZgTLIhk45V0hPOomPjZloiv0LSS11eyd451ufjW0iHRE7WlpR6EvI
+W6TFyZgMpQq+kg4hWl2SBTf3s2VI8Ygz7gj8TMlClg==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#AuthorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#AuthorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-author"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#AuthorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_negative_link/config.xml b/tests/vcore/resource/wgt_negative_link/config.xml
new file mode 100644 (file)
index 0000000..9f3f4fe
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/Basic" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="ybGx5Tni2z.Basic" package="ybGx5Tni2z" required_version="2.4"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>Basic</name>
+    <tizen:profile name="mobile"/>
+</widget>
diff --git a/tests/vcore/resource/wgt_negative_link/css/style.css b/tests/vcore/resource/wgt_negative_link/css/style.css
new file mode 100644 (file)
index 0000000..3821d78
--- /dev/null
@@ -0,0 +1,24 @@
+html,
+body {
+    width: 100%;
+    height: 100%;
+    margin: 0 auto;
+    padding: 0;
+    background-color: #222222;
+    color: #ffffff;
+}
+.page {
+    width: 100%;
+    height: 100%;
+    display: table;
+}
+.contents {
+    display: table-cell;
+    vertical-align: middle;
+    text-align: center;
+    -webkit-tap-highlight-color: transparent;
+}
+#content-text {
+    font-weight: bold;
+    font-size: 5em;
+}
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_negative_link/icon.png b/tests/vcore/resource/wgt_negative_link/icon.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/tests/vcore/resource/wgt_negative_link/icon.png differ
diff --git a/tests/vcore/resource/wgt_negative_link/images/tizen_32.png b/tests/vcore/resource/wgt_negative_link/images/tizen_32.png
new file mode 100644 (file)
index 0000000..647c3f9
Binary files /dev/null and b/tests/vcore/resource/wgt_negative_link/images/tizen_32.png differ
diff --git a/tests/vcore/resource/wgt_negative_link/index.html b/tests/vcore/resource/wgt_negative_link/index.html
new file mode 100644 (file)
index 0000000..71ca8f0
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+    <meta name="description" content="Tizen Mobile Web Basic Template" />
+
+    <title>Tizen Mobile Web Basic Application</title>
+
+    <link rel="stylesheet" type="text/css" href="css/style.css" />
+    <script src="js/main.js"></script>
+</head>
+
+<body>
+    <div id="main" class="page">
+        <div class="contents">
+            <span id="content-text">Basic</span>
+        </div>
+    </div>
+</body>
+
+</html>
diff --git a/tests/vcore/resource/wgt_negative_link/js/main.js b/tests/vcore/resource/wgt_negative_link/js/main.js
new file mode 100644 (file)
index 0000000..9c1dff6
--- /dev/null
@@ -0,0 +1,21 @@
+window.onload = function() {
+    // TODO:: Do your initialization job
+
+    // add eventListener for tizenhwkey
+    document.addEventListener('tizenhwkey', function(e) {
+        if (e.keyName === "back") {
+            try {
+                tizen.application.getCurrentApplication().exit();
+            } catch (ignore) {}
+        }
+    });
+
+    // Sample code
+    var mainPage = document.querySelector('#main');
+
+    mainPage.addEventListener("click", function() {
+        var contentText = document.querySelector('#content-text');
+
+        contentText.innerHTML = (contentText.innerHTML === "Basic") ? "Tizen" : "Basic";
+    });
+};
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_negative_link/outboundLink b/tests/vcore/resource/wgt_negative_link/outboundLink
new file mode 120000 (symlink)
index 0000000..977114b
--- /dev/null
@@ -0,0 +1 @@
+../wgt_positive_link/icon.png
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_negative_link/signature1.xml b/tests/vcore/resource/wgt_negative_link/signature1.xml
new file mode 100644 (file)
index 0000000..9100b31
--- /dev/null
@@ -0,0 +1,84 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="DistributorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="author-signature.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>216byXwFRY0ycTNU+u3YEocLm4bZ3IZP+Q+GxwvTuKI=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3tBypO7GkqT8R7QzlWtIHR1vTTBV8+U2/iNt6xCTHWY=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Yc5/Km/O7fXXLzDC0Xc34K+k00+3OFIEkRFZXNT7pAI=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="images%2Ftizen_32.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>eDr9ZPFlGlapLDnI1BiALwqovNdBvx3Aspc/lWOH3WI=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>vK73PtP7FGlsIb2sihFvwAJX+Ks+GVb8TmdIxtcPGAA=</DigestValue>
+</Reference>
+<Reference URI="js%2Fmain.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>w1nM4fGtFaoLC3nYKx+3P5twAWunve6foHDsA5kJReY=</DigestValue>
+</Reference>
+<Reference URI="outboundLink">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>u/jU3U4Zm5ihTMSjKGlGYbWzDfRkGphPPHx3gJIYEJ4=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+Wa4AWsiNy7QNJfPzl3NLSvF1wUCUvwA4LWero5isjXI4SyoFLLufqgleDNU32G6tvhhKfqkwNcCl
+73VcLWEfA+ku+HwJuPm8Eh5FJMvifvqlmZO7Kt2GLiWKhMKM1firJxlhUHSpf7v1elMeRim3RTqg
+SFuyA/hrMRUcuBENGXg=
+</SignatureValue>
+<KeyInfo>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3b24xDjAMBgNVBAcMBVN1d29uMRYwFAYDVQQKDA1UaXplbiBUZXN0IENBMSMw
+IQYDVQQLDBpUVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEpMCcGA1UEAwwgVGl6ZW4gUHVibGlj
+IERpc3RyaWJ1dG9yIFJvb3QgQ0EwHhcNMTIxMDI5MTMwMjUwWhcNMjIxMDI3MTMwMjUwWjCBjzEL
+MAkGA1UEBhMCS1IxDjAMBgNVBAgMBVN1d29uMQ4wDAYDVQQHDAVTdXdvbjEWMBQGA1UECgwNVGl6
+ZW4gVGVzdCBDQTEiMCAGA1UECwwZVGl6ZW4gRGlzdHJpYnV0b3IgVGVzdCBDQTEkMCIGA1UEAwwb
+VGl6ZW4gUHVibGljIERpc3RyaWJ1dG9yIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe
+OTS/3nXvkDEmsFCJIvRlQ3RKDcxdWJJp625pFqHdmoJBdV+x6jl1raGK2Y1sp2Gdvpjc/z92yzAp
+bE/UVLPh/tRNZPeGhzU4ejDDm7kzdr2f7Ia0U98K+OoY12ucwg7TYNItj9is7Cj4blGfuMDzd2ah
+2AgnCGlwNwV/pv+uVQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBACqJ
+KO33YdoGudwanZIxMdXuxnnD9R6u72ltKk1S4zPfMJJv482CRGCI4FK6djhlsI4i0Lt1SVIJEed+
+yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0
+VhfnkHwPltmrpYVe
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#DistributorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#DistributorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-distributor"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#DistributorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_positive_link/author-signature.xml b/tests/vcore/resource/wgt_positive_link/author-signature.xml
new file mode 100644 (file)
index 0000000..bd37184
--- /dev/null
@@ -0,0 +1,82 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="AuthorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3tBypO7GkqT8R7QzlWtIHR1vTTBV8+U2/iNt6xCTHWY=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Yc5/Km/O7fXXLzDC0Xc34K+k00+3OFIEkRFZXNT7pAI=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="images%2Ftizen_32.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>eDr9ZPFlGlapLDnI1BiALwqovNdBvx3Aspc/lWOH3WI=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>vK73PtP7FGlsIb2sihFvwAJX+Ks+GVb8TmdIxtcPGAA=</DigestValue>
+</Reference>
+<Reference URI="js%2Fmain.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>w1nM4fGtFaoLC3nYKx+3P5twAWunve6foHDsA5kJReY=</DigestValue>
+</Reference>
+<Reference URI="link">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>lpo8tUDs054eLlBQXiDPVDVKfw30ZZdtkRs1jd7H5K8=</DigestValue>
+</Reference>
+</SignedInfo>
+<SignatureValue>
+e8VhZG2ZtBl3KlJhf/QvnTzwpv1HeTSK9Urkjb+Lx+4PFZWDFgb9UCKSeh1Kc1giUtOkiBVg0bQO
+oO0akHeDXe5qcDWo94ZxWLDbNuCY7A3+lmX/wvSTZxCa8OM024ium+MP8PzRKlcqew0D8gK1785u
+6YSrtpsdmvdnTI9G/Ew=
+</SignatureValue>
+<KeyInfo>
+<X509Data>
+<X509Certificate>
+MIIClTCCAX2gAwIBAgIGAVODJIU1MA0GCSqGSIb3DQEBBQUAMFYxGjAYBgNVBAoMEVRpemVuIEFz
+c29jaWF0aW9uMRowGAYDVQQLDBFUaXplbiBBc3NvY2lhdGlvbjEcMBoGA1UEAwwTVGl6ZW4gRGV2
+ZWxvcGVycyBDQTAeFw0xMjExMDEwMDAwMDBaFw0xOTAxMDEwMDAwMDBaMBExDzANBgNVBAMMBmF1
+dGhvcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqFd1i8Gps0Kb6WIAzCHSB1vbfjVbigOd
+kmOx/ESTS4XHPgA8LfqzjATrsASnCovZjxOkqlBEqENn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TXOsSFi6VoWeyaPEm18JBHvZBsU5YQtgZ6Kp7MqzvQg3pXOxtajj
+vyHxiatJl+xXrHgcXC1wgyG3buty7u/Fi2mvKXJ0PRJcCjjK81dqe/Vr20sRUCrbk02zbm5ggFt/
+jIEhV8wbFRQpliobc7J4dSTKhFfrqGM8rdd54LYhD7gSI1CFSe16pUXfcVR7FhJztRaiGLnCrwBE
+dyTZ248+D4L/qR/D0axb3jcCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOC
+AQEAnOXXQ/1O/QTDHyrmQDtFziqPY3xWlJBqJtEqXiT7Y+Ljpe66e+Ee/OjQMlZe8gu21/8cKklH
+95RxjopMWCVedXDUbWdvS2+CdyvVW/quT2E0tjqIzXDekUTYwwhlPWlGxvfj3VsxqSFq3p8Brl04
+1Gx5RKAGyKVsMfTLhbbwSWwApuBUxYfcNpKwLWGPXkysu+HctY03OKv4/xKBnVWiN8ex/Sgesi0M
++OBAOMdZMPK32uJBTeKFx1xZgTLIhk45V0hPOomPjZloiv0LSS11eyd451ufjW0iHRE7WlpR6EvI
+W6TFyZgMpQq+kg4hWl2SBTf3s2VI8Ygz7gj8TMlClg==
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#AuthorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#AuthorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-author"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#AuthorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_positive_link/config.xml b/tests/vcore/resource/wgt_positive_link/config.xml
new file mode 100644 (file)
index 0000000..9f3f4fe
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/Basic" version="1.0.0" viewmodes="maximized">
+    <tizen:application id="ybGx5Tni2z.Basic" package="ybGx5Tni2z" required_version="2.4"/>
+    <content src="index.html"/>
+    <feature name="http://tizen.org/feature/screen.size.all"/>
+    <icon src="icon.png"/>
+    <name>Basic</name>
+    <tizen:profile name="mobile"/>
+</widget>
diff --git a/tests/vcore/resource/wgt_positive_link/css/style.css b/tests/vcore/resource/wgt_positive_link/css/style.css
new file mode 100644 (file)
index 0000000..3821d78
--- /dev/null
@@ -0,0 +1,24 @@
+html,
+body {
+    width: 100%;
+    height: 100%;
+    margin: 0 auto;
+    padding: 0;
+    background-color: #222222;
+    color: #ffffff;
+}
+.page {
+    width: 100%;
+    height: 100%;
+    display: table;
+}
+.contents {
+    display: table-cell;
+    vertical-align: middle;
+    text-align: center;
+    -webkit-tap-highlight-color: transparent;
+}
+#content-text {
+    font-weight: bold;
+    font-size: 5em;
+}
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_positive_link/icon.png b/tests/vcore/resource/wgt_positive_link/icon.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/tests/vcore/resource/wgt_positive_link/icon.png differ
diff --git a/tests/vcore/resource/wgt_positive_link/images/tizen_32.png b/tests/vcore/resource/wgt_positive_link/images/tizen_32.png
new file mode 100644 (file)
index 0000000..647c3f9
Binary files /dev/null and b/tests/vcore/resource/wgt_positive_link/images/tizen_32.png differ
diff --git a/tests/vcore/resource/wgt_positive_link/index.html b/tests/vcore/resource/wgt_positive_link/index.html
new file mode 100644 (file)
index 0000000..71ca8f0
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+    <meta name="description" content="Tizen Mobile Web Basic Template" />
+
+    <title>Tizen Mobile Web Basic Application</title>
+
+    <link rel="stylesheet" type="text/css" href="css/style.css" />
+    <script src="js/main.js"></script>
+</head>
+
+<body>
+    <div id="main" class="page">
+        <div class="contents">
+            <span id="content-text">Basic</span>
+        </div>
+    </div>
+</body>
+
+</html>
diff --git a/tests/vcore/resource/wgt_positive_link/js/main.js b/tests/vcore/resource/wgt_positive_link/js/main.js
new file mode 100644 (file)
index 0000000..9c1dff6
--- /dev/null
@@ -0,0 +1,21 @@
+window.onload = function() {
+    // TODO:: Do your initialization job
+
+    // add eventListener for tizenhwkey
+    document.addEventListener('tizenhwkey', function(e) {
+        if (e.keyName === "back") {
+            try {
+                tizen.application.getCurrentApplication().exit();
+            } catch (ignore) {}
+        }
+    });
+
+    // Sample code
+    var mainPage = document.querySelector('#main');
+
+    mainPage.addEventListener("click", function() {
+        var contentText = document.querySelector('#content-text');
+
+        contentText.innerHTML = (contentText.innerHTML === "Basic") ? "Tizen" : "Basic";
+    });
+};
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_positive_link/link b/tests/vcore/resource/wgt_positive_link/link
new file mode 120000 (symlink)
index 0000000..12585c9
--- /dev/null
@@ -0,0 +1 @@
+icon.png
\ No newline at end of file
diff --git a/tests/vcore/resource/wgt_positive_link/signature1.xml b/tests/vcore/resource/wgt_positive_link/signature1.xml
new file mode 100644 (file)
index 0000000..bde3662
--- /dev/null
@@ -0,0 +1,84 @@
+<Signature xmlns="http://www.w3.org/2000/09/xmldsig#" Id="DistributorSignature">
+<SignedInfo>
+<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
+<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"></SignatureMethod>
+<Reference URI="author-signature.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>DUh6Bz3owCQr3cyqdh8qDBzhq9lv+4xTBgKoW30/BH4=</DigestValue>
+</Reference>
+<Reference URI="config.xml">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>3tBypO7GkqT8R7QzlWtIHR1vTTBV8+U2/iNt6xCTHWY=</DigestValue>
+</Reference>
+<Reference URI="css%2Fstyle.css">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>Yc5/Km/O7fXXLzDC0Xc34K+k00+3OFIEkRFZXNT7pAI=</DigestValue>
+</Reference>
+<Reference URI="icon.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="images%2Ftizen_32.png">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>eDr9ZPFlGlapLDnI1BiALwqovNdBvx3Aspc/lWOH3WI=</DigestValue>
+</Reference>
+<Reference URI="index.html">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>vK73PtP7FGlsIb2sihFvwAJX+Ks+GVb8TmdIxtcPGAA=</DigestValue>
+</Reference>
+<Reference URI="js%2Fmain.js">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>w1nM4fGtFaoLC3nYKx+3P5twAWunve6foHDsA5kJReY=</DigestValue>
+</Reference>
+<Reference URI="link">
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<DigestValue>1d0oEZHqPn+QzNzGIHwj9ODby6x9ggFs9uOsav6jPNs=</DigestValue>
+</Reference>
+<Reference URI="#prop">
+<Transforms>
+<Transform Algorithm="http://www.w3.org/2006/12/xml-c14n11"></Transform>
+</Transforms>
+<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"></DigestMethod>
+<D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+
+yc3qckGm19dW+4xdlkekon7pViEBWuyHw8OWv3RXtTum1+PGHjBJ2eYY4ZKIpz73U/1NC16sTB/0
+VhfnkHwPltmrpYVe
+</X509Certificate>
+</X509Data>
+</KeyInfo>
+<Object Id="prop"><SignatureProperties xmlns:dsp="http://www.w3.org/2009/xmldsig-properties"><SignatureProperty Id="profile" Target="#DistributorSignature"><dsp:Profile URI="http://www.w3.org/ns/widgets-digsig#profile"></dsp:Profile></SignatureProperty><SignatureProperty Id="role" Target="#DistributorSignature"><dsp:Role URI="http://www.w3.org/ns/widgets-digsig#role-distributor"></dsp:Role></SignatureProperty><SignatureProperty Id="identifier" Target="#DistributorSignature"><dsp:Identifier></dsp:Identifier></SignatureProperty></SignatureProperties></Object>
+</Signature>
\ No newline at end of file
index 33a83ce..0e8d36b 100644 (file)
@@ -23,6 +23,8 @@ const std::string TestData::widget_negative_signature_path = std::string(TESTAPP
 const std::string TestData::widget_negative_certificate_path = std::string(TESTAPP_RES_DIR) + "apps/wgt_negative_certificate";
 const std::string TestData::widget_partner_path = std::string(TESTAPP_RES_DIR) + "apps/wgt_partner";
 const std::string TestData::widget_platform_path = std::string(TESTAPP_RES_DIR) + "apps/wgt_platform";
+const std::string TestData::widget_positive_link_path = std::string(TESTAPP_RES_DIR) + "apps/wgt_positive_link";
+const std::string TestData::widget_negative_link_path = std::string(TESTAPP_RES_DIR) + "apps/wgt_negative_link";
 
 const std::string TestData::tpk_path = std::string(TESTAPP_RES_DIR) + "apps/tpk";
 const std::string TestData::attacked_tpk_path = std::string(TESTAPP_RES_DIR) + "apps/attacked-tpk";
index ab6154d..204cf51 100644 (file)
@@ -26,6 +26,8 @@ extern const std::string widget_negative_signature_path;
 extern const std::string widget_negative_certificate_path;
 extern const std::string widget_partner_path;
 extern const std::string widget_platform_path;
+extern const std::string widget_positive_link_path;
+extern const std::string widget_negative_link_path;;
 
 extern const std::string tpk_path;
 extern const std::string attacked_tpk_path;
index f507328..640e77e 100644 (file)
@@ -294,6 +294,55 @@ RUNNER_TEST(T00110_positive_platform_uncheck_ref)
                 "visibility check failed.");
     }
 }
+RUNNER_TEST(T00111_positive_wgt_link)
+{
+    SignatureFileInfoSet signatureSet;
+    SignatureFinder signatureFinder(TestData::widget_positive_link_path);
+    RUNNER_ASSERT_MSG(
+        SignatureFinder::NO_ERROR == signatureFinder.find(signatureSet),
+        "SignatureFinder failed");
+
+    for (auto &sig : signatureSet) {
+        SignatureValidator validator(sig);
+        SignatureData data;
+        VCerr result = validator.check(
+                TestData::widget_positive_link_path,
+                true,
+                true,
+                data);
+
+        // this condition is for OCSP Success in signature1.xml
+        if (!data.isAuthorSignature())
+            RUNNER_ASSERT_MSG(result == E_SIG_NONE,
+                "If DT_LNK type point within package, it should be success: "
+                << validator.errorToString(result));
+    }
+}
+
+RUNNER_TEST(T00112_negative_wgt_link)
+{
+    SignatureFileInfoSet signatureSet;
+    SignatureFinder signatureFinder(TestData::widget_negative_link_path);
+    RUNNER_ASSERT_MSG(
+        SignatureFinder::NO_ERROR == signatureFinder.find(signatureSet),
+        "SignatureFinder failed");
+
+    for (auto &sig : signatureSet) {
+        SignatureValidator validator(sig);
+        SignatureData data;
+        VCerr result = validator.check(
+                TestData::widget_negative_link_path,
+                true,
+                true,
+                data);
+
+        if (!data.isAuthorSignature())
+            RUNNER_ASSERT_MSG(result == E_SIG_INVALID_REF,
+                "If DT_LNK type point outside of package, it should be fail: "
+                << validator.errorToString(result));
+    }
+}
+
 RUNNER_TEST(T00151_negative_hash_check_ref)
 {
     SignatureFileInfoSet signatureSet;
index 72fb404..3b59682 100644 (file)
@@ -15,6 +15,7 @@
  */
 /*
  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
+ *              Sangwan Kwon (sangwan.kwon@samsung.com)
  * @file        ReferenceValidator.cpp
  * @version     1.0
  * @brief       Compare signature reference list and list of widget file.
 #include <errno.h>
 #include <fstream>
 #include <memory>
+#include <unistd.h>
+#include <limits.h>
 
 #include <pcrecpp.h>
 
 #include <dpl/log/log.h>
 
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
 namespace {
 
 const char *SPECIAL_SYMBOL_CURRENT_DIR = ".";
@@ -53,7 +60,8 @@ class ReferenceValidator::Impl
 
     virtual ~Impl(){}
 
-    Result checkReferences(const SignatureData &signatureData){
+    Result checkReferences(const SignatureData &signatureData)
+    {
         const ReferenceSet &refSet = signatureData.getReferenceSet();
         ReferenceSet refDecoded;
 
@@ -73,6 +81,19 @@ class ReferenceValidator::Impl
             signatureData.isAuthorSignature());
     }
 
+    Result checkOutbound(const std::string &linkPath, const std::string &appPath)
+    {
+        char resolvedPath[PATH_MAX];
+        if (realpath((appPath + "/" + linkPath).c_str(), resolvedPath) == NULL)
+            return ERROR_READING_LNK;
+
+        std::string linkRealPath(resolvedPath);
+        if (linkRealPath.compare(0, appPath.size(), appPath) == 0)
+            return NO_ERROR;
+        else
+            return ERROR_OUTBOUND_LNK;
+    }
+
   private:
     int hexToInt(char hex);
     std::string decodeProcent(const std::string &path);
@@ -187,6 +208,24 @@ ReferenceValidator::Result ReferenceValidator::Impl::dfsCheckDirectories(
                 closedir(dirp);
                 return ERROR_REFERENCE_NOT_FOUND;
             }
+        } else if (result->d_type == DT_LNK) {
+            std::string linkPath(directory + result->d_name);
+
+            if (referenceSet.end() ==
+                referenceSet.find(linkPath))
+            {
+                LogDebug("Found file : " << (directory + result->d_name));
+                LogError("Unknown ERROR_REFERENCE_NOT_FOUND.");
+                closedir(dirp);
+                return ERROR_REFERENCE_NOT_FOUND;
+            }
+
+            Result ret = checkOutbound(linkPath, m_dirpath);
+            if (ret != NO_ERROR) {
+                LogError("Link file point wrong path");
+                closedir(dirp);
+                return ret;
+            }
         } else {
             LogError("Unknown file type.");
             closedir(dirp);
@@ -218,4 +257,9 @@ ReferenceValidator::Result ReferenceValidator::checkReferences(
     return m_impl->checkReferences(signatureData);
 }
 
+ReferenceValidator::Result ReferenceValidator::checkOutbound(
+    const std::string &linkPath, const std::string &appPath)
+{
+    return m_impl->checkOutbound(linkPath, appPath);
+}
 } // ValidationCore
index b370773..cd819c3 100644 (file)
@@ -15,6 +15,7 @@
  */
 /*
  * @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
+ *              Sangwan Kwon (sangwan.kwon@samsung.com)
  * @file        ReferenceValidator.h
  * @version     1.0
  * @brief       Compare signature reference list with widget package.
@@ -38,7 +39,9 @@ class ReferenceValidator : VcoreDPL::Noncopyable
         ERROR_READING_DIR,
         ERROR_UNSUPPORTED_FILE_TYPE,
         ERROR_REFERENCE_NOT_FOUND,
-        ERROR_DECODING_URL
+        ERROR_DECODING_URL,
+        ERROR_OUTBOUND_LNK,
+        ERROR_READING_LNK
     };
 
     ReferenceValidator(const std::string &dirpath);
@@ -46,6 +49,7 @@ class ReferenceValidator : VcoreDPL::Noncopyable
     virtual ~ReferenceValidator();
 
     Result checkReferences(const SignatureData &signatureData);
+    Result checkOutbound(const std::string &linkPath, const std::string &appPath);
 
   private:
     class Impl;