| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | #include "wizard/studio.h" |
|---|
| 44 | #include "wizard/authenticate.h" |
|---|
| 45 | #include "wizard/exception.h" |
|---|
| 46 | #include "wizard/exception-private.h" |
|---|
| 47 | #include "wizard/memory_.h" |
|---|
| 48 | #include "wizard/secret.h" |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | #define SecretKeyLength 1024 |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | struct _AuthenticateInfo |
|---|
| 59 | { |
|---|
| 60 | AuthenticateMethod |
|---|
| 61 | method; |
|---|
| 62 | |
|---|
| 63 | void |
|---|
| 64 | *handle; |
|---|
| 65 | |
|---|
| 66 | time_t |
|---|
| 67 | timestamp; |
|---|
| 68 | |
|---|
| 69 | unsigned long |
|---|
| 70 | signature; |
|---|
| 71 | }; |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | WizardExport AuthenticateInfo *AcquireAuthenticateInfo( |
|---|
| 101 | const AuthenticateMethod method,const char *path,const HashType hash) |
|---|
| 102 | { |
|---|
| 103 | AuthenticateInfo |
|---|
| 104 | *authenticate_info; |
|---|
| 105 | |
|---|
| 106 | authenticate_info=(AuthenticateInfo *) AcquireWizardMemory( |
|---|
| 107 | sizeof(*authenticate_info)); |
|---|
| 108 | if (authenticate_info == (AuthenticateInfo *) NULL) |
|---|
| 109 | ThrowWizardFatalError(AuthenticateDomain,MemoryError); |
|---|
| 110 | (void) ResetWizardMemory(authenticate_info,0,sizeof(*authenticate_info)); |
|---|
| 111 | authenticate_info->method=method; |
|---|
| 112 | switch (method) |
|---|
| 113 | { |
|---|
| 114 | case SecretAuthenticateMethod: |
|---|
| 115 | { |
|---|
| 116 | authenticate_info->handle=(AuthenticateInfo *) AcquireSecretInfo(path, |
|---|
| 117 | hash,SecretKeyLength); |
|---|
| 118 | break; |
|---|
| 119 | } |
|---|
| 120 | default: |
|---|
| 121 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 122 | } |
|---|
| 123 | authenticate_info->timestamp=time((time_t *) NULL); |
|---|
| 124 | authenticate_info->signature=WizardSignature; |
|---|
| 125 | return(authenticate_info); |
|---|
| 126 | } |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | WizardExport WizardBooleanType AuthenticateKey( |
|---|
| 154 | AuthenticateInfo *authenticate_info,ExceptionInfo *exception) |
|---|
| 155 | { |
|---|
| 156 | WizardBooleanType |
|---|
| 157 | status; |
|---|
| 158 | |
|---|
| 159 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 160 | WizardAssert(AuthenticateDomain, |
|---|
| 161 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 162 | WizardAssert(AuthenticateDomain, |
|---|
| 163 | authenticate_info->signature == WizardSignature); |
|---|
| 164 | WizardAssert(AuthenticateDomain, |
|---|
| 165 | authenticate_info->handle != (AuthenticateInfo *) NULL); |
|---|
| 166 | status=WizardFalse; |
|---|
| 167 | switch (authenticate_info->method) |
|---|
| 168 | { |
|---|
| 169 | case SecretAuthenticateMethod: |
|---|
| 170 | { |
|---|
| 171 | SecretInfo |
|---|
| 172 | *secret_info; |
|---|
| 173 | |
|---|
| 174 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 175 | status=AuthenticateSecretKey(secret_info,exception); |
|---|
| 176 | break; |
|---|
| 177 | } |
|---|
| 178 | default: |
|---|
| 179 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 180 | } |
|---|
| 181 | return(status); |
|---|
| 182 | } |
|---|
| 183 | |
|---|
| 184 | |
|---|
| 185 | |
|---|
| 186 | |
|---|
| 187 | |
|---|
| 188 | |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | |
|---|
| 199 | |
|---|
| 200 | |
|---|
| 201 | |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | |
|---|
| 207 | |
|---|
| 208 | WizardExport AuthenticateInfo *DestroyAuthenticateInfo( |
|---|
| 209 | AuthenticateInfo *authenticate_info) |
|---|
| 210 | { |
|---|
| 211 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 212 | WizardAssert(AuthenticateDomain, |
|---|
| 213 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 214 | WizardAssert(AuthenticateDomain, |
|---|
| 215 | authenticate_info->signature == WizardSignature); |
|---|
| 216 | if (authenticate_info->handle != (AuthenticateInfo *) NULL) |
|---|
| 217 | switch (authenticate_info->method) |
|---|
| 218 | { |
|---|
| 219 | case SecretAuthenticateMethod: |
|---|
| 220 | { |
|---|
| 221 | authenticate_info->handle=DestroySecretInfo((SecretInfo *) |
|---|
| 222 | authenticate_info->handle); |
|---|
| 223 | break; |
|---|
| 224 | } |
|---|
| 225 | default: |
|---|
| 226 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 227 | } |
|---|
| 228 | authenticate_info->signature=(~WizardSignature); |
|---|
| 229 | authenticate_info=(AuthenticateInfo *) |
|---|
| 230 | RelinquishWizardMemory(authenticate_info); |
|---|
| 231 | return(authenticate_info); |
|---|
| 232 | } |
|---|
| 233 | |
|---|
| 234 | |
|---|
| 235 | |
|---|
| 236 | |
|---|
| 237 | |
|---|
| 238 | |
|---|
| 239 | |
|---|
| 240 | |
|---|
| 241 | |
|---|
| 242 | |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | |
|---|
| 246 | |
|---|
| 247 | |
|---|
| 248 | |
|---|
| 249 | |
|---|
| 250 | |
|---|
| 251 | |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | |
|---|
| 255 | |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | |
|---|
| 260 | WizardExport WizardBooleanType GenerateAuthenticateKey( |
|---|
| 261 | AuthenticateInfo *authenticate_info,ExceptionInfo *exception) |
|---|
| 262 | { |
|---|
| 263 | WizardBooleanType |
|---|
| 264 | status; |
|---|
| 265 | |
|---|
| 266 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 267 | WizardAssert(AuthenticateDomain, |
|---|
| 268 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 269 | WizardAssert(AuthenticateDomain, |
|---|
| 270 | authenticate_info->signature == WizardSignature); |
|---|
| 271 | WizardAssert(AuthenticateDomain, |
|---|
| 272 | authenticate_info->handle != (AuthenticateInfo *) NULL); |
|---|
| 273 | WizardAssert(AuthenticateDomain,exception != (ExceptionInfo *) NULL); |
|---|
| 274 | status=WizardFalse; |
|---|
| 275 | switch (authenticate_info->method) |
|---|
| 276 | { |
|---|
| 277 | case SecretAuthenticateMethod: |
|---|
| 278 | { |
|---|
| 279 | SecretInfo |
|---|
| 280 | *secret_info; |
|---|
| 281 | |
|---|
| 282 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 283 | status=GenerateSecretKey(secret_info,exception); |
|---|
| 284 | if (status == WizardFalse) |
|---|
| 285 | break; |
|---|
| 286 | break; |
|---|
| 287 | } |
|---|
| 288 | default: |
|---|
| 289 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 290 | } |
|---|
| 291 | return(status); |
|---|
| 292 | } |
|---|
| 293 | |
|---|
| 294 | |
|---|
| 295 | |
|---|
| 296 | |
|---|
| 297 | |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | |
|---|
| 301 | |
|---|
| 302 | |
|---|
| 303 | |
|---|
| 304 | |
|---|
| 305 | |
|---|
| 306 | |
|---|
| 307 | |
|---|
| 308 | |
|---|
| 309 | |
|---|
| 310 | |
|---|
| 311 | |
|---|
| 312 | |
|---|
| 313 | |
|---|
| 314 | |
|---|
| 315 | |
|---|
| 316 | |
|---|
| 317 | WizardExport const StringInfo *GetAuthenticateId( |
|---|
| 318 | const AuthenticateInfo *authenticate_info) |
|---|
| 319 | { |
|---|
| 320 | const StringInfo |
|---|
| 321 | *id; |
|---|
| 322 | |
|---|
| 323 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 324 | WizardAssert(AuthenticateDomain, |
|---|
| 325 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 326 | WizardAssert(AuthenticateDomain, |
|---|
| 327 | authenticate_info->signature == WizardSignature); |
|---|
| 328 | switch (authenticate_info->method) |
|---|
| 329 | { |
|---|
| 330 | case SecretAuthenticateMethod: |
|---|
| 331 | { |
|---|
| 332 | SecretInfo |
|---|
| 333 | *secret_info; |
|---|
| 334 | |
|---|
| 335 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 336 | id=GetSecretId(secret_info); |
|---|
| 337 | break; |
|---|
| 338 | } |
|---|
| 339 | default: |
|---|
| 340 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 341 | } |
|---|
| 342 | return(id); |
|---|
| 343 | } |
|---|
| 344 | |
|---|
| 345 | |
|---|
| 346 | |
|---|
| 347 | |
|---|
| 348 | |
|---|
| 349 | |
|---|
| 350 | |
|---|
| 351 | |
|---|
| 352 | |
|---|
| 353 | |
|---|
| 354 | |
|---|
| 355 | |
|---|
| 356 | |
|---|
| 357 | |
|---|
| 358 | |
|---|
| 359 | |
|---|
| 360 | |
|---|
| 361 | |
|---|
| 362 | |
|---|
| 363 | |
|---|
| 364 | |
|---|
| 365 | |
|---|
| 366 | |
|---|
| 367 | |
|---|
| 368 | WizardExport const StringInfo *GetAuthenticateKey( |
|---|
| 369 | const AuthenticateInfo *authenticate_info) |
|---|
| 370 | { |
|---|
| 371 | const StringInfo |
|---|
| 372 | *key; |
|---|
| 373 | |
|---|
| 374 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 375 | WizardAssert(AuthenticateDomain, |
|---|
| 376 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 377 | WizardAssert(AuthenticateDomain, |
|---|
| 378 | authenticate_info->signature == WizardSignature); |
|---|
| 379 | switch (authenticate_info->method) |
|---|
| 380 | { |
|---|
| 381 | case SecretAuthenticateMethod: |
|---|
| 382 | { |
|---|
| 383 | SecretInfo |
|---|
| 384 | *secret_info; |
|---|
| 385 | |
|---|
| 386 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 387 | key=GetSecretKey(secret_info); |
|---|
| 388 | break; |
|---|
| 389 | } |
|---|
| 390 | default: |
|---|
| 391 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 392 | } |
|---|
| 393 | return(key); |
|---|
| 394 | } |
|---|
| 395 | |
|---|
| 396 | |
|---|
| 397 | |
|---|
| 398 | |
|---|
| 399 | |
|---|
| 400 | |
|---|
| 401 | |
|---|
| 402 | |
|---|
| 403 | |
|---|
| 404 | |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | |
|---|
| 408 | |
|---|
| 409 | |
|---|
| 410 | |
|---|
| 411 | |
|---|
| 412 | |
|---|
| 413 | |
|---|
| 414 | |
|---|
| 415 | |
|---|
| 416 | |
|---|
| 417 | |
|---|
| 418 | |
|---|
| 419 | WizardExport size_t GetAuthenticateKeyLength( |
|---|
| 420 | const AuthenticateInfo *authenticate_info) |
|---|
| 421 | { |
|---|
| 422 | size_t |
|---|
| 423 | key_length; |
|---|
| 424 | |
|---|
| 425 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 426 | WizardAssert(AuthenticateDomain, |
|---|
| 427 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 428 | WizardAssert(AuthenticateDomain, |
|---|
| 429 | authenticate_info->signature == WizardSignature); |
|---|
| 430 | switch (authenticate_info->method) |
|---|
| 431 | { |
|---|
| 432 | case SecretAuthenticateMethod: |
|---|
| 433 | { |
|---|
| 434 | SecretInfo |
|---|
| 435 | *secret_info; |
|---|
| 436 | |
|---|
| 437 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 438 | key_length=GetSecretKeyLength(secret_info); |
|---|
| 439 | break; |
|---|
| 440 | } |
|---|
| 441 | default: |
|---|
| 442 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 443 | } |
|---|
| 444 | return(key_length); |
|---|
| 445 | } |
|---|
| 446 | |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | |
|---|
| 450 | |
|---|
| 451 | |
|---|
| 452 | |
|---|
| 453 | |
|---|
| 454 | |
|---|
| 455 | |
|---|
| 456 | |
|---|
| 457 | |
|---|
| 458 | |
|---|
| 459 | |
|---|
| 460 | |
|---|
| 461 | |
|---|
| 462 | |
|---|
| 463 | |
|---|
| 464 | |
|---|
| 465 | |
|---|
| 466 | |
|---|
| 467 | |
|---|
| 468 | |
|---|
| 469 | |
|---|
| 470 | WizardExport const char *GetAuthenticatePassphrase( |
|---|
| 471 | const AuthenticateInfo *authenticate_info) |
|---|
| 472 | { |
|---|
| 473 | const char |
|---|
| 474 | *passphrase; |
|---|
| 475 | |
|---|
| 476 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 477 | WizardAssert(AuthenticateDomain, |
|---|
| 478 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 479 | WizardAssert(AuthenticateDomain, |
|---|
| 480 | authenticate_info->signature == WizardSignature); |
|---|
| 481 | switch (authenticate_info->method) |
|---|
| 482 | { |
|---|
| 483 | case SecretAuthenticateMethod: |
|---|
| 484 | { |
|---|
| 485 | SecretInfo |
|---|
| 486 | *secret_info; |
|---|
| 487 | |
|---|
| 488 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 489 | passphrase=GetSecretPassphrase(secret_info); |
|---|
| 490 | break; |
|---|
| 491 | } |
|---|
| 492 | default: |
|---|
| 493 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 494 | } |
|---|
| 495 | return(passphrase); |
|---|
| 496 | } |
|---|
| 497 | |
|---|
| 498 | |
|---|
| 499 | |
|---|
| 500 | |
|---|
| 501 | |
|---|
| 502 | |
|---|
| 503 | |
|---|
| 504 | |
|---|
| 505 | |
|---|
| 506 | |
|---|
| 507 | |
|---|
| 508 | |
|---|
| 509 | |
|---|
| 510 | |
|---|
| 511 | |
|---|
| 512 | |
|---|
| 513 | |
|---|
| 514 | |
|---|
| 515 | |
|---|
| 516 | |
|---|
| 517 | |
|---|
| 518 | |
|---|
| 519 | |
|---|
| 520 | |
|---|
| 521 | |
|---|
| 522 | |
|---|
| 523 | WizardExport void SetAuthenticateId(AuthenticateInfo *authenticate_info, |
|---|
| 524 | const StringInfo *id) |
|---|
| 525 | { |
|---|
| 526 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 527 | WizardAssert(AuthenticateDomain, |
|---|
| 528 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 529 | WizardAssert(AuthenticateDomain, |
|---|
| 530 | authenticate_info->signature == WizardSignature); |
|---|
| 531 | WizardAssert(AuthenticateDomain, |
|---|
| 532 | authenticate_info->handle != (AuthenticateInfo *) NULL); |
|---|
| 533 | switch (authenticate_info->method) |
|---|
| 534 | { |
|---|
| 535 | case SecretAuthenticateMethod: |
|---|
| 536 | { |
|---|
| 537 | SecretInfo |
|---|
| 538 | *secret_info; |
|---|
| 539 | |
|---|
| 540 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 541 | SetSecretId(secret_info,id); |
|---|
| 542 | break; |
|---|
| 543 | } |
|---|
| 544 | default: |
|---|
| 545 | ThrowWizardFatalError(AuthenticateDomain,EnumerateError); |
|---|
| 546 | } |
|---|
| 547 | } |
|---|
| 548 | |
|---|
| 549 | |
|---|
| 550 | |
|---|
| 551 | |
|---|
| 552 | |
|---|
| 553 | |
|---|
| 554 | |
|---|
| 555 | |
|---|
| 556 | |
|---|
| 557 | |
|---|
| 558 | |
|---|
| 559 | |
|---|
| 560 | |
|---|
| 561 | |
|---|
| 562 | |
|---|
| 563 | |
|---|
| 564 | |
|---|
| 565 | |
|---|
| 566 | |
|---|
| 567 | |
|---|
| 568 | |
|---|
| 569 | |
|---|
| 570 | |
|---|
| 571 | |
|---|
| 572 | |
|---|
| 573 | |
|---|
| 574 | WizardExport void SetAuthenticateKeyLength(AuthenticateInfo *authenticate_info, |
|---|
| 575 | const unsigned long key_length) |
|---|
| 576 | { |
|---|
| 577 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 578 | WizardAssert(AuthenticateDomain, |
|---|
| 579 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 580 | WizardAssert(AuthenticateDomain, |
|---|
| 581 | authenticate_info->signature == WizardSignature); |
|---|
| 582 | WizardAssert(AuthenticateDomain, |
|---|
| 583 | authenticate_info->handle != (AuthenticateInfo *) NULL); |
|---|
| 584 | switch (authenticate_info->method) |
|---|
| 585 | { |
|---|
| 586 | case SecretAuthenticateMethod: |
|---|
| 587 | { |
|---|
| 588 | SecretInfo |
|---|
| 589 | *secret_info; |
|---|
| 590 | |
|---|
| 591 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 592 | SetSecretKeyLength(secret_info,key_length); |
|---|
| 593 | break; |
|---|
| 594 | } |
|---|
| 595 | default: |
|---|
| 596 | break; |
|---|
| 597 | } |
|---|
| 598 | } |
|---|
| 599 | |
|---|
| 600 | |
|---|
| 601 | |
|---|
| 602 | |
|---|
| 603 | |
|---|
| 604 | |
|---|
| 605 | |
|---|
| 606 | |
|---|
| 607 | |
|---|
| 608 | |
|---|
| 609 | |
|---|
| 610 | |
|---|
| 611 | |
|---|
| 612 | |
|---|
| 613 | |
|---|
| 614 | |
|---|
| 615 | |
|---|
| 616 | |
|---|
| 617 | |
|---|
| 618 | |
|---|
| 619 | |
|---|
| 620 | |
|---|
| 621 | |
|---|
| 622 | |
|---|
| 623 | |
|---|
| 624 | |
|---|
| 625 | WizardExport void SetAuthenticatePassphrase(AuthenticateInfo *authenticate_info, |
|---|
| 626 | const char *passphrase) |
|---|
| 627 | { |
|---|
| 628 | (void) LogWizardEvent(TraceEvent,GetWizardModule(),"..."); |
|---|
| 629 | WizardAssert(AuthenticateDomain, |
|---|
| 630 | authenticate_info != (AuthenticateInfo *) NULL); |
|---|
| 631 | WizardAssert(AuthenticateDomain, |
|---|
| 632 | authenticate_info->signature == WizardSignature); |
|---|
| 633 | WizardAssert(AuthenticateDomain, |
|---|
| 634 | authenticate_info->handle != (AuthenticateInfo *) NULL); |
|---|
| 635 | switch (authenticate_info->method) |
|---|
| 636 | { |
|---|
| 637 | case SecretAuthenticateMethod: |
|---|
| 638 | { |
|---|
| 639 | SecretInfo |
|---|
| 640 | *secret_info; |
|---|
| 641 | |
|---|
| 642 | secret_info=(SecretInfo *) authenticate_info->handle; |
|---|
| 643 | SetSecretPassphrase(secret_info,passphrase); |
|---|
| 644 | break; |
|---|
| 645 | } |
|---|
| 646 | default: |
|---|
| 647 | break; |
|---|
| 648 | } |
|---|
| 649 | } |
|---|