Change how the state transition diagram is stored

Store the source of the diagram as a url instead of an xml file.
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
Ryan Everett 2023-12-14 14:40:36 +00:00
parent 177a45f556
commit b461b8731c
2 changed files with 6 additions and 183 deletions

View file

@ -1,183 +0,0 @@
<mxfile host="app.diagrams.net" modified="2023-12-07T10:07:36.568Z" agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0" etag="WX9wRn5Pyc0ByqdG18_k" version="22.1.5" type="device">
<diagram name="Page-1" id="FGZeniR9zYej3VAosmPW">
<mxGraphModel dx="1185" dy="603" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="Xme0HpS_r-Lskl_YgTMW-13" value="" style="curved=1;endArrow=classic;html=1;rounded=0;entryX=0.988;entryY=0.663;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" target="Z1zLfVIJwQ9nnBBYjpjK-5" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="300" y="550" as="sourcePoint" />
<mxPoint x="370" y="570" as="targetPoint" />
<Array as="points">
<mxPoint x="301" y="577" />
<mxPoint x="331" y="605" />
<mxPoint x="360" y="570" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Xme0HpS_r-Lskl_YgTMW-14" value="&lt;div&gt;unregister_read&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Xme0HpS_r-Lskl_YgTMW-13" vertex="1" connectable="0">
<mxGeometry x="-0.3881" y="2" relative="1" as="geometry">
<mxPoint x="32" y="-30" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-25" value="unregister_read" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-4" target="Z1zLfVIJwQ9nnBBYjpjK-3" edge="1">
<mxGeometry x="0.6542" y="-2" width="50" height="50" relative="1" as="geometry">
<mxPoint x="414" y="440" as="sourcePoint" />
<mxPoint x="414" y="600" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-42" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="520" y="640" as="sourcePoint" />
<mxPoint x="520" y="280" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-11" value="" style="endArrow=classic;html=1;rounded=0;entryX=1;entryY=1;entryDx=0;entryDy=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-3" target="Z1zLfVIJwQ9nnBBYjpjK-4" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="400" y="560" as="sourcePoint" />
<mxPoint x="399.9999999999998" y="430" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-12" value="&lt;div&gt;register_read&lt;br&gt;&lt;/div&gt;&lt;div&gt;psa_get_and_lock_key_slot_in_memory&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-11" vertex="1" connectable="0">
<mxGeometry x="0.2079" y="-2" relative="1" as="geometry">
<mxPoint y="-11" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-1" value="&lt;div&gt;EMPTY&lt;br&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="120" y="600" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-19" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=0;entryY=0;entryDx=0;entryDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-2" target="Z1zLfVIJwQ9nnBBYjpjK-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="120" y="430" as="sourcePoint" />
<mxPoint x="120" y="560" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-20" value="psa_fail_key_creation" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-19" vertex="1" connectable="0">
<mxGeometry x="0.2079" y="-2" relative="1" as="geometry">
<mxPoint x="2" y="21" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-2" value="FILLING" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="120" y="360" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-3" value="&lt;div&gt;FULL&lt;/div&gt;&lt;div&gt;!has_readers&lt;br&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="400" y="600" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-4" value="&lt;div&gt;FULL&lt;/div&gt;&lt;div&gt;has_readers&lt;br&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="400" y="360" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-5" value="&lt;div&gt;PENDING&lt;/div&gt;&lt;div&gt;DELETION&lt;br&gt;&lt;/div&gt;" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1">
<mxGeometry x="260" y="480" width="80" height="80" as="geometry" />
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-7" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="190" y="600" as="sourcePoint" />
<mxPoint x="188" y="425" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-8" value="psa_get_empty_key_slot" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-7" vertex="1" connectable="0">
<mxGeometry x="0.2079" y="-2" relative="1" as="geometry">
<mxPoint y="-24" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-9" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" target="Z1zLfVIJwQ9nnBBYjpjK-2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="280" as="sourcePoint" />
<mxPoint x="160" y="310.28" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-14" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="200.00427124746216" y="399.6557287525381" as="sourcePoint" />
<mxPoint x="400" y="400" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-18" value="psa_finish_key_creation" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-14" vertex="1" connectable="0">
<mxGeometry x="-0.0497" y="-3" relative="1" as="geometry">
<mxPoint x="8" y="-5" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-15" value="" style="curved=1;endArrow=classic;html=1;rounded=0;entryX=1;entryY=1;entryDx=0;entryDy=0;exitX=0;exitY=1;exitDx=0;exitDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-3" target="Z1zLfVIJwQ9nnBBYjpjK-3" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="416" y="670" as="sourcePoint" />
<mxPoint x="472" y="670" as="targetPoint" />
<Array as="points">
<mxPoint x="414" y="702" />
<mxPoint x="444" y="730" />
<mxPoint x="474" y="702" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-16" value="&lt;div&gt;unregister_read&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-15" vertex="1" connectable="0">
<mxGeometry x="-0.3881" y="2" relative="1" as="geometry">
<mxPoint x="16" y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-26" value="" style="endArrow=classic;html=1;rounded=0;entryX=1;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=1;exitDx=0;exitDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-4" target="Z1zLfVIJwQ9nnBBYjpjK-5" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="280" y="460" as="sourcePoint" />
<mxPoint x="330" y="410" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-27" value="psa_destroy_key" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-26" vertex="1" connectable="0">
<mxGeometry x="0.4866" y="-1" relative="1" as="geometry">
<mxPoint x="11" y="-5" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-28" value="&lt;div&gt;unregister_read&lt;/div&gt;" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-5" target="Z1zLfVIJwQ9nnBBYjpjK-1" edge="1">
<mxGeometry x="0.2766" y="1" width="50" height="50" relative="1" as="geometry">
<mxPoint x="360" y="560" as="sourcePoint" />
<mxPoint x="410" y="510" as="targetPoint" />
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-33" value="" style="endArrow=classic;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-3" target="Z1zLfVIJwQ9nnBBYjpjK-1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="272" y="550" as="sourcePoint" />
<mxPoint x="180" y="600" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-34" value="&lt;div&gt;psa_destroy_key&lt;/div&gt;&lt;div&gt;psa_purge_key&lt;/div&gt;&lt;div&gt;psa_close_key&lt;br&gt;&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-33" vertex="1" connectable="0">
<mxGeometry x="0.4866" y="-1" relative="1" as="geometry">
<mxPoint x="14" y="1" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-41" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="160" y="280" as="sourcePoint" />
<mxPoint x="520" y="280" as="targetPoint" />
<Array as="points" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-44" value="psa_get_empty_key_slot" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-41" vertex="1" connectable="0">
<mxGeometry x="-0.6916" relative="1" as="geometry">
<mxPoint x="25" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-43" value="" style="endArrow=none;html=1;rounded=0;" parent="1" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="480" y="640" as="sourcePoint" />
<mxPoint x="520" y="640" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-45" value="" style="curved=1;endArrow=classic;html=1;rounded=0;entryX=1;entryY=0;entryDx=0;entryDy=0;exitX=0;exitY=0;exitDx=0;exitDy=0;" parent="1" source="Z1zLfVIJwQ9nnBBYjpjK-4" target="Z1zLfVIJwQ9nnBBYjpjK-4" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="409" y="372" as="sourcePoint" />
<mxPoint x="465" y="372" as="targetPoint" />
<Array as="points">
<mxPoint x="411" y="338" />
<mxPoint x="441" y="310" />
<mxPoint x="471" y="338" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="Z1zLfVIJwQ9nnBBYjpjK-46" value="&lt;div&gt;register_read&lt;/div&gt;&lt;div&gt;psa_get_and_lock_key_slot_in_memory&lt;/div&gt;&lt;div&gt;psa_close_key&lt;/div&gt;&lt;div&gt;psa_purge_key&lt;br&gt;&lt;/div&gt;" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="Z1zLfVIJwQ9nnBBYjpjK-45" vertex="1" connectable="0">
<mxGeometry x="-0.3881" y="2" relative="1" as="geometry">
<mxPoint x="21" y="-8" as="offset" />
</mxGeometry>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>

View file

@ -296,6 +296,12 @@ Library functions which operate on a slot will return `PSA_ERROR_BAD_STATE` if t
A state transition diagram can be found in docs/architecture/psa-thread-safety/key-slot-state-transitions.jpg. In this diagram, an arrow between two states `q1` and `q2` with label `f` indicates that if the state of a slot is `q1` immediately before `f`'s linearization point, it may be `q2` immediately after `f`'s linearization point. The linearization point of a state changing call to a function must be a call to `psa_slot_state_transition`.
#### Generating the state transition diagram from source
To generate the state transition diagram in https://app.diagrams.net/, open the following url:
https://viewer.diagrams.net/?tags=%7B%7D&highlight=FFFFFF&edit=_blank&layers=1&nav=1&title=key-slot-state-transitions#R5Vxbd5s4EP4t%2B%2BDH5iAJcXms4ySbrdtNT7qX9MWHgGyrxcABHNv59SsM2EhgDBhs3PVL0CANoBl9fDMaMkC3i%2FWDb3jzz65F7AGUrPUAjQYQAqBh9ieSbGKJIqFYMPOplXTaC57pO0mEUiJdUosEXMfQde2QerzQdB2HmCEnM3zfXfHdpq7NX9UzZiQneDYNOy%2F9h1rhPJZqUN3Lfyd0Nk%2BvDBQ9PrMw0s7JkwRzw3JXGRG6G6Bb33XD%2BGixviV2NHnpvMTj7g%2Bc3d2YT5ywyoDv4H08%2Ffvxj9VX3XGGw5cf3o9PHxJjvBn2MnngAVRspm9o0Td2OIsO7%2F8aj1Mx0585U9B5bgQTnxgW8YP07Ksv9he1bOcn3KSTzm6c2Zc1hqs5DcmzZ5jRmRVzsegK4cJmLcAOjcCLjT6la2LtVGUnJZmnN%2BKHZJ0RJZP0QNwFCf0N65KclbXEYDuPTdqrjP0T0Txj%2BlRmJB4322neG4UdJHapYSMACowkzphjfYy8nbVM2wgCavIT5btLx4pmaCSxFpscf%2FNvcmrbeMk2Rutsv9Emba1puBvEjl8y8v2QqJGOOGiNwF36Jjnul6Hhz0hY0k%2BO%2BxGLW8V522Zshwtsl8p8YhshfePXfpFBkys8uZQ92UHXwYrgE%2FFzJ6Oya1VUpOo3euancWplJKiNpymnduttu0k4wQFhzgGXjk9mNAiJv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G9G153HXtTpQumlZiRl3YhGqLPqV5zS5ThoWzc5barsqbFTwMdbhZUTVRiHsNKwpoCitChZfSXTluMSMprvDigsTeAkprpV0RoECekbQVj%2FH7Gl2UdhXb9Ux1%2FsehoQkMNYcTXBFO%2BhXVwQNp%2BdpwAgWWonRXMFrsdrDA7XKJoVzQUyOhtKIeyWXtryOpVL5Q26jZ2H0h1y6IAXQhEMuT3pwlz55TOohNfcESIXHSeA8TbbNAGpahrMs6RBoS9XL1GrAS0NRNA7GnyV4F6PxNqBK6UaG0%2B6HyJwJ6qTIA6ijDze%2Bso%2BxSPoToZXqpfK3%2Fz9JLT3S5Hk%2FhRNNmX9%2B%2B338yHccr%2FLCqHfLGFaE1%2BkizM%2BpWtTS2X2VrSKgnw2JeqDLc4iOZqvaoW6HPVWJuEQOzXcOaeMQPIlxxwi0ZY%2Ffk1q%2Bj2Gp6XVI7pM4JakoLOq6DGpaiQAuIiGVQGIie6Pxnq6mAl6wJqu9Cv9g3mFVT%2F1WL%2Bfa74OmW%2Brk2T%2Fnkbu4Lg8pFxIKiqtUee0WnLBnW3P%2Bnj7j7%2Fv%2BloLv%2FAA%3D%3D
#### Destruction of a key in use
Problem: In [Key destruction long-term requirements](#key-destruction-long-term-requirements) we require that the key slot is destroyed (by `psa_wipe_key_slot`) even while it's in use (FILLING or with at least one reader).