Skip to content

Commit b3bbc34

Browse files
committed
Change error name to avoid hiffy conflict
The name `SprotError` is already used in hubris. This is technically fine but is causing some conflicts with our other tooling. Change the name to avoid conflicts.
1 parent 3cc953c commit b3bbc34

File tree

3 files changed

+53
-37
lines changed

3 files changed

+53
-37
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

attest-data/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "attest-data"
3-
version = "0.3.0"
3+
version = "0.4.0"
44
edition = "2021"
55

66
[dependencies]

attest-data/src/messages.rs

Lines changed: 51 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ pub enum HostToRotError {
8282
/// Unexpected command returned
8383
UnexpectedCommand,
8484
/// Error return from the sprot command
85-
SprotError(SprotError),
85+
SprotError(RecvSprotError),
8686
}
8787

8888
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
8989
#[repr(u32)]
9090
// Errors returned from the hubris side. This is _so many_
91-
pub enum SprotError {
91+
pub enum RecvSprotError {
9292
// protocol
9393
/// CRC check failed.
9494
ProtocolInvalidCrc,
@@ -164,8 +164,8 @@ pub enum RotToHost {
164164
RotTqSign,
165165
}
166166

167-
impl From<SprotError> for RotToHost {
168-
fn from(e: SprotError) -> Self {
167+
impl From<RecvSprotError> for RotToHost {
168+
fn from(e: RecvSprotError) -> Self {
169169
RotToHost::HostToRotError(HostToRotError::SprotError(e))
170170
}
171171
}
@@ -343,139 +343,155 @@ mod tests {
343343
(HostToRotError::IncorrectDataLen, [4, 0, 0, 0]),
344344
(HostToRotError::UnexpectedCommand, [5, 0, 0, 0]),
345345
(
346-
HostToRotError::SprotError(SprotError::ProtocolInvalidCrc),
346+
HostToRotError::SprotError(RecvSprotError::ProtocolInvalidCrc),
347347
[6, 0, 0, 0],
348348
),
349349
(
350-
HostToRotError::SprotError(SprotError::ProtocolFlowError),
350+
HostToRotError::SprotError(RecvSprotError::ProtocolFlowError),
351351
[6, 1, 0, 0],
352352
),
353353
(
354354
HostToRotError::SprotError(
355-
SprotError::ProtocolUnsupportedProtocol,
355+
RecvSprotError::ProtocolUnsupportedProtocol,
356356
),
357357
[6, 2, 0, 0],
358358
),
359359
(
360-
HostToRotError::SprotError(SprotError::ProtocolBadMessageType),
360+
HostToRotError::SprotError(
361+
RecvSprotError::ProtocolBadMessageType,
362+
),
361363
[6, 3, 0, 0],
362364
),
363365
(
364366
HostToRotError::SprotError(
365-
SprotError::ProtocolBadMessageLength,
367+
RecvSprotError::ProtocolBadMessageLength,
366368
),
367369
[6, 4, 0, 0],
368370
),
369371
(
370-
HostToRotError::SprotError(SprotError::ProtocolCannotAssertCSn),
372+
HostToRotError::SprotError(
373+
RecvSprotError::ProtocolCannotAssertCSn,
374+
),
371375
[6, 5, 0, 0],
372376
),
373377
(
374-
HostToRotError::SprotError(SprotError::ProtocolTimeout),
378+
HostToRotError::SprotError(RecvSprotError::ProtocolTimeout),
375379
[6, 6, 0, 0],
376380
),
377381
(
378-
HostToRotError::SprotError(SprotError::ProtocolDeserialization),
382+
HostToRotError::SprotError(
383+
RecvSprotError::ProtocolDeserialization,
384+
),
379385
[6, 7, 0, 0],
380386
),
381387
(
382388
HostToRotError::SprotError(
383-
SprotError::ProtocolRotIrqRemainsAsserted,
389+
RecvSprotError::ProtocolRotIrqRemainsAsserted,
384390
),
385391
[6, 8, 0, 0],
386392
),
387393
(
388394
HostToRotError::SprotError(
389-
SprotError::ProtocolUnexpectedResponse,
395+
RecvSprotError::ProtocolUnexpectedResponse,
390396
),
391397
[6, 9, 0, 0],
392398
),
393399
(
394-
HostToRotError::SprotError(SprotError::ProtocolBadUpdateStatus),
400+
HostToRotError::SprotError(
401+
RecvSprotError::ProtocolBadUpdateStatus,
402+
),
395403
[6, 10, 0, 0],
396404
),
397405
(
398-
HostToRotError::SprotError(SprotError::ProtocolTaskRestarted),
406+
HostToRotError::SprotError(
407+
RecvSprotError::ProtocolTaskRestarted,
408+
),
399409
[6, 11, 0, 0],
400410
),
401411
(
402-
HostToRotError::SprotError(SprotError::ProtocolDesynchronized),
412+
HostToRotError::SprotError(
413+
RecvSprotError::ProtocolDesynchronized,
414+
),
403415
[6, 12, 0, 0],
404416
),
405417
(
406-
HostToRotError::SprotError(SprotError::SpiBadTransferSize),
418+
HostToRotError::SprotError(RecvSprotError::SpiBadTransferSize),
407419
[6, 13, 0, 0],
408420
),
409421
(
410-
HostToRotError::SprotError(SprotError::SpiTaskRestarted),
422+
HostToRotError::SprotError(RecvSprotError::SpiTaskRestarted),
411423
[6, 14, 0, 0],
412424
),
413425
(
414-
HostToRotError::SprotError(SprotError::UpdateError),
426+
HostToRotError::SprotError(RecvSprotError::UpdateError),
415427
[6, 15, 0, 0],
416428
),
417429
(
418-
HostToRotError::SprotError(SprotError::SprocketsError),
430+
HostToRotError::SprotError(RecvSprotError::SprocketsError),
419431
[6, 16, 0, 0],
420432
),
421433
(
422-
HostToRotError::SprotError(SprotError::WatchdogError),
434+
HostToRotError::SprotError(RecvSprotError::WatchdogError),
423435
[6, 17, 0, 0],
424436
),
425437
(
426-
HostToRotError::SprotError(SprotError::AttestCertTooBig),
438+
HostToRotError::SprotError(RecvSprotError::AttestCertTooBig),
427439
[6, 18, 0, 0],
428440
),
429441
(
430-
HostToRotError::SprotError(SprotError::AttestInvalidCertIndex),
442+
HostToRotError::SprotError(
443+
RecvSprotError::AttestInvalidCertIndex,
444+
),
431445
[6, 19, 0, 0],
432446
),
433447
(
434-
HostToRotError::SprotError(SprotError::AttestNoCerts),
448+
HostToRotError::SprotError(RecvSprotError::AttestNoCerts),
435449
[6, 20, 0, 0],
436450
),
437451
(
438-
HostToRotError::SprotError(SprotError::AttestOutOfRange),
452+
HostToRotError::SprotError(RecvSprotError::AttestOutOfRange),
439453
[6, 21, 0, 0],
440454
),
441455
(
442-
HostToRotError::SprotError(SprotError::AttestLogFull),
456+
HostToRotError::SprotError(RecvSprotError::AttestLogFull),
443457
[6, 22, 0, 0],
444458
),
445459
(
446-
HostToRotError::SprotError(SprotError::AttestLogTooBig),
460+
HostToRotError::SprotError(RecvSprotError::AttestLogTooBig),
447461
[6, 23, 0, 0],
448462
),
449463
(
450-
HostToRotError::SprotError(SprotError::AttestTaskRestarted),
464+
HostToRotError::SprotError(RecvSprotError::AttestTaskRestarted),
451465
[6, 24, 0, 0],
452466
),
453467
(
454-
HostToRotError::SprotError(SprotError::AttestBadLease),
468+
HostToRotError::SprotError(RecvSprotError::AttestBadLease),
455469
[6, 25, 0, 0],
456470
),
457471
(
458472
HostToRotError::SprotError(
459-
SprotError::AttestUnsupportedAlgorithm,
473+
RecvSprotError::AttestUnsupportedAlgorithm,
460474
),
461475
[6, 26, 0, 0],
462476
),
463477
(
464-
HostToRotError::SprotError(SprotError::AttestSerializeLog),
478+
HostToRotError::SprotError(RecvSprotError::AttestSerializeLog),
465479
[6, 27, 0, 0],
466480
),
467481
(
468482
HostToRotError::SprotError(
469-
SprotError::AttestSerializeSignature,
483+
RecvSprotError::AttestSerializeSignature,
470484
),
471485
[6, 28, 0, 0],
472486
),
473487
(
474-
HostToRotError::SprotError(SprotError::AttestSignatureTooBig),
488+
HostToRotError::SprotError(
489+
RecvSprotError::AttestSignatureTooBig,
490+
),
475491
[6, 29, 0, 0],
476492
),
477493
(
478-
HostToRotError::SprotError(SprotError::CommsBufTooSmall),
494+
HostToRotError::SprotError(RecvSprotError::CommsBufTooSmall),
479495
[6, 30, 0, 0],
480496
),
481497
];

0 commit comments

Comments
 (0)