|
66 | 66 | /// Flag for PUK blocked
|
67 | 67 | pub(crate) const ADMIN_FLAGS_1_PUK_BLOCKED: u8 = 0x01;
|
68 | 68 |
|
69 |
| -/// 3DES authentication |
70 |
| -pub(crate) const ALGO_3DES: u8 = 0x03; |
71 |
| - |
72 | 69 | /// Card management key
|
73 | 70 | pub(crate) const KEY_CARDMGM: u8 = 0x9b;
|
74 | 71 |
|
@@ -628,53 +625,6 @@ impl YubiKey {
|
628 | 625 | txn.save_object(object_id, indata)
|
629 | 626 | }
|
630 | 627 |
|
631 |
| - /// Get an auth challenge. |
632 |
| - #[cfg(feature = "untested")] |
633 |
| - pub fn get_auth_challenge(&mut self) -> Result<[u8; 8]> { |
634 |
| - let txn = self.begin_transaction()?; |
635 |
| - |
636 |
| - let response = Apdu::new(Ins::Authenticate) |
637 |
| - .params(ALGO_3DES, KEY_CARDMGM) |
638 |
| - .data([0x7c, 0x02, 0x81, 0x00]) |
639 |
| - .transmit(&txn, 261)?; |
640 |
| - |
641 |
| - if !response.is_success() { |
642 |
| - return Err(Error::AuthenticationError); |
643 |
| - } |
644 |
| - |
645 |
| - Ok(response |
646 |
| - .data() |
647 |
| - .get(4..12) |
648 |
| - .ok_or(Error::SizeError)? |
649 |
| - .try_into()?) |
650 |
| - } |
651 |
| - |
652 |
| - /// Verify an auth response. |
653 |
| - #[cfg(feature = "untested")] |
654 |
| - pub fn verify_auth_response(&mut self, response: [u8; 8]) -> Result<()> { |
655 |
| - let mut data = [0u8; 12]; |
656 |
| - data[0] = 0x7c; |
657 |
| - data[1] = 0x0a; |
658 |
| - data[2] = 0x82; |
659 |
| - data[3] = 0x08; |
660 |
| - data[4..12].copy_from_slice(&response); |
661 |
| - |
662 |
| - let txn = self.begin_transaction()?; |
663 |
| - |
664 |
| - // send the response to the card and a challenge of our own. |
665 |
| - let status_words = Apdu::new(Ins::Authenticate) |
666 |
| - .params(ALGO_3DES, KEY_CARDMGM) |
667 |
| - .data(data) |
668 |
| - .transmit(&txn, 261)? |
669 |
| - .status_words(); |
670 |
| - |
671 |
| - if !status_words.is_success() { |
672 |
| - return Err(Error::AuthenticationError); |
673 |
| - } |
674 |
| - |
675 |
| - Ok(()) |
676 |
| - } |
677 |
| - |
678 | 628 | /// Reset YubiKey.
|
679 | 629 | ///
|
680 | 630 | /// WARNING: this is a destructive operation which will destroy all keys!
|
|
0 commit comments