| 355 | } |
| 356 | |
| 357 | SecurityStrategy ShouldSecureCommandClass(uint8 CommandClass) { |
| 358 | string securestrategy; |
| 359 | Options::Get()->GetOptionAsString( "SecurityStrategy", &securestrategy ); |
| 360 | |
| 361 | if (ToUpper(securestrategy) == "ESSENTIAL") { |
| 362 | return SecurityStrategy_Essential; |
| 363 | } else if (ToUpper(securestrategy) == "SUPPORTED") { |
| 364 | return SecurityStrategy_Supported; |
| 365 | } else if (ToUpper(securestrategy) == "CUSTOM") { |
| 366 | string customsecurecc; |
| 367 | Options::Get()->GetOptionAsString( "CustomSecuredCC", &customsecurecc); |
| 368 | |
| 369 | char* pos = const_cast<char*>(customsecurecc.c_str()); |
| 370 | while( *pos ) |
| 371 | { |
| 372 | if (CommandClass == (uint8)strtol( pos, &pos, 16 )) { |
| 373 | return SecurityStrategy_Supported; |
| 374 | } |
| 375 | if( (*pos) == ',' ) |
| 376 | { |
| 377 | ++pos; |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | return SecurityStrategy_Essential; |
| 382 | } |
| 383 | |
| 384 | } |
no test coverage detected