[prev in list] [next in list] [prev in thread] [next in thread]
List: qemu-discuss
Subject: Qemu secret object not valid UTF-8 error reported
From: Peter Luo <d8514 () sina ! com>
Date: 2020-05-07 6:00:49
Message-ID: 968C44A1-6D76-42C4-B62F-344185E7100D () sina ! com
[Download RAW message or body]
Hi,
I'm using qemu-img to create a luks encrypted image, and the secret object is defined \
to use base64 format.
I was expecting the secret content should be arbitrary bytes when using base64 format \
as per the qemu document. I also copied in the below.
##
# @QCryptoSecretFormat:
#
# The data format that the secret is provided in
#
# @raw: raw bytes. When encoded in JSON only valid UTF-8 sequences can be used
# @base64: arbitrary base64 encoded binary data
# Since: 2.6
##
{ 'enum': 'QCryptoSecretFormat',
'prefix': 'QCRYPTO_SECRET_FORMAT',
'data': ['raw', 'base64']}
However qemu complains not valid UTF-8 and reports an error.
root@host:~# qemu-img create --object \
secret,id=vol-zk0brve6.secret,format=base64,data=ZUYLBsxOrKHhx4rdQdfX35B1PMfC806oX4nCBplrjyw= \
-o encrypt.format=luks,encrypt.key-secret=vol-zk0brve6.secret,encrypt.cipher-alg=aes-256 \
-f qcow2 1.img 10G
Formatting '1.img', fmt=qcow2 size=10737418240 encrypt.format=luks \
encrypt.key-secret=vol-zk0brve6.secret encrypt.cipher-alg=aes-256 cluster_size=65536 \
lazy_refcounts=off refcount_bits=16
qemu-img: 1.img: Data from secret vol-zk0brve6.secret is not valid UTF-8
root@host:~# qemu-img --version
qemu-img version 4.0.0.3
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
Am I using qemu-img in a wrong way?
Thanks,
Peter Luo
[Attachment #3 (text/html)]
<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:-webkit-standard;
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-SG link="#0563C1" vlink="#954F72"><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Hi, <o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>I'm using \
qemu-img to create a luks encrypted image, and the secret object is defined to use \
base64 format. <o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>I was \
expecting the secret content should be arbitrary bytes when using base64 format as \
per the qemu document. I also copied in the below.<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>##<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'># \
@QCryptoSecretFormat:<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>#<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'># The data \
format that the secret is provided in<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>#<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'># @raw: raw \
bytes. When encoded in JSON only valid UTF-8 sequences can be \
used<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'># @base64: \
arbitrary base64 encoded binary data<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'># Since: \
2.6<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>##<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>{ 'enum': \
'QCryptoSecretFormat',<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'> \
'prefix': 'QCRYPTO_SECRET_FORMAT',<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'> \
'data': ['raw', 'base64']} <o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>However \
qemu complains not valid UTF-8 and reports an error.<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>root@host:~# \
qemu-img create --object \
secret,id=vol-zk0brve6.secret,format=base64,data=ZUYLBsxOrKHhx4rdQdfX35B1PMfC806oX4nCBplrjyw= \
-o encrypt.format=luks,encrypt.key-secret=vol-zk0brve6.secret,encrypt.cipher-alg=aes-256 \
-f qcow2 1.img 10G<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Formatting \
'1.img', fmt=qcow2 size=10737418240 encrypt.format=luks \
encrypt.key-secret=vol-zk0brve6.secret encrypt.cipher-alg=aes-256 cluster_size=65536 \
lazy_refcounts=off refcount_bits=16<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>qemu-img: \
1.img: Data from secret vol-zk0brve6.secret is not valid \
UTF-8<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>root@host:~# \
qemu-img --version<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>qemu-img \
version 4.0.0.3<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Copyright \
(c) 2003-2019 Fabrice Bellard and the QEMU Project developers<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Am I using \
qemu-img in a wrong way?<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Thanks,<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"-webkit-standard",serif;color:black'>Peter \
Luo<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt'><o:p> </o:p></span></p></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic