Changeset 175
- Timestamp:
- 03/08/10 10:31:10 (6 months ago)
- Files:
-
- 6 modified
-
changes/tpmmanager-micro/src/tpmmanager.cpp (modified) (2 diffs)
-
changes/tpmmanager-micro/ui/tpmmanagerbase.ui (modified) (1 diff)
-
trunk/INSTALL (modified) (3 diffs)
-
trunk/README (modified) (1 diff)
-
trunk/src/tpmmanager.cpp (modified) (3 diffs)
-
trunk/ui/tpmmanagerbase.ui (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
changes/tpmmanager-micro/src/tpmmanager.cpp
r174 r175 69 69 myTimer() 70 70 { 71 setupUi(this);72 73 myProgramLabel->setText( QString::fromAscii("TPM Manager V") + QString::fromAscii(VERSION) );71 setupUi(this); 72 73 myProgramLabel->setText( QString::fromAscii("TPM Manager V") + QString::fromAscii(VERSION) ); 74 74 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( close() ) ); 75 76 // connect our custom slots manually 77 connect ( downloadLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString&) ) ); 78 connect ( perseusLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString&) ) ); 79 // we can connect all on_(QWidgetName)_(SIGNAL)(Arguments) slots automagically with one function call (req. Qt 4.4) 80 QMetaObject::connectSlotsByName( parent ); 75 81 76 // connect our custom slots manually 77 connect ( downloadLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString&) ) ); 78 connect ( perseusLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString&) ) ); 79 // we can connect all on_(QWidgetName)_(SIGNAL)(Arguments) slots automagically with one function call (req. Qt 4.4) 80 QMetaObject::connectSlotsByName( parent ); 81 82 struct stat Status; 83 /*return 0 if the file is found. 84 *return -1 if the file is not found. 85 */ 86 int tpmdriver = stat( "/dev/tpm", &Status); 87 int tpm0driver = stat( "/dev/tpm0", &Status); 88 if (tpmdriver == 0 || tpm0driver == 0) 89 driverFound->setPixmap( myOkImage ); 90 else 91 driverFound->setPixmap( myNokImage ); 92 93 try { 94 95 tssFound->setPixmap( myOkImage ); 96 97 if ( TPMInstance.isDisabled() && !TPMInstance.isOwned() ) 98 QMessageBox::information( this, "TPM Not Functional", "The TPM is disabled and no owner is set. You have to enable the TPM in the BIOS to use the functions of the TPM, e.g., to take ownership.\n" ); 99 } 100 catch ( tddl::TDDL_TPM_NotFound &e ) { 101 QMessageBox::critical( this, "Error while trying to communicate with TPM", QString::fromStdString( e.what() ) ); 102 cout << e.what() << endl; 103 driverFound->setPixmap( myNokImage ); 104 tssFound->setPixmap( myUnknownImage ); 105 } catch ( tcs::TPM_Error &e ) { 106 cout << "Unknown error: " << e.what() << endl; 107 } 108 109 // Init status & first view 110 initStatusGroup(); 111 initStatus(); 112 // let the PCRs update every second.. 113 connect( &myTimer, SIGNAL( timeout() ), this, SLOT( slotUpdatePCRs() ) ); 114 myTimer.start( 1000 ); 82 struct stat Status; 83 /*return 0 if the file is found. 84 *return -1 if the file is not found. 85 */ 86 int tpmdriver = stat( "/dev/tpm", &Status); 87 int tpm0driver = stat( "/dev/tpm0", &Status); 88 if (tpmdriver == 0 || tpm0driver == 0) 89 driverFound->setPixmap( myOkImage ); 90 else 91 driverFound->setPixmap( myNokImage ); 92 93 try { 94 95 tssFound->setPixmap( myOkImage ); 96 if ( TPMInstance.isDisabled() && !TPMInstance.isOwned() ) 97 QMessageBox::information( this, "TPM Not Functional", "The TPM is disabled and no owner is set. You have to enable the TPM in the BIOS to use the functions of the TPM, e.g., to take ownership.\n" ); 98 99 } catch ( tddl::TDDL_TPM_NotFound &e ) { 100 QMessageBox::critical( this, "No TPM Driver Found", "A TPM device driver could not be found.\nTPM Manager will quit." ); 101 driverFound->setPixmap( myNokImage ); 102 tssFound->setPixmap( myUnknownImage ); 103 exit(1); 104 } catch ( tcs::TPM_Error &e ) { 105 QMessageBox::critical( this, "Miscellaneous TPM Error", QString::fromStdString( string("An unknown TPM Error occured: ").append( e.what() ) ) ); 106 } 107 108 // Init status & first view 109 initStatusGroup(); 110 initStatus(); 111 // let the PCRs update every second.. 112 connect( &myTimer, SIGNAL( timeout() ), this, SLOT( slotUpdatePCRs() ) ); 113 myTimer.start( 1000 ); 115 114 } 116 115 … … 490 489 TPMInstance.takeOwnership(); 491 490 492 QMessageBox::information( this, "Taking Ownership" , "TPM owner successfully created." ); 493 494 } catch ( tcs::TPM_DEACTIVATED_Error &e ) 495 { 496 QMessageBox::critical( this, "Error: Taking Ownership" , "Sorry. Could not Take Ownership in deactivated mode due to TSS bug. " ); 491 QMessageBox::information( this, "Taking Ownership" , "TPM Owner successfully created." ); 492 493 } catch ( tcs::TPM_DEACTIVATED_Error &e ) { 494 QMessageBox::critical( this, "Taking Ownership Failed" , "Sorry. Could not Take Ownership in deactivated mode due to TSS bug. " ); 497 495 } catch ( TPM_DEFEND_LOCK_RUNNING_Error &e ) { 498 496 std::string msg = "Take Ownership failed (" + string( e.what() ) + ")"; 499 QMessageBox::critical( this, "Error: Taking Ownership", QString::fromStdString( msg ) );497 QMessageBox::critical( this, "Taking Ownership Failed", QString::fromStdString( msg ) ); 500 498 } catch ( tcs::TPM_RETRY_Error &e ) { 501 499 std::string msg = "Take Ownership failed (" + string( e.what() ) + ")"; 502 QMessageBox::critical( this, "Error: Taking Ownership", QString::fromStdString( msg ) );500 QMessageBox::critical( this, "Taking Ownership Failed", QString::fromStdString( msg ) ); 503 501 } 504 502 -
changes/tpmmanager-micro/ui/tpmmanagerbase.ui
r161 r175 2927 2927 </property> 2928 2928 <property name="text"> 2929 <string>(c) 2007 - 20 09by2929 <string>(c) 2007 - 2010 by 2930 2930 Christian StÃŒble (stueble@sirrix.com) 2931 2931 Anoosheh Zaerin (a.zaerin@sirrix.com) -
trunk/INSTALL
r169 r175 2 2 ================== 3 3 4 This package is built using Qt's qmake. qmake automatically generates a makefile from the Qt project file.4 This package is built using Qt's qmake. qmake automatically generates a makefile from the Qt project file. 5 5 6 6 1. Requirements … … 8 8 Since the TPM Manager is based entirely on the Qt UI framework, corresponding header and library ï¬les Qt4 should be in the library path. On some linux distributions you have to install the developer version of Qt to have the header ï¬les used by TPM Manager. 9 9 10 The required programs to install the TPM Manager are:10 Requirements to build the TPM Manager: 11 11 ⢠Qt4 (>= 4.4) 12 12 ⢠TrouSerS 13 The required packages for (k) ubuntu in detail are:13 The required packages for (k)Ubuntu in detail are: 14 14 ⢠build-essential 15 15 ⢠libtspi-dev … … 27 27 your version of Qt prior to compiling TPM Manager as described below. 28 28 29 # qmake -v 30 # QMake version 2.01a 31 # Using Qt version 4.5.2 in /usr/lib 29 32 30 # tar âxzf tpmmanagerâ0.8.tar.gz 31 # cd tpmmanagerâ0.8 32 # qmake ââversion 33 # qmake // if qmake ââversion returns Qt version 3.x.x, use qmakeâqt4 instead 33 If qmake points to a 3.X version of Qt, use qmake-qt4 instead of qmake. 34 35 # tar âxzf tpmmanagerâ0.8.1.tar.gz 36 # cd tpmmanagerâ0.8.1 37 # qmake 34 38 # make 35 # install bin/tpmmanager /path/to/install/directory // e.g., install bin/tpmmanager /usr/local/bin39 # install bin/tpmmanager /path/to/install/directory // e.g., "install bin/tpmmanager /usr/local/bin" 36 40 37 41 3. Usage 38 42 ======== 39 make will create the TPM Manager binary in the bin/ subdirectory. You can run make install to install TPM Manager in default binary path of your system. To start TPM Manager, type tpmmanager on terminal or simply double-click the application icon in your file manager. 43 Make will create the TPM Manager binary in the bin/ subdirectory. You can run make install to install TPM Manager in default binary path of your system. To start TPM Manager, type tpmmanager on terminal or simply double-click the application icon in your file manager. 44 You may also add TPM Manager to your Application starter menu, e.g., in Gnome or KDE. -
trunk/README
r53 r175 1 For questions, bug reports, and comments, visit http://forum.emscb.org 1 For instructions to build and run TPM Manager, see the INSTALL readme file included with this package. 2 For general questions, bug reports, and comments, visit http://sourceforge.net/projects/tpmmanager or http://projects.sirrix.com/tpmmanager. -
trunk/src/tpmmanager.cpp
r173 r175 73 73 myTimer() 74 74 { 75 setupUi(this);76 77 myProgramLabel->setText( QString::fromAscii("TPM Manager V") + QString::fromAscii(VERSION) );75 setupUi(this); 76 77 myProgramLabel->setText( QString::fromAscii("TPM Manager V") + QString::fromAscii(VERSION) ); 78 78 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( close() ) ); 79 79 80 // connect our custom slots manually81 connect ( downloadLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString& ) ) );82 connect ( perseusLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString& ) ) );83 // we can connect all on_(QWidgetName)_(SIGNAL)(Arguments) slots automagically with one function call (req. Qt 4.4)84 QMetaObject::connectSlotsByName( parent );80 // connect our custom slots manually 81 connect ( downloadLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString& ) ) ); 82 connect ( perseusLink, SIGNAL( linkActivated(const QString&) ), this, SLOT( slotProcessURL(const QString& ) ) ); 83 // we can connect all on_(QWidgetName)_(SIGNAL)(Arguments) slots automagically with one function call (req. Qt 4.4) 84 QMetaObject::connectSlotsByName( parent ); 85 85 86 struct stat Status;87 /*return 0 if the file is found.88 *return -1 if the file is not found.89 */90 int tpmdriver = stat( "/dev/tpm", &Status);91 int tpm0driver = stat( "/dev/tpm0", &Status);92 if (tpmdriver == 0 || tpm0driver == 0)93 driverFound->setPixmap( myOkImage );94 else95 driverFound->setPixmap( myNokImage );96 97 try {98 myTSS = new TSS;99 myTPM = new TPM( myTSS->getContextHandle() );100 101 tssFound->setPixmap( myOkImage );102 103 if ( myTPM->isDisabled() && !myTPM->hasOwner() ) 104 QMessageBox::information( this, "TPM Not Functional", "The TPM is disabled and no owner is set. You have to enable the TPM in the BIOS to use the functions of the TPM, e.g., to take ownership.\n" );105 } 106 catch ( TPMDriverNotFound &e ) { 107 cout << e.what() << endl; 108 driverFound->setPixmap( myNokImage);109 tssFound->setPixmap( myUnknownImage );110 } 111 catch ( TSSSystemNotFound &e ) { 112 cout << e.what() << endl; 113 QMessageBox::information( this, "Error: No TSS found", "A TCG Software Stack (TSS) could not be found. When using TrouSerS, make sure the TrouSerS daemon (tcsd) is running.\nMost functionality will be disabled." );114 listBox->setEnabled(false);115 }116 117 // Init status & first view118 initStatusGroup();119 initStatus();120 // let the PCRs update every second..121 connect( &myTimer, SIGNAL( timeout() ), this, SLOT( slotUpdatePCRs() ) );122 myTimer.start( 1000 );86 struct stat Status; 87 /*return 0 if the file is found. 88 *return -1 if the file is not found. 89 */ 90 int tpmdriver = stat( "/dev/tpm", &Status); 91 int tpm0driver = stat( "/dev/tpm0", &Status); 92 if (tpmdriver == 0 || tpm0driver == 0) 93 driverFound->setPixmap( myOkImage ); 94 else 95 driverFound->setPixmap( myNokImage ); 96 97 try { 98 myTSS = new TSS; 99 myTPM = new TPM( myTSS->getContextHandle() ); 100 101 tssFound->setPixmap( myOkImage ); 102 103 if ( myTPM->isDisabled() && !myTPM->hasOwner() ) { 104 QMessageBox::critical( this, "TPM Not Functional", "The TPM is disabled and no TPM Owner is set. You have to enable the TPM in the BIOS to use the functions of the TPM, e.g., to take ownership.\n" ); 105 } 106 107 } catch ( TPMDriverNotFound &e ) { 108 QMessageBox::critical( this, "No TPM Driver Found", "A TPM device driver could not be found.\nTPM Manager will quit." ); 109 driverFound->setPixmap( myNokImage ); 110 tssFound->setPixmap( myUnknownImage ); 111 exit(1); 112 } catch ( TSSSystemNotFound &e ) { 113 QMessageBox::critical( this, "No TSS Found", "A TCG Software Stack (TSS) could not be found. When using TrouSerS, make sure the TrouSerS daemon (tcsd) is running.\nTPM Manager will quit." ); 114 exit(1); 115 } 116 117 // Init status & first view 118 initStatusGroup(); 119 initStatus(); 120 // let the PCRs update every second.. 121 connect( &myTimer, SIGNAL( timeout() ), this, SLOT( slotUpdatePCRs() ) ); 122 myTimer.start( 1000 ); 123 123 } 124 124 … … 466 466 QMessageBox::information( this, "Taking Ownership" , "TPM owner successfully created." ); 467 467 468 } catch ( IsDeactivatedError &e ) 469 { 470 QMessageBox::critical( this, "Error: Taking Ownership" , "Sorry. Could not Take Ownership in deactivated mode due to TSS bug. " ); 471 } catch ( UnknownError &e ) 472 { 468 } catch ( IsDeactivatedError &e ) { 469 QMessageBox::critical( this, "Error: Taking Ownership" , "Sorry. Could not Take Ownership in deactivated mode due to TSS bug. " ); 470 } catch ( UnknownError &e ) { 473 471 QMessageBox::critical( this, "Error: Taking Ownership" , QString( "Could not Take Ownership for the following reason: " ).append( QString::fromStdString( e.what() ) ) ); 474 472 } … … 787 785 } 788 786 // refresh TPM status view & options 789 cout << "TPM_Manager::onMyDisable_clicked(): Refreshing status views." << endl;790 787 initStatusGroup(); 791 788 initStatus(); -
trunk/ui/tpmmanagerbase.ui
r156 r175 2892 2892 </property> 2893 2893 <property name="text"> 2894 <string>(c) 2007 - 20 09by2894 <string>(c) 2007 - 2010 by 2895 2895 Christian StÃŒble (stueble@sirrix.com) 2896 2896 Anoosheh Zaerin (a.zaerin@sirrix.com)
