AusweisApp2
PersoSimWorkaround.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "CardConnectionWorker.h"
10 #include "SelectBuilder.h"
11 
12 #include <QDataStream>
13 
14 namespace governikus
15 {
16 
18 {
19  private:
20  PersoSimWorkaround() = delete;
21  Q_DISABLE_COPY(PersoSimWorkaround)
22 
23  public:
24  /*
25  * The PersoSim engine needs a select on EF.CardAccess to properly process MSE:Set AT.
26  *
27  * This is now needed, because we read EF.CardAccess just once on card recognition and store it.
28  * Therefore sending an MSE:Set AT is now no longer preceded by selecting and reading EF.CardAccess.
29  * This change caused the error with PersoSim.
30  *
31  * As soon as PersoSim is fixed in that point, we will remove the workaround.
32  */
33  static CardReturnCode sendingMseSetAt(const QSharedPointer<CardConnectionWorker>& pCardConnectionWorker)
34  {
35  auto [returnCode, response] = pCardConnectionWorker->transmit(SelectBuilder(FileRef::efCardAccess()).build());
36 
37  if (response.getReturnCode() == StatusCode::EMPTY)
38  {
39  return CardReturnCode::RETRY_ALLOWED;
40  }
41 
42  if (returnCode == CardReturnCode::COMMAND_FAILED)
43  {
44  return CardReturnCode::OK;
45  }
46 
47  return returnCode;
48  }
49 
50 
51 };
52 
53 } // namespace governikus
Definition: PersoSimWorkaround.h:18
static CardReturnCode sendingMseSetAt(const QSharedPointer< CardConnectionWorker > &pCardConnectionWorker)
Definition: PersoSimWorkaround.h:33
Definition: SelectBuilder.h:15
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
static FileRef efCardAccess()
Definition: FileRef.cpp:23