get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/808055/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 808055,
    "url": "http://patchwork.ozlabs.org/api/patches/808055/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/skiboot/patch/1504161961-12190-7-git-send-email-cclaudio@linux.vnet.ibm.com/",
    "project": {
        "id": 44,
        "url": "http://patchwork.ozlabs.org/api/projects/44/?format=api",
        "name": "skiboot firmware development",
        "link_name": "skiboot",
        "list_id": "skiboot.lists.ozlabs.org",
        "list_email": "skiboot@lists.ozlabs.org",
        "web_url": "http://github.com/open-power/skiboot",
        "scm_url": "http://github.com/open-power/skiboot",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1504161961-12190-7-git-send-email-cclaudio@linux.vnet.ibm.com>",
    "list_archive_url": null,
    "date": "2017-08-31T06:45:54",
    "name": "[06/13] libstb: rename drivers/sw_driver.* to cvc/c1vc_mbedtls.*",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "7b7bac48ba44772abd4916aa9111b220c009069e",
    "submitter": {
        "id": 69305,
        "url": "http://patchwork.ozlabs.org/api/people/69305/?format=api",
        "name": "Claudio Carvalho",
        "email": "cclaudio@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/skiboot/patch/1504161961-12190-7-git-send-email-cclaudio@linux.vnet.ibm.com/mbox/",
    "series": [
        {
            "id": 754,
            "url": "http://patchwork.ozlabs.org/api/series/754/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/skiboot/list/?series=754",
            "date": "2017-08-31T06:45:48",
            "name": "libstb: simplify the initialization of cvc drivers",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/754/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808055/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808055/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "skiboot@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "skiboot@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjXxY22QDz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:47:45 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xjXxY0VzQzDqYx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:47:45 +1000 (AEST)",
            "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xjXw20NWvzDqT0\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 16:46:25 +1000 (AEST)",
            "from pps.filterd (m0098393.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7V6hnOX049266\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 02:46:24 -0400",
            "from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cpa7cn39d-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 02:46:23 -0400",
            "from localhost\n\tby e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <skiboot@lists.ozlabs.org> from <cclaudio@linux.vnet.ibm.com>;\n\tThu, 31 Aug 2017 00:46:23 -0600",
            "from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)\n\tby e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 31 Aug 2017 00:46:21 -0600",
            "from b03ledav004.gho.boulder.ibm.com\n\t(b03ledav004.gho.boulder.ibm.com [9.17.130.235])\n\tby b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7V6kK1t65601782\n\tfor <skiboot@lists.ozlabs.org>; Wed, 30 Aug 2017 23:46:20 -0700",
            "from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C8AA778037\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 00:46:20 -0600 (MDT)",
            "from legolas.ibm.com (unknown [9.85.193.48])\n\tby b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id 2CB4E7804D\n\tfor <skiboot@lists.ozlabs.org>; Thu, 31 Aug 2017 00:46:19 -0600 (MDT)"
        ],
        "From": "Claudio Carvalho <cclaudio@linux.vnet.ibm.com>",
        "To": "skiboot@lists.ozlabs.org",
        "Date": "Thu, 31 Aug 2017 03:45:54 -0300",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "References": "<1504161961-12190-1-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "X-TM-AS-GCONF": "00",
        "x-cbid": "17083106-0004-0000-0000-000012D9FCD7",
        "X-IBM-SpamModules-Scores": "",
        "X-IBM-SpamModules-Versions": "BY=3.00007640; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00910085; UDB=6.00456503;\n\tIPR=6.00690365; \n\tBA=6.00005562; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016938;\n\tXFM=3.00000015; UTC=2017-08-31 06:46:21",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17083106-0005-0000-0000-000080EDB900",
        "Message-Id": "<1504161961-12190-7-git-send-email-cclaudio@linux.vnet.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_01:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=4\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708310102",
        "Subject": "[Skiboot] [PATCH 06/13] libstb: rename drivers/sw_driver.* to\n\tcvc/c1vc_mbedtls.*",
        "X-BeenThere": "skiboot@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "Mailing list for skiboot development <skiboot.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/skiboot/>",
        "List-Post": "<mailto:skiboot@lists.ozlabs.org>",
        "List-Help": "<mailto:skiboot-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/skiboot>,\n\t<mailto:skiboot-request@lists.ozlabs.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Skiboot\"\n\t<skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "This gives a better name to the drivers/sw_driver.* files and also moves\nthem to a better place. The function names are also renamed accordingly.\n\nsw_driver emulates the container version 1 verification code so that we\ncan run tests using mambo. In summary, the function to verify containers\nis not emulated, but the sha512 function is emulated using the sha512\ncode provided by the mbedtls project.\n\nSigned-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com>\n---\n libstb/cvc/Makefile.inc     |  2 +-\n libstb/cvc/c1vc_mbedtls.c   | 76 +++++++++++++++++++++++++++++++++++++++++++++\n libstb/cvc/c1vc_mbedtls.h   | 24 ++++++++++++++\n libstb/drivers/Makefile.inc |  2 +-\n libstb/drivers/sw_driver.c  | 76 ---------------------------------------------\n libstb/drivers/sw_driver.h  | 24 --------------\n libstb/rom.c                |  4 +--\n 7 files changed, 104 insertions(+), 104 deletions(-)\n create mode 100644 libstb/cvc/c1vc_mbedtls.c\n create mode 100644 libstb/cvc/c1vc_mbedtls.h\n delete mode 100644 libstb/drivers/sw_driver.c\n delete mode 100644 libstb/drivers/sw_driver.h",
    "diff": "diff --git a/libstb/cvc/Makefile.inc b/libstb/cvc/Makefile.inc\nindex 8ce86d5..ab3419e 100644\n--- a/libstb/cvc/Makefile.inc\n+++ b/libstb/cvc/Makefile.inc\n@@ -4,7 +4,7 @@ CVC_DIR = libstb/cvc\n \n SUBDIRS += $(CVC_DIR)\n \n-CVC_SRCS = c1vc.c\n+CVC_SRCS = c1vc.c c1vc_mbedtls.c\n CVC_OBJS = $(CVC_SRCS:%.c=%.o)\n CVC = $(CVC_DIR)/built-in.o\n \ndiff --git a/libstb/cvc/c1vc_mbedtls.c b/libstb/cvc/c1vc_mbedtls.c\nnew file mode 100644\nindex 0000000..8a7c404\n--- /dev/null\n+++ b/libstb/cvc/c1vc_mbedtls.c\n@@ -0,0 +1,76 @@\n+/* Copyright 2013-2016 IBM Corp.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * \thttp://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ * implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#include <chip.h>\n+#include <string.h>\n+#include <skiboot.h>\n+#include \"../rom.h\"\n+#include \"sha512.h\"\n+#include \"c1vc_mbedtls.h\"\n+\n+static sha2_hash_t *hw_key_hash = NULL;\n+\n+static int c1vc_mbedtls_verify(void *container __unused)\n+{\n+\treturn -100;\n+}\n+\n+static void c1vc_mbedtls_sha512(const uint8_t *data, size_t len, uint8_t *digest)\n+{\n+\tmbedtls_sha512_context ctx;\n+\tmbedtls_sha512_init(&ctx);\n+\tmemset(digest, 0, sizeof(sha2_hash_t));\n+\tmbedtls_sha512_starts(&ctx, 0); // SHA512 = 0\n+\tmbedtls_sha512_update(&ctx, data, len);\n+\tmbedtls_sha512_finish(&ctx, digest);\n+\tmbedtls_sha512_free(&ctx);\n+}\n+\n+static void c1vc_mbedtls_cleanup(void)\n+{\n+\treturn;\n+}\n+\n+static struct container_verification_code c1vc = {\n+\t.name    = \"software\",\n+\t.verify  = c1vc_mbedtls_verify,\n+\t.sha512  = c1vc_mbedtls_sha512,\n+\t.cleanup = c1vc_mbedtls_cleanup\n+};\n+\n+void c1vc_mbedtls_probe(const struct dt_node *node)\n+{\n+\tconst char* hash_algo;\n+\n+\tif (!dt_node_is_compatible(node, \"ibm,secureboot-v1-softrom\")) {\n+\t\treturn;\n+\t}\n+\n+\thash_algo = dt_prop_get(node, \"hash-algo\");\n+\tif (strcmp(hash_algo, \"sha512\")) {\n+\t\t/**\n+\t\t * @fwts-label ROMHashAlgorithmInvalid\n+\t\t * @fwts-advice Hostboot creates the ibm,secureboot node and\n+\t\t * the hash-algo property. Check that the ibm,secureboot node\n+\t\t * layout has not changed.\n+\t\t */\n+\t\tprlog(PR_ERR, \"ROM: hash-algo=%s not expected\\n\", hash_algo);\n+\t\treturn;\n+\t}\n+\thw_key_hash = (sha2_hash_t*) dt_prop_get(node, \"hw-key-hash\");\n+\n+\trom_set_driver(&c1vc);\n+}\ndiff --git a/libstb/cvc/c1vc_mbedtls.h b/libstb/cvc/c1vc_mbedtls.h\nnew file mode 100644\nindex 0000000..9027138\n--- /dev/null\n+++ b/libstb/cvc/c1vc_mbedtls.h\n@@ -0,0 +1,24 @@\n+/* Copyright 2013-2016 IBM Corp.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+ * implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#ifndef __C1VC_MBEDTLS_H\n+#define __C1VC_MBEDTLS_H\n+\n+#include <device.h>\n+\n+extern void c1vc_mbedtls_probe(const struct dt_node *node);\n+\n+#endif /* __C1VC_MBEDTLS_H */\ndiff --git a/libstb/drivers/Makefile.inc b/libstb/drivers/Makefile.inc\nindex 6425208..4ea867f 100644\n--- a/libstb/drivers/Makefile.inc\n+++ b/libstb/drivers/Makefile.inc\n@@ -4,7 +4,7 @@ DRIVERS_DIR = libstb/drivers\n \n SUBDIRS += $(DRIVERS_DIR)\n \n-DRIVERS_SRCS = tpm_i2c_interface.c tpm_i2c_nuvoton.c sw_driver.c sha512.c\n+DRIVERS_SRCS = tpm_i2c_interface.c tpm_i2c_nuvoton.c sha512.c\n DRIVERS_OBJS = $(DRIVERS_SRCS:%.c=%.o)\n DRIVERS = $(DRIVERS_DIR)/built-in.o\n \ndiff --git a/libstb/drivers/sw_driver.c b/libstb/drivers/sw_driver.c\ndeleted file mode 100644\nindex 55224a2..0000000\n--- a/libstb/drivers/sw_driver.c\n+++ /dev/null\n@@ -1,76 +0,0 @@\n-/* Copyright 2013-2016 IBM Corp.\n- *\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- * \thttp://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing, software\n- * distributed under the License is distributed on an \"AS IS\" BASIS,\n- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n- * implied.\n- * See the License for the specific language governing permissions and\n- * limitations under the License.\n- */\n-\n-#include <chip.h>\n-#include <string.h>\n-#include <skiboot.h>\n-#include \"../rom.h\"\n-#include \"sha512.h\"\n-#include \"sw_driver.h\"\n-\n-static sha2_hash_t *hw_key_hash = NULL;\n-\n-static int stb_software_verify(void *container __unused)\n-{\n-\treturn -100;\n-}\n-\n-static void stb_software_sha512(const uint8_t *data, size_t len, uint8_t *digest)\n-{\n-\tmbedtls_sha512_context ctx;\n-\tmbedtls_sha512_init(&ctx);\n-\tmemset(digest, 0, sizeof(sha2_hash_t));\n-\tmbedtls_sha512_starts(&ctx, 0); // SHA512 = 0\n-\tmbedtls_sha512_update(&ctx, data, len);\n-\tmbedtls_sha512_finish(&ctx, digest);\n-\tmbedtls_sha512_free(&ctx);\n-}\n-\n-static void stb_software_cleanup(void)\n-{\n-\treturn;\n-}\n-\n-static struct container_verification_code c1vc = {\n-\t.name    = \"software\",\n-\t.verify  = stb_software_verify,\n-\t.sha512  = stb_software_sha512,\n-\t.cleanup = stb_software_cleanup\n-};\n-\n-void stb_software_probe(const struct dt_node *node)\n-{\n-\tconst char* hash_algo;\n-\n-\tif (!dt_node_is_compatible(node, \"ibm,secureboot-v1-softrom\")) {\n-\t\treturn;\n-\t}\n-\n-\thash_algo = dt_prop_get(node, \"hash-algo\");\n-\tif (strcmp(hash_algo, \"sha512\")) {\n-\t\t/**\n-\t\t * @fwts-label ROMHashAlgorithmInvalid\n-\t\t * @fwts-advice Hostboot creates the ibm,secureboot node and\n-\t\t * the hash-algo property. Check that the ibm,secureboot node\n-\t\t * layout has not changed.\n-\t\t */\n-\t\tprlog(PR_ERR, \"ROM: hash-algo=%s not expected\\n\", hash_algo);\n-\t\treturn;\n-\t}\n-\thw_key_hash = (sha2_hash_t*) dt_prop_get(node, \"hw-key-hash\");\n-\n-\trom_set_driver(&c1vc);\n-}\ndiff --git a/libstb/drivers/sw_driver.h b/libstb/drivers/sw_driver.h\ndeleted file mode 100644\nindex 73adabf..0000000\n--- a/libstb/drivers/sw_driver.h\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-/* Copyright 2013-2016 IBM Corp.\n- *\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- *      http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing, software\n- * distributed under the License is distributed on an \"AS IS\" BASIS,\n- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n- * implied.\n- * See the License for the specific language governing permissions and\n- * limitations under the License.\n- */\n-\n-#ifndef __SW_DRIVER_H\n-#define __SW_DRIVER_H\n-\n-#include <device.h>\n-\n-extern void stb_software_probe(const struct dt_node *node);\n-\n-#endif /* __ROMCODE_H */\ndiff --git a/libstb/rom.c b/libstb/rom.c\nindex 9054420..04ab364 100644\n--- a/libstb/rom.c\n+++ b/libstb/rom.c\n@@ -17,7 +17,7 @@\n #include <skiboot.h>\n #include \"rom.h\"\n #include \"cvc/c1vc.h\"\n-#include \"drivers/sw_driver.h\"\n+#include \"cvc/c1vc_mbedtls.h\"\n \n static struct container_verification_code *c1vc = NULL;\n \n@@ -30,7 +30,7 @@ struct container_verification_code* rom_init(const struct dt_node *node __unused\n \tc1vc_probe(node);\n \n \tif (!c1vc)\n-\t\tstb_software_probe(node);\n+\t\tc1vc_mbedtls_probe(node);\n \n \tif (!c1vc)\n \t\tprlog(PR_NOTICE, \"ROM: no rom driver found\\n\");\n",
    "prefixes": [
        "06/13"
    ]
}