NB! This project is outdated and unmaintained, please refer to the OpenSC WindowsInstaller instead!
| r21 | r100 | |
|---|---|---|
| 1 | diff -udrNP putty-0.58.orig/Recipe putty-0.58/Recipe | |
| 2 | --- putty-0.58.orig/Recipe 2005-04-05 21:37:51.000000000 +0200 | |
| 3 | +++ putty-0.58/Recipe 2005-06-06 12:14:36.878106032 +0200 | |
| 4 | @@ -205,7 +205,7 @@ | |
| 5 | # SSH back end (putty, plink, pscp, psftp). | |
| 6 | SSH = ssh sshcrc sshdes sshmd5 sshrsa sshrand sshsha sshblowf | |
| 7 | + sshdh sshcrcda sshpubk sshzlib sshdss x11fwd portfwd | |
| 8 | - + sshaes sshsh512 sshbn wildcard pinger | |
| 9 | + + sshaes sshsh512 sshbn wildcard pinger libpkcs11 sshscard local_cmd | |
| 10 | WINSSH = SSH winnoise winpgntc | |
| 11 | UXSSH = SSH uxnoise uxagentc | |
| 12 | MACSSH = SSH macnoise | |
| 13 | @@ -252,7 +252,7 @@ | |
| 14 | ||
| 15 | pageant : [G] winpgnt sshrsa sshpubk sshdes sshbn sshmd5 version tree234 | |
| 16 | + misc sshaes sshsha winpgntc sshdss sshsh512 winutils winmisc | |
| 17 | - + pageant.res LIBS | |
| 18 | + + pageant.res libpkcs11 sshscard LIBS | |
| 19 | ||
| 20 | puttygen : [G] winpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version | |
| 21 | + sshrand winnoise sshsha winstore misc winctrls sshrsa sshdss winmisc | |
| 22 | diff -udrNP putty-0.58.orig/config.c putty-0.58/config.c | |
| 23 | --- putty-0.58.orig/config.c 2005-04-05 21:37:51.000000000 +0200 | |
| 24 | +++ putty-0.58/config.c 2005-06-06 11:50:58.469736880 +0200 | |
| 25 | @@ -1685,6 +1685,21 @@ | |
| 1 | diff -urNp putty-0.58.org/config.c putty-0.58+smartcard/config.c | |
| 2 | --- putty-0.58.org/config.c 2005-04-05 22:37:51.000000000 +0300 | |
| 3 | +++ putty-0.58+smartcard/config.c 2005-06-06 12:50:58.000000000 +0300 | |
| 4 | @@ -1685,6 +1685,21 @@ void setup_config_box(struct controlbox | |
| 26 | 5 | I(offsetof(Config,ssh2_des_cbc))); |
| 27 | 6 | } |
| … | … | |
| 45 | 24 | * The Connection/SSH/Kex panel. (Owing to repeat key |
| 46 | 25 | * exchange, this is all meaningful in mid-session _if_ |
| 47 | @@ -1736,7 +1751,10 @@ |
|
| 26 | @@ -1736,7 +1751,10 @@ void setup_config_box(struct controlbox | |
| 48 | 27 | 'i', HELPCTX(ssh_auth_ki), |
| 49 | 28 | dlg_stdcheckbox_handler, |
| … | … | |
| 57 | 36 | "Authentication parameters"); |
| 58 | 37 | ctrl_checkbox(s, "Allow agent forwarding", 'f', |
| 59 | @@ -1746,10 +1764,21 @@ |
|
| 38 | @@ -1746,10 +1764,21 @@ void setup_config_box(struct controlbox | |
| 60 | 39 | HELPCTX(ssh_auth_changeuser), |
| 61 | 40 | dlg_stdcheckbox_handler, |
| … | … | |
| 80 | 59 | |
| 81 | 60 | if (!midsession) { |
| 82 | diff -u |
|
| 83 | --- putty-0.58.or |
|
| 84 | +++ putty-0.58 |
|
| 61 | diff -urNp putty-0.58.org/libpkcs11.c putty-0.58+smartcard/libpkcs11.c | |
| 62 | --- putty-0.58.org/libpkcs11.c 1970-01-01 02:00:00.000000000 +0200 | |
| 63 | +++ putty-0.58+smartcard/libpkcs11.c 2008-03-15 20:32:06.000000000 +0200 | |
| 85 | 64 | @@ -0,0 +1,268 @@ |
| 86 | 65 | +/* |
| … | … | |
| 91 | 70 | + */ |
| 92 | 71 | + |
| 93 | +#include "p |
|
| 72 | +#include "ppkcs11.h" | |
| 94 | 73 | +#include <stdlib.h> |
| 95 | 74 | +#include <stdio.h> |
| … | … | |
| 352 | 331 | +} |
| 353 | 332 | +#endif |
| 354 | diff -u |
|
| 355 | --- putty-0.58.or |
|
| 356 | +++ putty-0.58 |
|
| 333 | diff -urNp putty-0.58.org/local_cmd.c putty-0.58+smartcard/local_cmd.c | |
| 334 | --- putty-0.58.org/local_cmd.c 1970-01-01 02:00:00.000000000 +0200 | |
| 335 | +++ putty-0.58+smartcard/local_cmd.c 2008-03-15 20:34:20.000000000 +0200 | |
| 357 | 336 | @@ -0,0 +1,69 @@ |
| 358 | 337 | +#include <windows.h> |
| … | … | |
| 361 | 340 | +void do_close(void * ssh); |
| 362 | 341 | + |
| 363 | + |
|
| 342 | +static unsigned long __stdcall WaitToClose(void * params); | |
| 364 | 343 | + |
| 365 | 344 | +struct CloseParam { |
| … | … | |
| 425 | 404 | + |
| 426 | 405 | + |
| 427 | diff -u |
|
| 428 | --- putty-0.58.or |
|
| 429 | +++ putty-0.58 |
|
| 430 | @@ -158,17 +158,18 @@ |
|
| 406 | diff -urNp putty-0.58.org/mac/Makefile.mpw putty-0.58+smartcard/mac/Makefile.mpw | |
| 407 | --- putty-0.58.org/mac/Makefile.mpw 2005-04-05 22:40:17.000000000 +0300 | |
| 408 | +++ putty-0.58+smartcard/mac/Makefile.mpw 2008-03-15 20:57:26.000000000 +0200 | |
| 409 | @@ -158,17 +158,18 @@ all Ä PuTTY PuTTYgen PuTTYtel | |
| 431 | 410 | PuTTY Ä PuTTY.68k PuTTY.ppc PuTTY.carbon |
| 432 | 411 | |
| … | … | |
| 458 | 437 | telnet.68k.o terminal.68k.o testback.68k.o timing.68k.o ¶ |
| 459 | 438 | toucs.68k.o tree234.68k.o utf8.68k.o version.68k.o ¶ |
| 460 | @@ -177,17 +178,18 @@ |
|
| 439 | @@ -177,17 +178,18 @@ PuTTY.68k Ä be_all.68k.o config.68k.o cp | |
| 461 | 440 | Duplicate -y mac_res.rsrc {Targ} |
| 462 | 441 | {Link_68K} -o {Targ} -fragname PuTTY {LinkOptions_68K} be_all.68k.o ¶ |
| … | … | |
| 488 | 467 | terminal.68k.o testback.68k.o timing.68k.o toucs.68k.o ¶ |
| 489 | 468 | tree234.68k.o utf8.68k.o version.68k.o vsnprint.68k.o ¶ |
| 490 | @@ -197,20 +199,21 @@ |
|
| 469 | @@ -197,20 +199,21 @@ PuTTY.68k Ä be_all.68k.o config.68k.o cp | |
| 491 | 470 | |
| 492 | 471 | PuTTY.cfm68k Ä be_all.cfm68k.o config.cfm68k.o cproxy.cfm68k.o ¶ |
| … | … | |
| 524 | 503 | stricmp.cfm68k.o telnet.cfm68k.o terminal.cfm68k.o ¶ |
| 525 | 504 | testback.cfm68k.o timing.cfm68k.o toucs.cfm68k.o ¶ |
| 526 | @@ -221,20 +224,21 @@ |
|
| 505 | @@ -221,20 +224,21 @@ PuTTY.cfm68k Ä be_all.cfm68k.o config.cf | |
| 527 | 506 | {Link_CFM68K} -o {Targ} -fragname PuTTY {LinkOptions_CFM68K} ¶ |
| 528 | 507 | be_all.cfm68k.o config.cfm68k.o cproxy.cfm68k.o ¶ |
| … | … | |
| 560 | 539 | stricmp.cfm68k.o telnet.cfm68k.o terminal.cfm68k.o ¶ |
| 561 | 540 | testback.cfm68k.o timing.cfm68k.o toucs.cfm68k.o ¶ |
| 562 | @@ -244,17 +248,18 @@ |
|
| 541 | @@ -244,17 +248,18 @@ PuTTY.cfm68k Ä be_all.cfm68k.o config.cf | |
| 563 | 542 | SetFile -a BMi {Targ} |
| 564 | 543 | |
| … | … | |
| 590 | 569 | telnet.ppc.o terminal.ppc.o testback.ppc.o timing.ppc.o ¶ |
| 591 | 570 | toucs.ppc.o tree234.ppc.o utf8.ppc.o version.ppc.o ¶ |
| 592 | @@ -263,17 +268,18 @@ |
|
| 571 | @@ -263,17 +268,18 @@ PuTTY.ppc Ä be_all.ppc.o config.ppc.o cp | |
| 593 | 572 | Duplicate -y mac_res.rsrc {Targ} |
| 594 | 573 | {Link_PPC} -o {Targ} -fragname PuTTY {LinkOptions_PPC} be_all.ppc.o ¶ |
| … | … | |
| 620 | 599 | terminal.ppc.o testback.ppc.o timing.ppc.o toucs.ppc.o ¶ |
| 621 | 600 | tree234.ppc.o utf8.ppc.o version.ppc.o vsnprint.ppc.o ¶ |
| 622 | @@ -283,20 +289,21 @@ |
|
| 601 | @@ -283,20 +289,21 @@ PuTTY.ppc Ä be_all.ppc.o config.ppc.o cp | |
| 623 | 602 | |
| 624 | 603 | PuTTY.carbon Ä be_all.carbon.o config.carbon.o cproxy.carbon.o ¶ |
| … | … | |
| 656 | 635 | stricmp.carbon.o telnet.carbon.o terminal.carbon.o ¶ |
| 657 | 636 | testback.carbon.o timing.carbon.o toucs.carbon.o ¶ |
| 658 | @@ -307,20 +314,21 @@ |
|
| 637 | @@ -307,20 +314,21 @@ PuTTY.carbon Ä be_all.carbon.o config.ca | |
| 659 | 638 | {Link_Carbon} -o {Targ} -fragname PuTTY {LinkOptions_Carbon} ¶ |
| 660 | 639 | be_all.carbon.o config.carbon.o cproxy.carbon.o ¶ |
| … | … | |
| 692 | 671 | stricmp.carbon.o telnet.carbon.o terminal.carbon.o ¶ |
| 693 | 672 | testback.carbon.o timing.carbon.o toucs.carbon.o ¶ |
| 694 | @@ -657,6 +665,1 |
|
| 673 | @@ -657,6 +665,12 @@ ldiscucs.68k.o Ä ::ldiscucs.c ::putty.h | |
| 695 | 674 | ::windows:winhelp.h ::charset:charset.h |
| 696 | 675 | {C_68K} ::ldiscucs.c -o {Targ} {COptions_68K} |
| 697 | 676 | |
| 698 | +libpkcs11.68k.o Ä ::libpkcs11.c ::pkcs11.h ::rsaref:win32.h ¶ | |
| 699 | + ::rsaref:pkcs11.h ::rsaref:unix.h ::rsaref:pkcs11t.h ¶ | |
| 700 | + ::rsaref:pkcs11f.h | |
| 677 | +libpkcs11.68k.o Ä ::libpkcs11.c ::pkcs11.h ::ppkcs11.h | |
| 701 | 678 | + {C_68K} ::libpkcs11.c -o {Targ} {COptions_68K} |
| 702 | 679 | + |
| … | … | |
| 707 | 684 | ::charset:internal.h |
| 708 | 685 | {C_68K} ::charset:localenc.c -o {Targ} {COptions_68K} |
| 709 | @@ -902, |
|
| 686 | @@ -902,8 +916,9 @@ slookup.68k.o Ä ::charset:slookup.c ::ch | |
| 710 | 687 | ::charset:enum.c ::charset:sbcsdat.c ::charset:utf8.c |
| 711 | 688 | {C_68K} ::charset:slookup.c -o {Targ} {COptions_68K} |
| … | … | |
| 713 | 690 | -ssh.68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::puttyps.h ::network.h ¶ |
| 714 | 691 | - ::misc.h ::puttymem.h ::int64.h ::windows:winstuff.h ¶ |
| 715 | +ssh.68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h :: |
|
| 692 | +ssh.68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 716 | 693 | + ::puttyps.h ::network.h ::misc.h ::puttymem.h ::int64.h ¶ |
| 717 | + :: |
|
| 694 | + ::windows:winstuff.h ¶ | |
| 718 | 695 | ::mac:macstuff.h ::macosx:osx.h ::unix:unix.h ¶ |
| 719 | ||
| 720 | 696 | ::windows:winhelp.h ::charset:charset.h |
| 721 | 697 | {C_68K} ::ssh.c -o {Targ} {COptions_68K} |
| 722 | ||
| 723 | @@ -970,6 +988,15 @@ | |
| 698 | @@ -970,6 +985,14 @@ sshrsag.68k.o Ä ::sshrsag.c ::ssh.h ::pu | |
| 724 | 699 | ::misc.h |
| 725 | 700 | {C_68K} ::sshrsag.c -o {Targ} {COptions_68K} |
| 726 | 701 | |
| 727 | +sshscard.68k.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h :: |
|
| 702 | +sshscard.68k.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 728 | 703 | + ::putty.h ::puttymem.h ::network.h ::int64.h ::misc.h ¶ |
| 729 | + ::rsaref:win32.h ::rsaref:pkcs11.h ::puttyps.h ¶ | |
| 730 | + ::rsaref:unix.h ::rsaref:pkcs11t.h ::rsaref:pkcs11f.h ¶ | |
| 704 | + ::puttyps.h ¶ | |
| 731 | 705 | + ::windows:winstuff.h ::mac:macstuff.h ::macosx:osx.h ¶ |
| 732 | 706 | + ::unix:unix.h ::tree234.h ::windows:winhelp.h ¶ |
| … | … | |
| 737 | 711 | ::misc.h |
| 738 | 712 | {C_68K} ::sshsh512.c -o {Targ} {COptions_68K} |
| 739 | @@ -1224,7 +12 |
|
| 713 | @@ -1224,7 +1247,7 @@ winpgen.68k.o Ä ::windows:winpgen.c ::pu | |
| 740 | 714 | {C_68K} ::windows:winpgen.c -o {Targ} {COptions_68K} |
| 741 | 715 | |
| … | … | |
| 746 | 720 | ::unix:unix.h ::windows:winhelp.h ::charset:charset.h |
| 747 | 721 | {C_68K} ::windows:winpgnt.c -o {Targ} {COptions_68K} |
| 748 | @@ -1389,6 +141 |
|
| 722 | @@ -1389,6 +1412,12 @@ ldiscucs.cfm68k.o Ä ::ldiscucs.c ::putty | |
| 749 | 723 | ::charset:charset.h |
| 750 | 724 | {C_CFM68K} ::ldiscucs.c -o {Targ} {COptions_CFM68K} |
| 751 | 725 | |
| 752 | +libpkcs11.cfm68k.o Ä ::libpkcs11.c ::pkcs11.h ::rsaref:win32.h ¶ | |
| 753 | + ::rsaref:pkcs11.h ::rsaref:unix.h ::rsaref:pkcs11t.h ¶ | |
| 754 | + ::rsaref:pkcs11f.h | |
| 726 | +libpkcs11.cfm68k.o Ä ::libpkcs11.c ::pkcs11.h ::ppkcs11.h | |
| 755 | 727 | + {C_CFM68K} ::libpkcs11.c -o {Targ} {COptions_CFM68K} |
| 756 | 728 | + |
| … | … | |
| 761 | 733 | ::charset:internal.h |
| 762 | 734 | {C_CFM68K} ::charset:localenc.c -o {Targ} {COptions_CFM68K} |
| 763 | @@ -1639, |
|
| 735 | @@ -1639,8 +1668,9 @@ slookup.cfm68k.o Ä ::charset:slookup.c : | |
| 764 | 736 | ::charset:utf8.c |
| 765 | 737 | {C_CFM68K} ::charset:slookup.c -o {Targ} {COptions_CFM68K} |
| … | … | |
| 767 | 739 | -ssh.cfm68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::puttyps.h ::network.h ¶ |
| 768 | 740 | - ::misc.h ::puttymem.h ::int64.h ::windows:winstuff.h ¶ |
| 769 | +ssh.cfm68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h :: |
|
| 741 | +ssh.cfm68k.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 770 | 742 | + ::puttyps.h ::network.h ::misc.h ::puttymem.h ::int64.h ¶ |
| 771 | + :: |
|
| 743 | + ::windows:winstuff.h ¶ | |
| 772 | 744 | ::mac:macstuff.h ::macosx:osx.h ::unix:unix.h ¶ |
| 773 | ||
| 774 | 745 | ::windows:winhelp.h ::charset:charset.h |
| 775 | 746 | {C_CFM68K} ::ssh.c -o {Targ} {COptions_CFM68K} |
| 776 | ||
| 777 | @@ -1709,6 +1746,15 @@ | |
| 747 | @@ -1709,6 +1739,14 @@ sshrsag.cfm68k.o Ä ::sshrsag.c ::ssh.h : | |
| 778 | 748 | ::misc.h |
| 779 | 749 | {C_CFM68K} ::sshrsag.c -o {Targ} {COptions_CFM68K} |
| 780 | 750 | |
| 781 | +sshscard.cfm68k.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h :: |
|
| 751 | +sshscard.cfm68k.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 782 | 752 | + ::putty.h ::puttymem.h ::network.h ::int64.h ::misc.h ¶ |
| 783 | + ::rsaref:win32.h ::rsaref:pkcs11.h ::puttyps.h ¶ | |
| 784 | + ::rsaref:unix.h ::rsaref:pkcs11t.h ::rsaref:pkcs11f.h ¶ | |
| 753 | + ::puttyps.h ¶ | |
| 785 | 754 | + ::windows:winstuff.h ::mac:macstuff.h ::macosx:osx.h ¶ |
| 786 | 755 | + ::unix:unix.h ::tree234.h ::windows:winhelp.h ¶ |
| … | … | |
| 791 | 760 | ::misc.h |
| 792 | 761 | {C_CFM68K} ::sshsh512.c -o {Targ} {COptions_CFM68K} |
| 793 | @@ -1963,9 +200 |
|
| 762 | @@ -1963,9 +2001,10 @@ winpgen.cfm68k.o Ä ::windows:winpgen.c : | |
| 794 | 763 | {C_CFM68K} ::windows:winpgen.c -o {Targ} {COptions_CFM68K} |
| 795 | 764 | |
| … | … | |
| 805 | 774 | |
| 806 | 775 | winpgntc.cfm68k.o Ä ::windows:winpgntc.c ::putty.h ::puttyps.h ::network.h ¶ |
| 807 | @@ -2162,6 +220 |
|
| 776 | @@ -2162,6 +2201,16 @@ ldiscucs.ppc.o Ä ::ldiscucs.c ::putty.h | |
| 808 | 777 | setfile -t XCOF {Targ} |
| 809 | 778 | {C_PPC} ::ldiscucs.c -o {Targ} {COptions_PPC} |
| 810 | 779 | |
| 811 | +libpkcs11.ppc.o Ä ::libpkcs11.c ::pkcs11.h ::rsaref:win32.h ¶ | |
| 812 | + ::rsaref:pkcs11.h ::rsaref:unix.h ::rsaref:pkcs11t.h ¶ | |
| 813 | + ::rsaref:pkcs11f.h | |
| 780 | +libpkcs11.ppc.o Ä ::libpkcs11.c ::pkcs11.h ::ppkcs11.h | |
| 814 | 781 | + echo -n > {Targ} |
| 815 | 782 | + setfile -t XCOF {Targ} |
| … | … | |
| 824 | 791 | ::charset:internal.h |
| 825 | 792 | echo -n > {Targ} |
| 826 | @@ -2491, |
|
| 793 | @@ -2491,8 +2540,9 @@ slookup.ppc.o Ä ::charset:slookup.c ::ch | |
| 827 | 794 | setfile -t XCOF {Targ} |
| 828 | 795 | {C_PPC} ::charset:slookup.c -o {Targ} {COptions_PPC} |
| … | … | |
| 830 | 797 | -ssh.ppc.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::puttyps.h ::network.h ¶ |
| 831 | 798 | - ::misc.h ::puttymem.h ::int64.h ::windows:winstuff.h ¶ |
| 832 | +ssh.ppc.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h :: |
|
| 799 | +ssh.ppc.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 833 | 800 | + ::puttyps.h ::network.h ::misc.h ::puttymem.h ::int64.h ¶ |
| 834 | + :: |
|
| 801 | + ::windows:winstuff.h ¶ | |
| 835 | 802 | ::mac:macstuff.h ::macosx:osx.h ::unix:unix.h ¶ |
| 836 | ||
| 837 | 803 | ::windows:winhelp.h ::charset:charset.h |
| 838 | 804 | echo -n > {Targ} |
| 839 | setfile -t XCOF {Targ} | |
| 840 | @@ -2591,6 +2652,17 @@ | |
| 805 | @@ -2591,6 +2641,16 @@ sshrsag.ppc.o Ä ::sshrsag.c ::ssh.h ::pu | |
| 841 | 806 | setfile -t XCOF {Targ} |
| 842 | 807 | {C_PPC} ::sshrsag.c -o {Targ} {COptions_PPC} |
| 843 | 808 | |
| 844 | +sshscard.ppc.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h :: |
|
| 809 | +sshscard.ppc.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 845 | 810 | + ::putty.h ::puttymem.h ::network.h ::int64.h ::misc.h ¶ |
| 846 | + ::rsaref:win32.h ::rsaref:pkcs11.h ::puttyps.h ¶ | |
| 847 | + ::rsaref:unix.h ::rsaref:pkcs11t.h ::rsaref:pkcs11f.h ¶ | |
| 811 | + ::puttyps.h ¶ | |
| 848 | 812 | + ::windows:winstuff.h ::mac:macstuff.h ::macosx:osx.h ¶ |
| 849 | 813 | + ::unix:unix.h ::tree234.h ::windows:winhelp.h ¶ |
| … | … | |
| 856 | 820 | ::misc.h |
| 857 | 821 | echo -n > {Targ} |
| 858 | @@ -2935,7 + |
|
| 822 | @@ -2935,7 +2995,7 @@ winpgen.ppc.o Ä ::windows:winpgen.c ::pu | |
| 859 | 823 | {C_PPC} ::windows:winpgen.c -o {Targ} {COptions_PPC} |
| 860 | 824 | |
| … | … | |
| 865 | 829 | ::unix:unix.h ::windows:winhelp.h ::charset:charset.h |
| 866 | 830 | echo -n > {Targ} |
| 867 | @@ -3160,6 +32 |
|
| 831 | @@ -3160,6 +3220,16 @@ ldiscucs.carbon.o Ä ::ldiscucs.c ::putty | |
| 868 | 832 | setfile -t XCOF {Targ} |
| 869 | 833 | {C_Carbon} ::ldiscucs.c -o {Targ} {COptions_Carbon} |
| 870 | 834 | |
| 871 | +libpkcs11.carbon.o Ä ::libpkcs11.c ::pkcs11.h ::rsaref:win32.h ¶ | |
| 872 | + ::rsaref:pkcs11.h ::rsaref:unix.h ::rsaref:pkcs11t.h ¶ | |
| 873 | + ::rsaref:pkcs11f.h | |
| 835 | +libpkcs11.carbon.o Ä ::libpkcs11.c ::pkcs11.h ::ppkcs11.h | |
| 874 | 836 | + echo -n > {Targ} |
| 875 | 837 | + setfile -t XCOF {Targ} |
| … | … | |
| 884 | 846 | ::charset:internal.h |
| 885 | 847 | echo -n > {Targ} |
| 886 | @@ -3494, |
|
| 848 | @@ -3494,8 +3564,9 @@ slookup.carbon.o Ä ::charset:slookup.c : | |
| 887 | 849 | setfile -t XCOF {Targ} |
| 888 | 850 | {C_Carbon} ::charset:slookup.c -o {Targ} {COptions_Carbon} |
| … | … | |
| 890 | 852 | -ssh.carbon.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::puttyps.h ::network.h ¶ |
| 891 | 853 | - ::misc.h ::puttymem.h ::int64.h ::windows:winstuff.h ¶ |
| 892 | +ssh.carbon.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h :: |
|
| 854 | +ssh.carbon.o Ä ::ssh.c ::putty.h ::tree234.h ::ssh.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 893 | 855 | + ::puttyps.h ::network.h ::misc.h ::puttymem.h ::int64.h ¶ |
| 894 | + :: |
|
| 856 | + ::windows:winstuff.h ¶ | |
| 895 | 857 | ::mac:macstuff.h ::macosx:osx.h ::unix:unix.h ¶ |
| 896 | ||
| 897 | 858 | ::windows:winhelp.h ::charset:charset.h |
| 898 | 859 | echo -n > {Targ} |
| 899 | setfile -t XCOF {Targ} | |
| 900 | @@ -3596,6 +3682,17 @@ | |
| 860 | @@ -3596,6 +3667,16 @@ sshrsag.carbon.o Ä ::sshrsag.c ::ssh.h : | |
| 901 | 861 | setfile -t XCOF {Targ} |
| 902 | 862 | {C_Carbon} ::sshrsag.c -o {Targ} {COptions_Carbon} |
| 903 | 863 | |
| 904 | +sshscard.carbon.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h :: |
|
| 864 | +sshscard.carbon.o Ä ::sshscard.c ::ssh.h ::sshrsa.h ::pkcs11.h ::ppkcs11.h ::sshscard.h ¶ | |
| 905 | 865 | + ::putty.h ::puttymem.h ::network.h ::int64.h ::misc.h ¶ |
| 906 | + ::rsaref:win32.h ::rsaref:pkcs11.h ::puttyps.h ¶ | |
| 907 | + ::rsaref:unix.h ::rsaref:pkcs11t.h ::rsaref:pkcs11f.h ¶ | |
| 866 | + ::puttyps.h ¶ | |
| 908 | 867 | + ::windows:winstuff.h ::mac:macstuff.h ::macosx:osx.h ¶ |
| 909 | 868 | + ::unix:unix.h ::tree234.h ::windows:winhelp.h ¶ |
| … | … | |
| 916 | 875 | ::misc.h |
| 917 | 876 | echo -n > {Targ} |
| 918 | @@ -3940,9 +40 |
|
| 877 | @@ -3940,9 +4021,10 @@ winpgen.carbon.o Ä ::windows:winpgen.c : | |
| 919 | 878 | {C_Carbon} ::windows:winpgen.c -o {Targ} {COptions_Carbon} |
| 920 | 879 | |
| … | … | |
| 930 | 889 | setfile -t XCOF {Targ} |
| 931 | 890 | {C_Carbon} ::windows:winpgnt.c -o {Targ} {COptions_Carbon} |
| 932 | diff -u |
|
| 933 | --- putty-0.58.or |
|
| 934 | +++ putty-0.58 |
|
| 935 | @@ -104,78 +104,83 @@ |
|
| 891 | diff -urNp putty-0.58.org/macosx/Makefile putty-0.58+smartcard/macosx/Makefile | |
| 892 | --- putty-0.58.org/macosx/Makefile 2005-04-05 22:40:17.000000000 +0300 | |
| 893 | +++ putty-0.58+smartcard/macosx/Makefile 2008-03-15 20:58:32.000000000 +0200 | |
| 894 | @@ -104,78 +104,83 @@ PuTTY: PuTTY.app/Contents/MacOS/PuTTY \ | |
| 936 | 895 | PuTTY.app/Contents/Info.plist $(PuTTY_extra) |
| 937 | 896 | |
| … | … | |
| 1073 | 1032 | puttygen: cmdgen.o import.o misc.o notiming.o sshaes.o sshbn.o sshdes.o \ |
| 1074 | 1033 | sshdss.o sshdssg.o sshmd5.o sshprime.o sshpubk.o sshrand.o \ |
| 1075 | @@ -269,6 +274,1 |
|
| 1034 | @@ -269,6 +274,10 @@ ldiscucs.o: ../ldiscucs.c ../putty.h ../ | |
| 1076 | 1035 | ../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \ |
| 1077 | 1036 | ../puttymem.h ../windows/winhelp.h ../charset/charset.h |
| 1078 | 1037 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1079 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../rsaref/win32.h ../rsaref/pkcs11.h \ | |
| 1080 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h | |
| 1038 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../ppkcs11.h | |
| 1081 | 1039 | + $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1082 | 1040 | +local_cmd.o: ../local_cmd.c |
| … | … | |
| 1085 | 1043 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1086 | 1044 | logging.o: ../logging.c ../putty.h ../puttyps.h ../network.h ../misc.h \ |
| 1087 | @@ -476, |
|
| 1045 | @@ -476,8 +485,9 @@ sizetip.o: ../windows/sizetip.c ../putty | |
| 1088 | 1046 | slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \ |
| 1089 | 1047 | ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c |
| … | … | |
| 1091 | 1049 | -ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../puttyps.h ../network.h \ |
| 1092 | 1050 | - ../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \ |
| 1093 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ |
|
| 1051 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 1094 | 1052 | + ../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \ |
| 1095 | + ../ |
|
| 1053 | + ../windows/winstuff.h \ | |
| 1096 | 1054 | ../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \ |
| 1097 | ||
| 1098 | 1055 | ../windows/winhelp.h ../charset/charset.h |
| 1099 | 1056 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1100 | sshaes.o: ../sshaes.c ../ssh.h ../puttymem.h ../network.h ../int64.h \ | |
| 1101 | @@ -528,6 +540,14 @@ | |
| 1057 | @@ -528,6 +538,13 @@ sshrsa.o: ../sshrsa.c ../ssh.h ../misc.h | |
| 1102 | 1058 | sshrsag.o: ../sshrsag.c ../ssh.h ../puttymem.h ../network.h ../int64.h \ |
| 1103 | 1059 | ../misc.h |
| 1104 | 1060 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1105 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ |
|
| 1061 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 1106 | 1062 | + ../putty.h ../puttymem.h ../network.h ../int64.h ../misc.h \ |
| 1107 | + ../rsaref/win32.h ../rsaref/pkcs11.h ../puttyps.h \ | |
| 1108 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h \ | |
| 1063 | + ../puttyps.h \ | |
| 1109 | 1064 | + ../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \ |
| 1110 | 1065 | + ../unix/unix.h ../tree234.h ../windows/winhelp.h \ |
| … | … | |
| 1114 | 1069 | ../misc.h |
| 1115 | 1070 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| 1116 | @@ -741,9 +7 |
|
| 1071 | @@ -741,9 +758,10 @@ winpgen.o: ../windows/winpgen.c ../putty | |
| 1117 | 1072 | ../charset/charset.h |
| 1118 | 1073 | $(CC) $(COMPAT) $(FWHACK) $(XFLAGS) $(CFLAGS) -c $< |
| … | … | |
| 1128 | 1083 | winpgntc.o: ../windows/winpgntc.c ../putty.h ../puttyps.h ../network.h \ |
| 1129 | 1084 | ../misc.h ../windows/winstuff.h ../mac/macstuff.h \ |
| 1130 | diff -udrNP putty-0.58.orig/pkcs11.h putty-0.58/pkcs11.h | |
| 1131 | --- putty-0.58.orig/pkcs11.h 1970-01-01 01:00:00.000000000 +0100 | |
| 1132 | +++ putty-0.58/pkcs11.h 2005-06-06 11:50:58.478735512 +0200 | |
| 1133 | @@ -0,0 +1,48 @@ | |
| 1134 | +/* | |
| 1135 | + * pkcs11.h: OpenSC project's PKCS#11 library header | |
| 1136 | + * | |
| 1137 | + * Copyright (C) 2002 Timo Teräs <timo.teras@iki.fi> | |
| 1138 | + * | |
| 1139 | + * This library is free software; you can redistribute it and/or | |
| 1140 | + * modify it under the terms of the GNU Lesser General Public | |
| 1141 | + * License as published by the Free Software Foundation; either | |
| 1142 | + * version 2.1 of the License, or (at your option) any later version. | |
| 1143 | + * | |
| 1144 | + * This library is distributed in the hope that it will be useful, | |
| 1145 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 1146 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 1147 | + * Lesser General Public License for more details. | |
| 1148 | + * | |
| 1149 | + * You should have received a copy of the GNU Lesser General Public | |
| 1150 | + * License along with this library; if not, write to the Free Software | |
| 1151 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 1152 | + */ | |
| 1153 | + | |
| 1154 | +#ifndef OPENSC_PKCS11_H | |
| 1155 | +#define OPENSC_PKCS11_H | |
| 1156 | + | |
| 1157 | +#ifndef _WINDOWS | |
| 1158 | +#include <rsaref/unix.h> | |
| 1159 | +#include <rsaref/pkcs11.h> | |
| 1085 | diff -urNp putty-0.58.org/pkcs11.h putty-0.58+smartcard/pkcs11.h | |
| 1086 | --- putty-0.58.org/pkcs11.h 1970-01-01 02:00:00.000000000 +0200 | |
| 1087 | +++ putty-0.58+smartcard/pkcs11.h 2008-03-15 20:26:37.000000000 +0200 | |
| 1088 | @@ -0,0 +1,1357 @@ | |
| 1089 | +/* pkcs11.h | |
| 1090 | + Copyright 2006, 2007 g10 Code GmbH | |
| 1091 | + Copyright 2006 Andreas Jellinghaus | |
| 1092 | + | |
| 1093 | + This file is free software; as a special exception the author gives | |
| 1094 | + unlimited permission to copy and/or distribute it, with or without | |
| 1095 | + modifications, as long as this notice is preserved. | |
| 1096 | + | |
| 1097 | + This file is distributed in the hope that it will be useful, but | |
| 1098 | + WITHOUT ANY WARRANTY, to the extent permitted by law; without even | |
| 1099 | + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
| 1100 | + PURPOSE. */ | |
| 1101 | + | |
| 1102 | +/* Please submit changes back to the Scute project at | |
| 1103 | + http://www.scute.org/ (or send them to marcus@g10code.com), so that | |
| 1104 | + they can be picked up by other projects from there as well. */ | |
| 1105 | + | |
| 1106 | +/* This file is a modified implementation of the PKCS #11 standard by | |
| 1107 | + RSA Security Inc. It is mostly a drop-in replacement, with the | |
| 1108 | + following change: | |
| 1109 | + | |
| 1110 | + This header file does not require any macro definitions by the user | |
| 1111 | + (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros | |
| 1112 | + for you (if useful, some are missing, let me know if you need | |
| 1113 | + more). | |
| 1114 | + | |
| 1115 | + There is an additional API available that does comply better to the | |
| 1116 | + GNU coding standard. It can be switched on by defining | |
| 1117 | + CRYPTOKI_GNU before including this header file. For this, the | |
| 1118 | + following changes are made to the specification: | |
| 1119 | + | |
| 1120 | + All structure types are changed to a "struct ck_foo" where CK_FOO | |
| 1121 | + is the type name in PKCS #11. | |
| 1122 | + | |
| 1123 | + All non-structure types are changed to ck_foo_t where CK_FOO is the | |
| 1124 | + lowercase version of the type name in PKCS #11. The basic types | |
| 1125 | + (CK_ULONG et al.) are removed without substitute. | |
| 1126 | + | |
| 1127 | + All members of structures are modified in the following way: Type | |
| 1128 | + indication prefixes are removed, and underscore characters are | |
| 1129 | + inserted before words. Then the result is lowercased. | |
| 1130 | + | |
| 1131 | + Note that function names are still in the original case, as they | |
| 1132 | + need for ABI compatibility. | |
| 1133 | + | |
| 1134 | + CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use | |
| 1135 | + <stdbool.h>. | |
| 1136 | + | |
| 1137 | + If CRYPTOKI_COMPAT is defined before including this header file, | |
| 1138 | + then none of the API changes above take place, and the API is the | |
| 1139 | + one defined by the PKCS #11 standard. */ | |
| 1140 | + | |
| 1141 | +#ifndef PKCS11_H | |
| 1142 | +#define PKCS11_H 1 | |
| 1143 | + | |
| 1144 | +#if defined(__cplusplus) | |
| 1145 | +extern "C" { | |
| 1146 | +#endif | |
| 1147 | + | |
| 1148 | + | |
| 1149 | +/* The version of cryptoki we implement. The revision is changed with | |
| 1150 | + each modification of this file. If you do not use the "official" | |
| 1151 | + version of this file, please consider deleting the revision macro | |
| 1152 | + (you may use a macro with a different name to keep track of your | |
| 1153 | + versions). */ | |
| 1154 | +#define CRYPTOKI_VERSION_MAJOR 2 | |
| 1155 | +#define CRYPTOKI_VERSION_MINOR 20 | |
| 1156 | +#define CRYPTOKI_VERSION_REVISION 6 | |
| 1157 | + | |
| 1158 | + | |
| 1159 | +/* Compatibility interface is default, unless CRYPTOKI_GNU is | |
| 1160 | + given. */ | |
| 1161 | +#ifndef CRYPTOKI_GNU | |
| 1162 | +#ifndef CRYPTOKI_COMPAT | |
| 1163 | +#define CRYPTOKI_COMPAT 1 | |
| 1164 | +#endif | |
| 1165 | +#endif | |
| 1166 | + | |
| 1167 | +/* System dependencies. */ | |
| 1168 | + | |
| 1169 | +#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) | |
| 1170 | + | |
| 1171 | +/* There is a matching pop below. */ | |
| 1172 | +#pragma pack(push, cryptoki, 1) | |
| 1173 | + | |
| 1174 | +#ifdef CRYPTOKI_EXPORTS | |
| 1175 | +#define CK_SPEC __declspec(dllexport) | |
| 1160 | 1176 | +#else |
| 1161 | +#include "rsaref/win32.h" | |
| 1162 | +#pragma pack(push, cryptoki, 1) | |
| 1163 | +#include "rsaref/pkcs11.h" | |
| 1177 | +#define CK_SPEC __declspec(dllimport) | |
| 1178 | +#endif | |
| 1179 | + | |
| 1180 | +#else | |
| 1181 | + | |
| 1182 | +#define CK_SPEC | |
| 1183 | + | |
| 1184 | +#endif | |
| 1185 | + | |
| 1186 | + | |
| 1187 | +#ifdef CRYPTOKI_COMPAT | |
| 1188 | + /* If we are in compatibility mode, switch all exposed names to the | |
| 1189 | + PKCS #11 variant. There are corresponding #undefs below. */ | |
| 1190 | + | |
| 1191 | +#define ck_flags_t CK_FLAGS | |
| 1192 | +#define ck_version _CK_VERSION | |
| 1193 | + | |
| 1194 | +#define ck_info _CK_INFO | |
| 1195 | +#define cryptoki_version cryptokiVersion | |
| 1196 | +#define manufacturer_id manufacturerID | |
| 1197 | +#define library_description libraryDescription | |
| 1198 | +#define library_version libraryVersion | |
| 1199 | + | |
| 1200 | +#define ck_notification_t CK_NOTIFICATION | |
| 1201 | +#define ck_slot_id_t CK_SLOT_ID | |
| 1202 | + | |
| 1203 | +#define ck_slot_info _CK_SLOT_INFO | |
| 1204 | +#define slot_description slotDescription | |
| 1205 | +#define hardware_version hardwareVersion | |
| 1206 | +#define firmware_version firmwareVersion | |
| 1207 | + | |
| 1208 | +#define ck_token_info _CK_TOKEN_INFO | |
| 1209 | +#define serial_number serialNumber | |
| 1210 | +#define max_session_count ulMaxSessionCount | |
| 1211 | +#define session_count ulSessionCount | |
| 1212 | +#define max_rw_session_count ulMaxRwSessionCount | |
| 1213 | +#define rw_session_count ulRwSessionCount | |
| 1214 | +#define max_pin_len ulMaxPinLen | |
| 1215 | +#define min_pin_len ulMinPinLen | |
| 1216 | +#define total_public_memory ulTotalPublicMemory | |
| 1217 | +#define free_public_memory ulFreePublicMemory | |
| 1218 | +#define total_private_memory ulTotalPrivateMemory | |
| 1219 | +#define free_private_memory ulFreePrivateMemory | |
| 1220 | +#define utc_time utcTime | |
| 1221 | + | |
| 1222 | +#define ck_session_handle_t CK_SESSION_HANDLE | |
| 1223 | +#define ck_user_type_t CK_USER_TYPE | |
| 1224 | +#define ck_state_t CK_STATE | |
| 1225 | + | |
| 1226 | +#define ck_session_info _CK_SESSION_INFO | |
| 1227 | +#define slot_id slotID | |
| 1228 | +#define device_error ulDeviceError | |
| 1229 | + | |
| 1230 | +#define ck_object_handle_t CK_OBJECT_HANDLE | |
| 1231 | +#define ck_object_class_t CK_OBJECT_CLASS | |
| 1232 | +#define ck_hw_feature_type_t CK_HW_FEATURE_TYPE | |
| 1233 | +#define ck_key_type_t CK_KEY_TYPE | |
| 1234 | +#define ck_certificate_type_t CK_CERTIFICATE_TYPE | |
| 1235 | +#define ck_attribute_type_t CK_ATTRIBUTE_TYPE | |
| 1236 | + | |
| 1237 | +#define ck_attribute _CK_ATTRIBUTE | |
| 1238 | +#define value pValue | |
| 1239 | +#define value_len ulValueLen | |
| 1240 | + | |
| 1241 | +#define ck_date _CK_DATE | |
| 1242 | + | |
| 1243 | +#define ck_mechanism_type_t CK_MECHANISM_TYPE | |
| 1244 | + | |
| 1245 | +#define ck_mechanism _CK_MECHANISM | |
| 1246 | +#define parameter pParameter | |
| 1247 | +#define parameter_len ulParameterLen | |
| 1248 | + | |
| 1249 | +#define ck_mechanism_info _CK_MECHANISM_INFO | |
| 1250 | +#define min_key_size ulMinKeySize | |
| 1251 | +#define max_key_size ulMaxKeySize | |
| 1252 | + | |
| 1253 | +#define ck_rv_t CK_RV | |
| 1254 | +#define ck_notify_t CK_NOTIFY | |
| 1255 | + | |
| 1256 | +#define ck_function_list _CK_FUNCTION_LIST | |
| 1257 | + | |
| 1258 | +#define ck_createmutex_t CK_CREATEMUTEX | |
| 1259 | +#define ck_destroymutex_t CK_DESTROYMUTEX | |
| 1260 | +#define ck_lockmutex_t CK_LOCKMUTEX | |
| 1261 | +#define ck_unlockmutex_t CK_UNLOCKMUTEX | |
| 1262 | + | |
| 1263 | +#define ck_c_initialize_args _CK_C_INITIALIZE_ARGS | |
| 1264 | +#define create_mutex CreateMutex | |
| 1265 | +#define destroy_mutex DestroyMutex | |
| 1266 | +#define lock_mutex LockMutex | |
| 1267 | +#define unlock_mutex UnlockMutex | |
| 1268 | +#define reserved pReserved | |
| 1269 | + | |
| 1270 | +#endif /* CRYPTOKI_COMPAT */ | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | +typedef unsigned long ck_flags_t; | |
| 1275 | + | |
| 1276 | +struct ck_version | |
| 1277 | +{ | |
| 1278 | + unsigned char major; | |
| 1279 | + unsigned char minor; | |
| 1280 | +}; | |
| 1281 | + | |
| 1282 | + | |
| 1283 | +struct ck_info | |
| 1284 | +{ | |
| 1285 | + struct ck_version cryptoki_version; | |
| 1286 | + unsigned char manufacturer_id[32]; | |
| 1287 | + ck_flags_t flags; | |
| 1288 | + unsigned char library_description[32]; | |
| 1289 | + struct ck_version library_version; | |
| 1290 | +}; | |
| 1291 | + | |
| 1292 | + | |
| 1293 | +typedef unsigned long ck_notification_t; | |
| 1294 | + | |
| 1295 | +#define CKN_SURRENDER (0) | |
| 1296 | + | |
| 1297 | + | |
| 1298 | +typedef unsigned long ck_slot_id_t; | |
| 1299 | + | |
| 1300 | + | |
| 1301 | +struct ck_slot_info | |
| 1302 | +{ | |
| 1303 | + unsigned char slot_description[64]; | |
| 1304 | + unsigned char manufacturer_id[32]; | |
| 1305 | + ck_flags_t flags; | |
| 1306 | + struct ck_version hardware_version; | |
| 1307 | + struct ck_version firmware_version; | |
| 1308 | +}; | |
| 1309 | + | |
| 1310 | + | |
| 1311 | +#define CKF_TOKEN_PRESENT (1 << 0) | |
| 1312 | +#define CKF_REMOVABLE_DEVICE (1 << 1) | |
| 1313 | +#define CKF_HW_SLOT (1 << 2) | |
| 1314 | +#define CKF_ARRAY_ATTRIBUTE (1 << 30) | |
| 1315 | + | |
| 1316 | + | |
| 1317 | +struct ck_token_info | |
| 1318 | +{ | |
| 1319 | + unsigned char label[32]; | |
| 1320 | + unsigned char manufacturer_id[32]; | |
| 1321 | + unsigned char model[16]; | |
| 1322 | + unsigned char serial_number[16]; | |
| 1323 | + ck_flags_t flags; | |
| 1324 | + unsigned long max_session_count; | |
| 1325 | + unsigned long session_count; | |
| 1326 | + unsigned long max_rw_session_count; | |
| 1327 | + unsigned long rw_session_count; | |
| 1328 | + unsigned long max_pin_len; | |
| 1329 | + unsigned long min_pin_len; | |
| 1330 | + unsigned long total_public_memory; | |
| 1331 | + unsigned long free_public_memory; | |
| 1332 | + unsigned long total_private_memory; | |
| 1333 | + unsigned long free_private_memory; | |
| 1334 | + struct ck_version hardware_version; | |
| 1335 | + struct ck_version firmware_version; | |
| 1336 | + unsigned char utc_time[16]; | |
| 1337 | +}; | |
| 1338 | + | |
| 1339 | + | |
| 1340 | +#define CKF_RNG (1 << 0) | |
| 1341 | +#define CKF_WRITE_PROTECTED (1 << 1) | |
| 1342 | +#define CKF_LOGIN_REQUIRED (1 << 2) | |
| 1343 | +#define CKF_USER_PIN_INITIALIZED (1 << 3) | |
| 1344 | +#define CKF_RESTORE_KEY_NOT_NEEDED (1 << 5) | |
| 1345 | +#define CKF_CLOCK_ON_TOKEN (1 << 6) | |
| 1346 | +#define CKF_PROTECTED_AUTHENTICATION_PATH (1 << 8) | |
| 1347 | +#define CKF_DUAL_CRYPTO_OPERATIONS (1 << 9) | |
| 1348 | +#define CKF_TOKEN_INITIALIZED (1 << 10) | |
| 1349 | +#define CKF_SECONDARY_AUTHENTICATION (1 << 11) | |
| 1350 | +#define CKF_USER_PIN_COUNT_LOW (1 << 16) | |
| 1351 | +#define CKF_USER_PIN_FINAL_TRY (1 << 17) | |
| 1352 | +#define CKF_USER_PIN_LOCKED (1 << 18) | |
| 1353 | +#define CKF_USER_PIN_TO_BE_CHANGED (1 << 19) | |
| 1354 | +#define CKF_SO_PIN_COUNT_LOW (1 << 20) | |
| 1355 | +#define CKF_SO_PIN_FINAL_TRY (1 << 21) | |
| 1356 | +#define CKF_SO_PIN_LOCKED (1 << 22) | |
| 1357 | +#define CKF_SO_PIN_TO_BE_CHANGED (1 << 23) | |
| 1358 | + | |
| 1359 | +#define CK_UNAVAILABLE_INFORMATION ((unsigned long) -1) | |
| 1360 | +#define CK_EFFECTIVELY_INFINITE (0) | |
| 1361 | + | |
| 1362 | + | |
| 1363 | +typedef unsigned long ck_session_handle_t; | |
| 1364 | + | |
| 1365 | +#define CK_INVALID_HANDLE (0) | |
| 1366 | + | |
| 1367 | + | |
| 1368 | +typedef unsigned long ck_user_type_t; | |
| 1369 | + | |
| 1370 | +#define CKU_SO (0) | |
| 1371 | +#define CKU_USER (1) | |
| 1372 | +#define CKU_CONTEXT_SPECIFIC (2) | |
| 1373 | + | |
| 1374 | + | |
| 1375 | +typedef unsigned long ck_state_t; | |
| 1376 | + | |
| 1377 | +#define CKS_RO_PUBLIC_SESSION (0) | |
| 1378 | +#define CKS_RO_USER_FUNCTIONS (1) | |
| 1379 | +#define CKS_RW_PUBLIC_SESSION (2) | |
| 1380 | +#define CKS_RW_USER_FUNCTIONS (3) | |
| 1381 | +#define CKS_RW_SO_FUNCTIONS (4) | |
| 1382 | + | |
| 1383 | + | |
| 1384 | +struct ck_session_info | |
| 1385 | +{ | |
| 1386 | + ck_slot_id_t slot_id; | |
| 1387 | + ck_state_t state; | |
| 1388 | + ck_flags_t flags; | |
| 1389 | + unsigned long device_error; | |
| 1390 | +}; | |
| 1391 | + | |
| 1392 | +#define CKF_RW_SESSION (1 << 1) | |
| 1393 | +#define CKF_SERIAL_SESSION (1 << 2) | |
| 1394 | + | |
| 1395 | + | |
| 1396 | +typedef unsigned long ck_object_handle_t; | |
| 1397 | + | |
| 1398 | + | |
| 1399 | +typedef unsigned long ck_object_class_t; | |
| 1400 | + | |
| 1401 | +#define CKO_DATA (0) | |
| 1402 | +#define CKO_CERTIFICATE (1) | |
| 1403 | +#define CKO_PUBLIC_KEY (2) | |
| 1404 | +#define CKO_PRIVATE_KEY (3) | |
| 1405 | +#define CKO_SECRET_KEY (4) | |
| 1406 | +#define CKO_HW_FEATURE (5) | |
| 1407 | +#define CKO_DOMAIN_PARAMETERS (6) | |
| 1408 | +#define CKO_MECHANISM (7) | |
| 1409 | +#define CKO_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1410 | + | |
| 1411 | + | |
| 1412 | +typedef unsigned long ck_hw_feature_type_t; | |
| 1413 | + | |
| 1414 | +#define CKH_MONOTONIC_COUNTER (1) | |
| 1415 | +#define CKH_CLOCK (2) | |
| 1416 | +#define CKH_USER_INTERFACE (3) | |
| 1417 | +#define CKH_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1418 | + | |
| 1419 | + | |
| 1420 | +typedef unsigned long ck_key_type_t; | |
| 1421 | + | |
| 1422 | +#define CKK_RSA (0) | |
| 1423 | +#define CKK_DSA (1) | |
| 1424 | +#define CKK_DH (2) | |
| 1425 | +#define CKK_ECDSA (3) | |
| 1426 | +#define CKK_EC (3) | |
| 1427 | +#define CKK_X9_42_DH (4) | |
| 1428 | +#define CKK_KEA (5) | |
| 1429 | +#define CKK_GENERIC_SECRET (0x10) | |
| 1430 | +#define CKK_RC2 (0x11) | |
| 1431 | +#define CKK_RC4 (0x12) | |
| 1432 | +#define CKK_DES (0x13) | |
| 1433 | +#define CKK_DES2 (0x14) | |
| 1434 | +#define CKK_DES3 (0x15) | |
| 1435 | +#define CKK_CAST (0x16) | |
| 1436 | +#define CKK_CAST3 (0x17) | |
| 1437 | +#define CKK_CAST128 (0x18) | |
| 1438 | +#define CKK_RC5 (0x19) | |
| 1439 | +#define CKK_IDEA (0x1a) | |
| 1440 | +#define CKK_SKIPJACK (0x1b) | |
| 1441 | +#define CKK_BATON (0x1c) | |
| 1442 | +#define CKK_JUNIPER (0x1d) | |
| 1443 | +#define CKK_CDMF (0x1e) | |
| 1444 | +#define CKK_AES (0x1f) | |
| 1445 | +#define CKK_BLOWFISH (0x20) | |
| 1446 | +#define CKK_TWOFISH (0x21) | |
| 1447 | +#define CKK_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1448 | + | |
| 1449 | + | |
| 1450 | +typedef unsigned long ck_certificate_type_t; | |
| 1451 | + | |
| 1452 | +#define CKC_X_509 (0) | |
| 1453 | +#define CKC_X_509_ATTR_CERT (1) | |
| 1454 | +#define CKC_WTLS (2) | |
| 1455 | +#define CKC_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1456 | + | |
| 1457 | + | |
| 1458 | +typedef unsigned long ck_attribute_type_t; | |
| 1459 | + | |
| 1460 | +#define CKA_CLASS (0) | |
| 1461 | +#define CKA_TOKEN (1) | |
| 1462 | +#define CKA_PRIVATE (2) | |
| 1463 | +#define CKA_LABEL (3) | |
| 1464 | +#define CKA_APPLICATION (0x10) | |
| 1465 | +#define CKA_VALUE (0x11) | |
| 1466 | +#define CKA_OBJECT_ID (0x12) | |
| 1467 | +#define CKA_CERTIFICATE_TYPE (0x80) | |
| 1468 | +#define CKA_ISSUER (0x81) | |
| 1469 | +#define CKA_SERIAL_NUMBER (0x82) | |
| 1470 | +#define CKA_AC_ISSUER (0x83) | |
| 1471 | +#define CKA_OWNER (0x84) | |
| 1472 | +#define CKA_ATTR_TYPES (0x85) | |
| 1473 | +#define CKA_TRUSTED (0x86) | |
| 1474 | +#define CKA_CERTIFICATE_CATEGORY (0x87) | |
| 1475 | +#define CKA_JAVA_MIDP_SECURITY_DOMAIN (0x88) | |
| 1476 | +#define CKA_URL (0x89) | |
| 1477 | +#define CKA_HASH_OF_SUBJECT_PUBLIC_KEY (0x8a) | |
| 1478 | +#define CKA_HASH_OF_ISSUER_PUBLIC_KEY (0x8b) | |
| 1479 | +#define CKA_CHECK_VALUE (0x90) | |
| 1480 | +#define CKA_KEY_TYPE (0x100) | |
| 1481 | +#define CKA_SUBJECT (0x101) | |
| 1482 | +#define CKA_ID (0x102) | |
| 1483 | +#define CKA_SENSITIVE (0x103) | |
| 1484 | +#define CKA_ENCRYPT (0x104) | |
| 1485 | +#define CKA_DECRYPT (0x105) | |
| 1486 | +#define CKA_WRAP (0x106) | |
| 1487 | +#define CKA_UNWRAP (0x107) | |
| 1488 | +#define CKA_SIGN (0x108) | |
| 1489 | +#define CKA_SIGN_RECOVER (0x109) | |
| 1490 | +#define CKA_VERIFY (0x10a) | |
| 1491 | +#define CKA_VERIFY_RECOVER (0x10b) | |
| 1492 | +#define CKA_DERIVE (0x10c) | |
| 1493 | +#define CKA_START_DATE (0x110) | |
| 1494 | +#define CKA_END_DATE (0x111) | |
| 1495 | +#define CKA_MODULUS (0x120) | |
| 1496 | +#define CKA_MODULUS_BITS (0x121) | |
| 1497 | +#define CKA_PUBLIC_EXPONENT (0x122) | |
| 1498 | +#define CKA_PRIVATE_EXPONENT (0x123) | |
| 1499 | +#define CKA_PRIME_1 (0x124) | |
| 1500 | +#define CKA_PRIME_2 (0x125) | |
| 1501 | +#define CKA_EXPONENT_1 (0x126) | |
| 1502 | +#define CKA_EXPONENT_2 (0x127) | |
| 1503 | +#define CKA_COEFFICIENT (0x128) | |
| 1504 | +#define CKA_PRIME (0x130) | |
| 1505 | +#define CKA_SUBPRIME (0x131) | |
| 1506 | +#define CKA_BASE (0x132) | |
| 1507 | +#define CKA_PRIME_BITS (0x133) | |
| 1508 | +#define CKA_SUB_PRIME_BITS (0x134) | |
| 1509 | +#define CKA_VALUE_BITS (0x160) | |
| 1510 | +#define CKA_VALUE_LEN (0x161) | |
| 1511 | +#define CKA_EXTRACTABLE (0x162) | |
| 1512 | +#define CKA_LOCAL (0x163) | |
| 1513 | +#define CKA_NEVER_EXTRACTABLE (0x164) | |
| 1514 | +#define CKA_ALWAYS_SENSITIVE (0x165) | |
| 1515 | +#define CKA_KEY_GEN_MECHANISM (0x166) | |
| 1516 | +#define CKA_MODIFIABLE (0x170) | |
| 1517 | +#define CKA_ECDSA_PARAMS (0x180) | |
| 1518 | +#define CKA_EC_PARAMS (0x180) | |
| 1519 | +#define CKA_EC_POINT (0x181) | |
| 1520 | +#define CKA_SECONDARY_AUTH (0x200) | |
| 1521 | +#define CKA_AUTH_PIN_FLAGS (0x201) | |
| 1522 | +#define CKA_ALWAYS_AUTHENTICATE (0x202) | |
| 1523 | +#define CKA_WRAP_WITH_TRUSTED (0x210) | |
| 1524 | +#define CKA_HW_FEATURE_TYPE (0x300) | |
| 1525 | +#define CKA_RESET_ON_INIT (0x301) | |
| 1526 | +#define CKA_HAS_RESET (0x302) | |
| 1527 | +#define CKA_PIXEL_X (0x400) | |
| 1528 | +#define CKA_PIXEL_Y (0x401) | |
| 1529 | +#define CKA_RESOLUTION (0x402) | |
| 1530 | +#define CKA_CHAR_ROWS (0x403) | |
| 1531 | +#define CKA_CHAR_COLUMNS (0x404) | |
| 1532 | +#define CKA_COLOR (0x405) | |
| 1533 | +#define CKA_BITS_PER_PIXEL (0x406) | |
| 1534 | +#define CKA_CHAR_SETS (0x480) | |
| 1535 | +#define CKA_ENCODING_METHODS (0x481) | |
| 1536 | +#define CKA_MIME_TYPES (0x482) | |
| 1537 | +#define CKA_MECHANISM_TYPE (0x500) | |
| 1538 | +#define CKA_REQUIRED_CMS_ATTRIBUTES (0x501) | |
| 1539 | +#define CKA_DEFAULT_CMS_ATTRIBUTES (0x502) | |
| 1540 | +#define CKA_SUPPORTED_CMS_ATTRIBUTES (0x503) | |
| 1541 | +#define CKA_WRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x211) | |
| 1542 | +#define CKA_UNWRAP_TEMPLATE (CKF_ARRAY_ATTRIBUTE | 0x212) | |
| 1543 | +#define CKA_ALLOWED_MECHANISMS (CKF_ARRAY_ATTRIBUTE | 0x600) | |
| 1544 | +#define CKA_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1545 | + | |
| 1546 | + | |
| 1547 | +struct ck_attribute | |
| 1548 | +{ | |
| 1549 | + ck_attribute_type_t type; | |
| 1550 | + void *value; | |
| 1551 | + unsigned long value_len; | |
| 1552 | +}; | |
| 1553 | + | |
| 1554 | + | |
| 1555 | +struct ck_date | |
| 1556 | +{ | |
| 1557 | + unsigned char year[4]; | |
| 1558 | + unsigned char month[2]; | |
| 1559 | + unsigned char day[2]; | |
| 1560 | +}; | |
| 1561 | + | |
| 1562 | + | |
| 1563 | +typedef unsigned long ck_mechanism_type_t; | |
| 1564 | + | |
| 1565 | +#define CKM_RSA_PKCS_KEY_PAIR_GEN (0) | |
| 1566 | +#define CKM_RSA_PKCS (1) | |
| 1567 | +#define CKM_RSA_9796 (2) | |
| 1568 | +#define CKM_RSA_X_509 (3) | |
| 1569 | +#define CKM_MD2_RSA_PKCS (4) | |
| 1570 | +#define CKM_MD5_RSA_PKCS (5) | |
| 1571 | +#define CKM_SHA1_RSA_PKCS (6) | |
| 1572 | +#define CKM_RIPEMD128_RSA_PKCS (7) | |
| 1573 | +#define CKM_RIPEMD160_RSA_PKCS (8) | |
| 1574 | +#define CKM_RSA_PKCS_OAEP (9) | |
| 1575 | +#define CKM_RSA_X9_31_KEY_PAIR_GEN (0xa) | |
| 1576 | +#define CKM_RSA_X9_31 (0xb) | |
| 1577 | +#define CKM_SHA1_RSA_X9_31 (0xc) | |
| 1578 | +#define CKM_RSA_PKCS_PSS (0xd) | |
| 1579 | +#define CKM_SHA1_RSA_PKCS_PSS (0xe) | |
| 1580 | +#define CKM_DSA_KEY_PAIR_GEN (0x10) | |
| 1581 | +#define CKM_DSA (0x11) | |
| 1582 | +#define CKM_DSA_SHA1 (0x12) | |
| 1583 | +#define CKM_DH_PKCS_KEY_PAIR_GEN (0x20) | |
| 1584 | +#define CKM_DH_PKCS_DERIVE (0x21) | |
| 1585 | +#define CKM_X9_42_DH_KEY_PAIR_GEN (0x30) | |
| 1586 | +#define CKM_X9_42_DH_DERIVE (0x31) | |
| 1587 | +#define CKM_X9_42_DH_HYBRID_DERIVE (0x32) | |
| 1588 | +#define CKM_X9_42_MQV_DERIVE (0x33) | |
| 1589 | +#define CKM_SHA256_RSA_PKCS (0x40) | |
| 1590 | +#define CKM_SHA384_RSA_PKCS (0x41) | |
| 1591 | +#define CKM_SHA512_RSA_PKCS (0x42) | |
| 1592 | +#define CKM_SHA256_RSA_PKCS_PSS (0x43) | |
| 1593 | +#define CKM_SHA384_RSA_PKCS_PSS (0x44) | |
| 1594 | +#define CKM_SHA512_RSA_PKCS_PSS (0x45) | |
| 1595 | +#define CKM_RC2_KEY_GEN (0x100) | |
| 1596 | +#define CKM_RC2_ECB (0x101) | |
| 1597 | +#define CKM_RC2_CBC (0x102) | |
| 1598 | +#define CKM_RC2_MAC (0x103) | |
| 1599 | +#define CKM_RC2_MAC_GENERAL (0x104) | |
| 1600 | +#define CKM_RC2_CBC_PAD (0x105) | |
| 1601 | +#define CKM_RC4_KEY_GEN (0x110) | |
| 1602 | +#define CKM_RC4 (0x111) | |
| 1603 | +#define CKM_DES_KEY_GEN (0x120) | |
| 1604 | +#define CKM_DES_ECB (0x121) | |
| 1605 | +#define CKM_DES_CBC (0x122) | |
| 1606 | +#define CKM_DES_MAC (0x123) | |
| 1607 | +#define CKM_DES_MAC_GENERAL (0x124) | |
| 1608 | +#define CKM_DES_CBC_PAD (0x125) | |
| 1609 | +#define CKM_DES2_KEY_GEN (0x130) | |
| 1610 | +#define CKM_DES3_KEY_GEN (0x131) | |
| 1611 | +#define CKM_DES3_ECB (0x132) | |
| 1612 | +#define CKM_DES3_CBC (0x133) | |
| 1613 | +#define CKM_DES3_MAC (0x134) | |
| 1614 | +#define CKM_DES3_MAC_GENERAL (0x135) | |
| 1615 | +#define CKM_DES3_CBC_PAD (0x136) | |
| 1616 | +#define CKM_CDMF_KEY_GEN (0x140) | |
| 1617 | +#define CKM_CDMF_ECB (0x141) | |
| 1618 | +#define CKM_CDMF_CBC (0x142) | |
| 1619 | +#define CKM_CDMF_MAC (0x143) | |
| 1620 | +#define CKM_CDMF_MAC_GENERAL (0x144) | |
| 1621 | +#define CKM_CDMF_CBC_PAD (0x145) | |
| 1622 | +#define CKM_MD2 (0x200) | |
| 1623 | +#define CKM_MD2_HMAC (0x201) | |
| 1624 | +#define CKM_MD2_HMAC_GENERAL (0x202) | |
| 1625 | +#define CKM_MD5 (0x210) | |
| 1626 | +#define CKM_MD5_HMAC (0x211) | |
| 1627 | +#define CKM_MD5_HMAC_GENERAL (0x212) | |
| 1628 | +#define CKM_SHA_1 (0x220) | |
| 1629 | +#define CKM_SHA_1_HMAC (0x221) | |
| 1630 | +#define CKM_SHA_1_HMAC_GENERAL (0x222) | |
| 1631 | +#define CKM_RIPEMD128 (0x230) | |
| 1632 | +#define CKM_RIPEMD128_HMAC (0x231) | |
| 1633 | +#define CKM_RIPEMD128_HMAC_GENERAL (0x232) | |
| 1634 | +#define CKM_RIPEMD160 (0x240) | |
| 1635 | +#define CKM_RIPEMD160_HMAC (0x241) | |
| 1636 | +#define CKM_RIPEMD160_HMAC_GENERAL (0x242) | |
| 1637 | +#define CKM_SHA256 (0x250) | |
| 1638 | +#define CKM_SHA256_HMAC (0x251) | |
| 1639 | +#define CKM_SHA256_HMAC_GENERAL (0x252) | |
| 1640 | +#define CKM_SHA384 (0x260) | |
| 1641 | +#define CKM_SHA384_HMAC (0x261) | |
| 1642 | +#define CKM_SHA384_HMAC_GENERAL (0x262) | |
| 1643 | +#define CKM_SHA512 (0x270) | |
| 1644 | +#define CKM_SHA512_HMAC (0x271) | |
| 1645 | +#define CKM_SHA512_HMAC_GENERAL (0x272) | |
| 1646 | +#define CKM_CAST_KEY_GEN (0x300) | |
| 1647 | +#define CKM_CAST_ECB (0x301) | |
| 1648 | +#define CKM_CAST_CBC (0x302) | |
| 1649 | +#define CKM_CAST_MAC (0x303) | |
| 1650 | +#define CKM_CAST_MAC_GENERAL (0x304) | |
| 1651 | +#define CKM_CAST_CBC_PAD (0x305) | |
| 1652 | +#define CKM_CAST3_KEY_GEN (0x310) | |
| 1653 | +#define CKM_CAST3_ECB (0x311) | |
| 1654 | +#define CKM_CAST3_CBC (0x312) | |
| 1655 | +#define CKM_CAST3_MAC (0x313) | |
| 1656 | +#define CKM_CAST3_MAC_GENERAL (0x314) | |
| 1657 | +#define CKM_CAST3_CBC_PAD (0x315) | |
| 1658 | +#define CKM_CAST5_KEY_GEN (0x320) | |
| 1659 | +#define CKM_CAST128_KEY_GEN (0x320) | |
| 1660 | +#define CKM_CAST5_ECB (0x321) | |
| 1661 | +#define CKM_CAST128_ECB (0x321) | |
| 1662 | +#define CKM_CAST5_CBC (0x322) | |
| 1663 | +#define CKM_CAST128_CBC (0x322) | |
| 1664 | +#define CKM_CAST5_MAC (0x323) | |
| 1665 | +#define CKM_CAST128_MAC (0x323) | |
| 1666 | +#define CKM_CAST5_MAC_GENERAL (0x324) | |
| 1667 | +#define CKM_CAST128_MAC_GENERAL (0x324) | |
| 1668 | +#define CKM_CAST5_CBC_PAD (0x325) | |
| 1669 | +#define CKM_CAST128_CBC_PAD (0x325) | |
| 1670 | +#define CKM_RC5_KEY_GEN (0x330) | |
| 1671 | +#define CKM_RC5_ECB (0x331) | |
| 1672 | +#define CKM_RC5_CBC (0x332) | |
| 1673 | +#define CKM_RC5_MAC (0x333) | |
| 1674 | +#define CKM_RC5_MAC_GENERAL (0x334) | |
| 1675 | +#define CKM_RC5_CBC_PAD (0x335) | |
| 1676 | +#define CKM_IDEA_KEY_GEN (0x340) | |
| 1677 | +#define CKM_IDEA_ECB (0x341) | |
| 1678 | +#define CKM_IDEA_CBC (0x342) | |
| 1679 | +#define CKM_IDEA_MAC (0x343) | |
| 1680 | +#define CKM_IDEA_MAC_GENERAL (0x344) | |
| 1681 | +#define CKM_IDEA_CBC_PAD (0x345) | |
| 1682 | +#define CKM_GENERIC_SECRET_KEY_GEN (0x350) | |
| 1683 | +#define CKM_CONCATENATE_BASE_AND_KEY (0x360) | |
| 1684 | +#define CKM_CONCATENATE_BASE_AND_DATA (0x362) | |
| 1685 | +#define CKM_CONCATENATE_DATA_AND_BASE (0x363) | |
| 1686 | +#define CKM_XOR_BASE_AND_DATA (0x364) | |
| 1687 | +#define CKM_EXTRACT_KEY_FROM_KEY (0x365) | |
| 1688 | +#define CKM_SSL3_PRE_MASTER_KEY_GEN (0x370) | |
| 1689 | +#define CKM_SSL3_MASTER_KEY_DERIVE (0x371) | |
| 1690 | +#define CKM_SSL3_KEY_AND_MAC_DERIVE (0x372) | |
| 1691 | +#define CKM_SSL3_MASTER_KEY_DERIVE_DH (0x373) | |
| 1692 | +#define CKM_TLS_PRE_MASTER_KEY_GEN (0x374) | |
| 1693 | +#define CKM_TLS_MASTER_KEY_DERIVE (0x375) | |
| 1694 | +#define CKM_TLS_KEY_AND_MAC_DERIVE (0x376) | |
| 1695 | +#define CKM_TLS_MASTER_KEY_DERIVE_DH (0x377) | |
| 1696 | +#define CKM_SSL3_MD5_MAC (0x380) | |
| 1697 | +#define CKM_SSL3_SHA1_MAC (0x381) | |
| 1698 | +#define CKM_MD5_KEY_DERIVATION (0x390) | |
| 1699 | +#define CKM_MD2_KEY_DERIVATION (0x391) | |
| 1700 | +#define CKM_SHA1_KEY_DERIVATION (0x392) | |
| 1701 | +#define CKM_PBE_MD2_DES_CBC (0x3a0) | |
| 1702 | +#define CKM_PBE_MD5_DES_CBC (0x3a1) | |
| 1703 | +#define CKM_PBE_MD5_CAST_CBC (0x3a2) | |
| 1704 | +#define CKM_PBE_MD5_CAST3_CBC (0x3a3) | |
| 1705 | +#define CKM_PBE_MD5_CAST5_CBC (0x3a4) | |
| 1706 | +#define CKM_PBE_MD5_CAST128_CBC (0x3a4) | |
| 1707 | +#define CKM_PBE_SHA1_CAST5_CBC (0x3a5) | |
| 1708 | +#define CKM_PBE_SHA1_CAST128_CBC (0x3a5) | |
| 1709 | +#define CKM_PBE_SHA1_RC4_128 (0x3a6) | |
| 1710 | +#define CKM_PBE_SHA1_RC4_40 (0x3a7) | |
| 1711 | +#define CKM_PBE_SHA1_DES3_EDE_CBC (0x3a8) | |
| 1712 | +#define CKM_PBE_SHA1_DES2_EDE_CBC (0x3a9) | |
| 1713 | +#define CKM_PBE_SHA1_RC2_128_CBC (0x3aa) | |
| 1714 | +#define CKM_PBE_SHA1_RC2_40_CBC (0x3ab) | |
| 1715 | +#define CKM_PKCS5_PBKD2 (0x3b0) | |
| 1716 | +#define CKM_PBA_SHA1_WITH_SHA1_HMAC (0x3c0) | |
| 1717 | +#define CKM_KEY_WRAP_LYNKS (0x400) | |
| 1718 | +#define CKM_KEY_WRAP_SET_OAEP (0x401) | |
| 1719 | +#define CKM_SKIPJACK_KEY_GEN (0x1000) | |
| 1720 | +#define CKM_SKIPJACK_ECB64 (0x1001) | |
| 1721 | +#define CKM_SKIPJACK_CBC64 (0x1002) | |
| 1722 | +#define CKM_SKIPJACK_OFB64 (0x1003) | |
| 1723 | +#define CKM_SKIPJACK_CFB64 (0x1004) | |
| 1724 | +#define CKM_SKIPJACK_CFB32 (0x1005) | |
| 1725 | +#define CKM_SKIPJACK_CFB16 (0x1006) | |
| 1726 | +#define CKM_SKIPJACK_CFB8 (0x1007) | |
| 1727 | +#define CKM_SKIPJACK_WRAP (0x1008) | |
| 1728 | +#define CKM_SKIPJACK_PRIVATE_WRAP (0x1009) | |
| 1729 | +#define CKM_SKIPJACK_RELAYX (0x100a) | |
| 1730 | +#define CKM_KEA_KEY_PAIR_GEN (0x1010) | |
| 1731 | +#define CKM_KEA_KEY_DERIVE (0x1011) | |
| 1732 | +#define CKM_FORTEZZA_TIMESTAMP (0x1020) | |
| 1733 | +#define CKM_BATON_KEY_GEN (0x1030) | |
| 1734 | +#define CKM_BATON_ECB128 (0x1031) | |
| 1735 | +#define CKM_BATON_ECB96 (0x1032) | |
| 1736 | +#define CKM_BATON_CBC128 (0x1033) | |
| 1737 | +#define CKM_BATON_COUNTER (0x1034) | |
| 1738 | +#define CKM_BATON_SHUFFLE (0x1035) | |
| 1739 | +#define CKM_BATON_WRAP (0x1036) | |
| 1740 | +#define CKM_ECDSA_KEY_PAIR_GEN (0x1040) | |
| 1741 | +#define CKM_EC_KEY_PAIR_GEN (0x1040) | |
| 1742 | +#define CKM_ECDSA (0x1041) | |
| 1743 | +#define CKM_ECDSA_SHA1 (0x1042) | |
| 1744 | +#define CKM_ECDH1_DERIVE (0x1050) | |
| 1745 | +#define CKM_ECDH1_COFACTOR_DERIVE (0x1051) | |
| 1746 | +#define CKM_ECMQV_DERIVE (0x1052) | |
| 1747 | +#define CKM_JUNIPER_KEY_GEN (0x1060) | |
| 1748 | +#define CKM_JUNIPER_ECB128 (0x1061) | |
| 1749 | +#define CKM_JUNIPER_CBC128 (0x1062) | |
| 1750 | +#define CKM_JUNIPER_COUNTER (0x1063) | |
| 1751 | +#define CKM_JUNIPER_SHUFFLE (0x1064) | |
| 1752 | +#define CKM_JUNIPER_WRAP (0x1065) | |
| 1753 | +#define CKM_FASTHASH (0x1070) | |
| 1754 | +#define CKM_AES_KEY_GEN (0x1080) | |
| 1755 | +#define CKM_AES_ECB (0x1081) | |
| 1756 | +#define CKM_AES_CBC (0x1082) | |
| 1757 | +#define CKM_AES_MAC (0x1083) | |
| 1758 | +#define CKM_AES_MAC_GENERAL (0x1084) | |
| 1759 | +#define CKM_AES_CBC_PAD (0x1085) | |
| 1760 | +#define CKM_DSA_PARAMETER_GEN (0x2000) | |
| 1761 | +#define CKM_DH_PKCS_PARAMETER_GEN (0x2001) | |
| 1762 | +#define CKM_X9_42_DH_PARAMETER_GEN (0x2002) | |
| 1763 | +#define CKM_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 1764 | + | |
| 1765 | + | |
| 1766 | +struct ck_mechanism | |
| 1767 | +{ | |
| 1768 | + ck_mechanism_type_t mechanism; | |
| 1769 | + void *parameter; | |
| 1770 | + unsigned long parameter_len; | |
| 1771 | +}; | |
| 1772 | + | |
| 1773 | + | |
| 1774 | +struct ck_mechanism_info | |
| 1775 | +{ | |
| 1776 | + unsigned long min_key_size; | |
| 1777 | + unsigned long max_key_size; | |
| 1778 | + ck_flags_t flags; | |
| 1779 | +}; | |
| 1780 | + | |
| 1781 | +#define CKF_HW (1 << 0) | |
| 1782 | +#define CKF_ENCRYPT (1 << 8) | |
| 1783 | +#define CKF_DECRYPT (1 << 9) | |
| 1784 | +#define CKF_DIGEST (1 << 10) | |
| 1785 | +#define CKF_SIGN (1 << 11) | |
| 1786 | +#define CKF_SIGN_RECOVER (1 << 12) | |
| 1787 | +#define CKF_VERIFY (1 << 13) | |
| 1788 | +#define CKF_VERIFY_RECOVER (1 << 14) | |
| 1789 | +#define CKF_GENERATE (1 << 15) | |
| 1790 | +#define CKF_GENERATE_KEY_PAIR (1 << 16) | |
| 1791 | +#define CKF_WRAP (1 << 17) | |
| 1792 | +#define CKF_UNWRAP (1 << 18) | |
| 1793 | +#define CKF_DERIVE (1 << 19) | |
| 1794 | +#define CKF_EXTENSION ((unsigned long) (1 << 31)) | |
| 1795 | + | |
| 1796 | + | |
| 1797 | +/* Flags for C_WaitForSlotEvent. */ | |
| 1798 | +#define CKF_DONT_BLOCK (1) | |
| 1799 | + | |
| 1800 | + | |
| 1801 | +typedef unsigned long ck_rv_t; | |
| 1802 | + | |
| 1803 | + | |
| 1804 | +typedef ck_rv_t (*ck_notify_t) (ck_session_handle_t session, | |
| 1805 | + ck_notification_t event, void *application); | |
| 1806 | + | |
| 1807 | +/* Forward reference. */ | |
| 1808 | +struct ck_function_list; | |
| 1809 | + | |
| 1810 | +#define _CK_DECLARE_FUNCTION(name, args) \ | |
| 1811 | +typedef ck_rv_t (*CK_ ## name) args; \ | |
| 1812 | +ck_rv_t CK_SPEC name args | |
| 1813 | + | |
| 1814 | +_CK_DECLARE_FUNCTION (C_Initialize, (void *init_args)); | |
| 1815 | +_CK_DECLARE_FUNCTION (C_Finalize, (void *reserved)); | |
| 1816 | +_CK_DECLARE_FUNCTION (C_GetInfo, (struct ck_info *info)); | |
| 1817 | +_CK_DECLARE_FUNCTION (C_GetFunctionList, | |
| 1818 | + (struct ck_function_list **function_list)); | |
| 1819 | + | |
| 1820 | +_CK_DECLARE_FUNCTION (C_GetSlotList, | |
| 1821 | + (unsigned char token_present, ck_slot_id_t *slot_list, | |
| 1822 | + unsigned long *count)); | |
| 1823 | +_CK_DECLARE_FUNCTION (C_GetSlotInfo, | |
| 1824 | + (ck_slot_id_t slot_id, struct ck_slot_info *info)); | |
| 1825 | +_CK_DECLARE_FUNCTION (C_GetTokenInfo, | |
| 1826 | + (ck_slot_id_t slot_id, struct ck_token_info *info)); | |
| 1827 | +_CK_DECLARE_FUNCTION (C_WaitForSlotEvent, | |
| 1828 | + (ck_flags_t flags, ck_slot_id_t *slot, void *reserved)); | |
| 1829 | +_CK_DECLARE_FUNCTION (C_GetMechanismList, | |
| 1830 | + (ck_slot_id_t slot_id, | |
| 1831 | + ck_mechanism_type_t *mechanism_list, | |
| 1832 | + unsigned long *count)); | |
| 1833 | +_CK_DECLARE_FUNCTION (C_GetMechanismInfo, | |
| 1834 | + (ck_slot_id_t slot_id, ck_mechanism_type_t type, | |
| 1835 | + struct ck_mechanism_info *info)); | |
| 1836 | +_CK_DECLARE_FUNCTION (C_InitToken, | |
| 1837 | + (ck_slot_id_t slot_id, unsigned char *pin, | |
| 1838 | + unsigned long pin_len, unsigned char *label)); | |
| 1839 | +_CK_DECLARE_FUNCTION (C_InitPIN, | |
| 1840 | + (ck_session_handle_t session, unsigned char *pin, | |
| 1841 | + unsigned long pin_len)); | |
| 1842 | +_CK_DECLARE_FUNCTION (C_SetPIN, | |
| 1843 | + (ck_session_handle_t session, unsigned char *old_pin, | |
| 1844 | + unsigned long old_len, unsigned char *new_pin, | |
| 1845 | + unsigned long new_len)); | |
| 1846 | + | |
| 1847 | +_CK_DECLARE_FUNCTION (C_OpenSession, | |
| 1848 | + (ck_slot_id_t slot_id, ck_flags_t flags, | |
| 1849 | + void *application, ck_notify_t notify, | |
| 1850 | + ck_session_handle_t *session)); | |
| 1851 | +_CK_DECLARE_FUNCTION (C_CloseSession, (ck_session_handle_t session)); | |
| 1852 | +_CK_DECLARE_FUNCTION (C_CloseAllSessions, (ck_slot_id_t slot_id)); | |
| 1853 | +_CK_DECLARE_FUNCTION (C_GetSessionInfo, | |
| 1854 | + (ck_session_handle_t session, | |
| 1855 | + struct ck_session_info *info)); | |
| 1856 | +_CK_DECLARE_FUNCTION (C_GetOperationState, | |
| 1857 | + (ck_session_handle_t session, | |
| 1858 | + unsigned char *operation_state, | |
| 1859 | + unsigned long *operation_state_len)); | |
| 1860 | +_CK_DECLARE_FUNCTION (C_SetOperationState, | |
| 1861 | + (ck_session_handle_t session, | |
| 1862 | + unsigned char *operation_state, | |
| 1863 | + unsigned long operation_state_len, | |
| 1864 | + ck_object_handle_t encryption_key, | |
| 1865 | + ck_object_handle_t authentiation_key)); | |
| 1866 | +_CK_DECLARE_FUNCTION (C_Login, | |
| 1867 | + (ck_session_handle_t session, ck_user_type_t user_type, | |
| 1868 | + unsigned char *pin, unsigned long pin_len)); | |
| 1869 | +_CK_DECLARE_FUNCTION (C_Logout, (ck_session_handle_t session)); | |
| 1870 | + | |
| 1871 | +_CK_DECLARE_FUNCTION (C_CreateObject, | |
| 1872 | + (ck_session_handle_t session, | |
| 1873 | + struct ck_attribute *templ, | |
| 1874 | + unsigned long count, ck_object_handle_t *object)); | |
| 1875 | +_CK_DECLARE_FUNCTION (C_CopyObject, | |
| 1876 | + (ck_session_handle_t session, ck_object_handle_t object, | |
| 1877 | + struct ck_attribute *templ, unsigned long count, | |
| 1878 | + ck_object_handle_t *new_object)); | |
| 1879 | +_CK_DECLARE_FUNCTION (C_DestroyObject, | |
| 1880 | + (ck_session_handle_t session, | |
| 1881 | + ck_object_handle_t object)); | |
| 1882 | +_CK_DECLARE_FUNCTION (C_GetObjectSize, | |
| 1883 | + (ck_session_handle_t session, | |
| 1884 | + ck_object_handle_t object, | |
| 1885 | + unsigned long *size)); | |
| 1886 | +_CK_DECLARE_FUNCTION (C_GetAttributeValue, | |
| 1887 | + (ck_session_handle_t session, | |
| 1888 | + ck_object_handle_t object, | |
| 1889 | + struct ck_attribute *templ, | |
| 1890 | + unsigned long count)); | |
| 1891 | +_CK_DECLARE_FUNCTION (C_SetAttributeValue, | |
| 1892 | + (ck_session_handle_t session, | |
| 1893 | + ck_object_handle_t object, | |
| 1894 | + struct ck_attribute *templ, | |
| 1895 | + unsigned long count)); | |
| 1896 | +_CK_DECLARE_FUNCTION (C_FindObjectsInit, | |
| 1897 | + (ck_session_handle_t session, | |
| 1898 | + struct ck_attribute *templ, | |
| 1899 | + unsigned long count)); | |
| 1900 | +_CK_DECLARE_FUNCTION (C_FindObjects, | |
| 1901 | + (ck_session_handle_t session, | |
| 1902 | + ck_object_handle_t *object, | |
| 1903 | + unsigned long max_object_count, | |
| 1904 | + unsigned long *object_count)); | |
| 1905 | +_CK_DECLARE_FUNCTION (C_FindObjectsFinal, | |
| 1906 | + (ck_session_handle_t session)); | |
| 1907 | + | |
| 1908 | +_CK_DECLARE_FUNCTION (C_EncryptInit, | |
| 1909 | + (ck_session_handle_t session, | |
| 1910 | + struct ck_mechanism *mechanism, | |
| 1911 | + ck_object_handle_t key)); | |
| 1912 | +_CK_DECLARE_FUNCTION (C_Encrypt, | |
| 1913 | + (ck_session_handle_t session, | |
| 1914 | + unsigned char *data, unsigned long data_len, | |
| 1915 | + unsigned char *encrypted_data, | |
| 1916 | + unsigned long *encrypted_data_len)); | |
| 1917 | +_CK_DECLARE_FUNCTION (C_EncryptUpdate, | |
| 1918 | + (ck_session_handle_t session, | |
| 1919 | + unsigned char *part, unsigned long part_len, | |
| 1920 | + unsigned char *encrypted_part, | |
| 1921 | + unsigned long *encrypted_part_len)); | |
| 1922 | +_CK_DECLARE_FUNCTION (C_EncryptFinal, | |
| 1923 | + (ck_session_handle_t session, | |
| 1924 | + unsigned char *last_encrypted_part, | |
| 1925 | + unsigned long *last_encrypted_part_len)); | |
| 1926 | + | |
| 1927 | +_CK_DECLARE_FUNCTION (C_DecryptInit, | |
| 1928 | + (ck_session_handle_t session, | |
| 1929 | + struct ck_mechanism *mechanism, | |
| 1930 | + ck_object_handle_t key)); | |
| 1931 | +_CK_DECLARE_FUNCTION (C_Decrypt, | |
| 1932 | + (ck_session_handle_t session, | |
| 1933 | + unsigned char *encrypted_data, | |
| 1934 | + unsigned long encrypted_data_len, | |
| 1935 | + unsigned char *data, unsigned long *data_len)); | |
| 1936 | +_CK_DECLARE_FUNCTION (C_DecryptUpdate, | |
| 1937 | + (ck_session_handle_t session, | |
| 1938 | + unsigned char *encrypted_part, | |
| 1939 | + unsigned long encrypted_part_len, | |
| 1940 | + unsigned char *part, unsigned long *part_len)); | |
| 1941 | +_CK_DECLARE_FUNCTION (C_DecryptFinal, | |
| 1942 | + (ck_session_handle_t session, | |
| 1943 | + unsigned char *last_part, | |
| 1944 | + unsigned long *last_part_len)); | |
| 1945 | + | |
| 1946 | +_CK_DECLARE_FUNCTION (C_DigestInit, | |
| 1947 | + (ck_session_handle_t session, | |
| 1948 | + struct ck_mechanism *mechanism)); | |
| 1949 | +_CK_DECLARE_FUNCTION (C_Digest, | |
| 1950 | + (ck_session_handle_t session, | |
| 1951 | + unsigned char *data, unsigned long data_len, | |
| 1952 | + unsigned char *digest, | |
| 1953 | + unsigned long *digest_len)); | |
| 1954 | +_CK_DECLARE_FUNCTION (C_DigestUpdate, | |
| 1955 | + (ck_session_handle_t session, | |
| 1956 | + unsigned char *part, unsigned long part_len)); | |
| 1957 | +_CK_DECLARE_FUNCTION (C_DigestKey, | |
| 1958 | + (ck_session_handle_t session, ck_object_handle_t key)); | |
| 1959 | +_CK_DECLARE_FUNCTION (C_DigestFinal, | |
| 1960 | + (ck_session_handle_t session, | |
| 1961 | + unsigned char *digest, | |
| 1962 | + unsigned long *digest_len)); | |
| 1963 | + | |
| 1964 | +_CK_DECLARE_FUNCTION (C_SignInit, | |
| 1965 | + (ck_session_handle_t session, | |
| 1966 | + struct ck_mechanism *mechanism, | |
| 1967 | + ck_object_handle_t key)); | |
| 1968 | +_CK_DECLARE_FUNCTION (C_Sign, | |
| 1969 | + (ck_session_handle_t session, | |
| 1970 | + unsigned char *data, unsigned long data_len, | |
| 1971 | + unsigned char *signature, | |
| 1972 | + unsigned long *signature_len)); | |
| 1973 | +_CK_DECLARE_FUNCTION (C_SignUpdate, | |
| 1974 | + (ck_session_handle_t session, | |
| 1975 | + unsigned char *part, unsigned long part_len)); | |
| 1976 | +_CK_DECLARE_FUNCTION (C_SignFinal, | |
| 1977 | + (ck_session_handle_t session, | |
| 1978 | + unsigned char *signature, | |
| 1979 | + unsigned long *signature_len)); | |
| 1980 | +_CK_DECLARE_FUNCTION (C_SignRecoverInit, | |
| 1981 | + (ck_session_handle_t session, | |
| 1982 | + struct ck_mechanism *mechanism, | |
| 1983 | + ck_object_handle_t key)); | |
| 1984 | +_CK_DECLARE_FUNCTION (C_SignRecover, | |
| 1985 | + (ck_session_handle_t session, | |
| 1986 | + unsigned char *data, unsigned long data_len, | |
| 1987 | + unsigned char *signature, | |
| 1988 | + unsigned long *signature_len)); | |
| 1989 | + | |
| 1990 | +_CK_DECLARE_FUNCTION (C_VerifyInit, | |
| 1991 | + (ck_session_handle_t session, | |
| 1992 | + struct ck_mechanism *mechanism, | |
| 1993 | + ck_object_handle_t key)); | |
| 1994 | +_CK_DECLARE_FUNCTION (C_Verify, | |
| 1995 | + (ck_session_handle_t session, | |
| 1996 | + unsigned char *data, unsigned long data_len, | |
| 1997 | + unsigned char *signature, | |
| 1998 | + unsigned long signature_len)); | |
| 1999 | +_CK_DECLARE_FUNCTION (C_VerifyUpdate, | |
| 2000 | + (ck_session_handle_t session, | |
| 2001 | + unsigned char *part, unsigned long part_len)); | |
| 2002 | +_CK_DECLARE_FUNCTION (C_VerifyFinal, | |
| 2003 | + (ck_session_handle_t session, | |
| 2004 | + unsigned char *signature, | |
| 2005 | + unsigned long signature_len)); | |
| 2006 | +_CK_DECLARE_FUNCTION (C_VerifyRecoverInit, | |
| 2007 | + (ck_session_handle_t session, | |
| 2008 | + struct ck_mechanism *mechanism, | |
| 2009 | + ck_object_handle_t key)); | |
| 2010 | +_CK_DECLARE_FUNCTION (C_VerifyRecover, | |
| 2011 | + (ck_session_handle_t session, | |
| 2012 | + unsigned char *signature, | |
| 2013 | + unsigned long signature_len, | |
| 2014 | + unsigned char *data, | |
| 2015 | + unsigned long *data_len)); | |
| 2016 | + | |
| 2017 | +_CK_DECLARE_FUNCTION (C_DigestEncryptUpdate, | |
| 2018 | + (ck_session_handle_t session, | |
| 2019 | + unsigned char *part, unsigned long part_len, | |
| 2020 | + unsigned char *encrypted_part, | |
| 2021 | + unsigned long *encrypted_part_len)); | |
| 2022 | +_CK_DECLARE_FUNCTION (C_DecryptDigestUpdate, | |
| 2023 | + (ck_session_handle_t session, | |
| 2024 | + unsigned char *encrypted_part, | |
| 2025 | + unsigned long encrypted_part_len, | |
| 2026 | + unsigned char *part, | |
| 2027 | + unsigned long *part_len)); | |
| 2028 | +_CK_DECLARE_FUNCTION (C_SignEncryptUpdate, | |
| 2029 | + (ck_session_handle_t session, | |
| 2030 | + unsigned char *part, unsigned long part_len, | |
| 2031 | + unsigned char *encrypted_part, | |
| 2032 | + unsigned long *encrypted_part_len)); | |
| 2033 | +_CK_DECLARE_FUNCTION (C_DecryptVerifyUpdate, | |
| 2034 | + (ck_session_handle_t session, | |
| 2035 | + unsigned char *encrypted_part, | |
| 2036 | + unsigned long encrypted_part_len, | |
| 2037 | + unsigned char *part, | |
| 2038 | + unsigned long *part_len)); | |
| 2039 | + | |
| 2040 | +_CK_DECLARE_FUNCTION (C_GenerateKey, | |
| 2041 | + (ck_session_handle_t session, | |
| 2042 | + struct ck_mechanism *mechanism, | |
| 2043 | + struct ck_attribute *templ, | |
| 2044 | + unsigned long count, | |
| 2045 | + ck_object_handle_t *key)); | |
| 2046 | +_CK_DECLARE_FUNCTION (C_GenerateKeyPair, | |
| 2047 | + (ck_session_handle_t session, | |
| 2048 | + struct ck_mechanism *mechanism, | |
| 2049 | + struct ck_attribute *public_key_template, | |
| 2050 | + unsigned long public_key_attribute_count, | |
| 2051 | + struct ck_attribute *private_key_template, | |
| 2052 | + unsigned long private_key_attribute_count, | |
| 2053 | + ck_object_handle_t *public_key, | |
| 2054 | + ck_object_handle_t *private_key)); | |
| 2055 | +_CK_DECLARE_FUNCTION (C_WrapKey, | |
| 2056 | + (ck_session_handle_t session, | |
| 2057 | + struct ck_mechanism *mechanism, | |
| 2058 | + ck_object_handle_t wrapping_key, | |
| 2059 | + ck_object_handle_t key, | |
| 2060 | + unsigned char *wrapped_key, | |
| 2061 | + unsigned long *wrapped_key_len)); | |
| 2062 | +_CK_DECLARE_FUNCTION (C_UnwrapKey, | |
| 2063 | + (ck_session_handle_t session, | |
| 2064 | + struct ck_mechanism *mechanism, | |
| 2065 | + ck_object_handle_t unwrapping_key, | |
| 2066 | + unsigned char *wrapped_key, | |
| 2067 | + unsigned long wrapped_key_len, | |
| 2068 | + struct ck_attribute *templ, | |
| 2069 | + unsigned long attribute_count, | |
| 2070 | + ck_object_handle_t *key)); | |
| 2071 | +_CK_DECLARE_FUNCTION (C_DeriveKey, | |
| 2072 | + (ck_session_handle_t session, | |
| 2073 | + struct ck_mechanism *mechanism, | |
| 2074 | + ck_object_handle_t base_key, | |
| 2075 | + struct ck_attribute *templ, | |
| 2076 | + unsigned long attribute_count, | |
| 2077 | + ck_object_handle_t *key)); | |
| 2078 | + | |
| 2079 | +_CK_DECLARE_FUNCTION (C_SeedRandom, | |
| 2080 | + (ck_session_handle_t session, unsigned char *seed, | |
| 2081 | + unsigned long seed_len)); | |
| 2082 | +_CK_DECLARE_FUNCTION (C_GenerateRandom, | |
| 2083 | + (ck_session_handle_t session, | |
| 2084 | + unsigned char *random_data, | |
| 2085 | + unsigned long random_len)); | |
| 2086 | + | |
| 2087 | +_CK_DECLARE_FUNCTION (C_GetFunctionStatus, (ck_session_handle_t session)); | |
| 2088 | +_CK_DECLARE_FUNCTION (C_CancelFunction, (ck_session_handle_t session)); | |
| 2089 | + | |
| 2090 | + | |
| 2091 | +struct ck_function_list | |
| 2092 | +{ | |
| 2093 | + struct ck_version version; | |
| 2094 | + CK_C_Initialize C_Initialize; | |
| 2095 | + CK_C_Finalize C_Finalize; | |
| 2096 | + CK_C_GetInfo C_GetInfo; | |
| 2097 | + CK_C_GetFunctionList C_GetFunctionList; | |
| 2098 | + CK_C_GetSlotList C_GetSlotList; | |
| 2099 | + CK_C_GetSlotInfo C_GetSlotInfo; | |
| 2100 | + CK_C_GetTokenInfo C_GetTokenInfo; | |
| 2101 | + CK_C_GetMechanismList C_GetMechanismList; | |
| 2102 | + CK_C_GetMechanismInfo C_GetMechanismInfo; | |
| 2103 | + CK_C_InitToken C_InitToken; | |
| 2104 | + CK_C_InitPIN C_InitPIN; | |
| 2105 | + CK_C_SetPIN C_SetPIN; | |
| 2106 | + CK_C_OpenSession C_OpenSession; | |
| 2107 | + CK_C_CloseSession C_CloseSession; | |
| 2108 | + CK_C_CloseAllSessions C_CloseAllSessions; | |
| 2109 | + CK_C_GetSessionInfo C_GetSessionInfo; | |
| 2110 | + CK_C_GetOperationState C_GetOperationState; | |
| 2111 | + CK_C_SetOperationState C_SetOperationState; | |
| 2112 | + CK_C_Login C_Login; | |
| 2113 | + CK_C_Logout C_Logout; | |
| 2114 | + CK_C_CreateObject C_CreateObject; | |
| 2115 | + CK_C_CopyObject C_CopyObject; | |
| 2116 | + CK_C_DestroyObject C_DestroyObject; | |
| 2117 | + CK_C_GetObjectSize C_GetObjectSize; | |
| 2118 | + CK_C_GetAttributeValue C_GetAttributeValue; | |
| 2119 | + CK_C_SetAttributeValue C_SetAttributeValue; | |
| 2120 | + CK_C_FindObjectsInit C_FindObjectsInit; | |
| 2121 | + CK_C_FindObjects C_FindObjects; | |
| 2122 | + CK_C_FindObjectsFinal C_FindObjectsFinal; | |
| 2123 | + CK_C_EncryptInit C_EncryptInit; | |
| 2124 | + CK_C_Encrypt C_Encrypt; | |
| 2125 | + CK_C_EncryptUpdate C_EncryptUpdate; | |
| 2126 | + CK_C_EncryptFinal C_EncryptFinal; | |
| 2127 | + CK_C_DecryptInit C_DecryptInit; | |
| 2128 | + CK_C_Decrypt C_Decrypt; | |
| 2129 | + CK_C_DecryptUpdate C_DecryptUpdate; | |
| 2130 | + CK_C_DecryptFinal C_DecryptFinal; | |
| 2131 | + CK_C_DigestInit C_DigestInit; | |
| 2132 | + CK_C_Digest C_Digest; | |
| 2133 | + CK_C_DigestUpdate C_DigestUpdate; | |
| 2134 | + CK_C_DigestKey C_DigestKey; | |
| 2135 | + CK_C_DigestFinal C_DigestFinal; | |
| 2136 | + CK_C_SignInit C_SignInit; | |
| 2137 | + CK_C_Sign C_Sign; | |
| 2138 | + CK_C_SignUpdate C_SignUpdate; | |
| 2139 | + CK_C_SignFinal C_SignFinal; | |
| 2140 | + CK_C_SignRecoverInit C_SignRecoverInit; | |
| 2141 | + CK_C_SignRecover C_SignRecover; | |
| 2142 | + CK_C_VerifyInit C_VerifyInit; | |
| 2143 | + CK_C_Verify C_Verify; | |
| 2144 | + CK_C_VerifyUpdate C_VerifyUpdate; | |
| 2145 | + CK_C_VerifyFinal C_VerifyFinal; | |
| 2146 | + CK_C_VerifyRecoverInit C_VerifyRecoverInit; | |
| 2147 | + CK_C_VerifyRecover C_VerifyRecover; | |
| 2148 | + CK_C_DigestEncryptUpdate C_DigestEncryptUpdate; | |
| 2149 | + CK_C_DecryptDigestUpdate C_DecryptDigestUpdate; | |
| 2150 | + CK_C_SignEncryptUpdate C_SignEncryptUpdate; | |
| 2151 | + CK_C_DecryptVerifyUpdate C_DecryptVerifyUpdate; | |
| 2152 | + CK_C_GenerateKey C_GenerateKey; | |
| 2153 | + CK_C_GenerateKeyPair C_GenerateKeyPair; | |
| 2154 | + CK_C_WrapKey C_WrapKey; | |
| 2155 | + CK_C_UnwrapKey C_UnwrapKey; | |
| 2156 | + CK_C_DeriveKey C_DeriveKey; | |
| 2157 | + CK_C_SeedRandom C_SeedRandom; | |
| 2158 | + CK_C_GenerateRandom C_GenerateRandom; | |
| 2159 | + CK_C_GetFunctionStatus C_GetFunctionStatus; | |
| 2160 | + CK_C_CancelFunction C_CancelFunction; | |
| 2161 | + CK_C_WaitForSlotEvent C_WaitForSlotEvent; | |
| 2162 | +}; | |
| 2163 | + | |
| 2164 | + | |
| 2165 | +typedef ck_rv_t (*ck_createmutex_t) (void **mutex); | |
| 2166 | +typedef ck_rv_t (*ck_destroymutex_t) (void *mutex); | |
| 2167 | +typedef ck_rv_t (*ck_lockmutex_t) (void *mutex); | |
| 2168 | +typedef ck_rv_t (*ck_unlockmutex_t) (void *mutex); | |
| 2169 | + | |
| 2170 | + | |
| 2171 | +struct ck_c_initialize_args | |
| 2172 | +{ | |
| 2173 | + ck_createmutex_t create_mutex; | |
| 2174 | + ck_destroymutex_t destroy_mutex; | |
| 2175 | + ck_lockmutex_t lock_mutex; | |
| 2176 | + ck_unlockmutex_t unlock_mutex; | |
| 2177 | + ck_flags_t flags; | |
| 2178 | + void *reserved; | |
| 2179 | +}; | |
| 2180 | + | |
| 2181 | + | |
| 2182 | +#define CKF_LIBRARY_CANT_CREATE_OS_THREADS (1 << 0) | |
| 2183 | +#define CKF_OS_LOCKING_OK (1 << 1) | |
| 2184 | + | |
| 2185 | +#define CKR_OK (0) | |
| 2186 | +#define CKR_CANCEL (1) | |
| 2187 | +#define CKR_HOST_MEMORY (2) | |
| 2188 | +#define CKR_SLOT_ID_INVALID (3) | |
| 2189 | +#define CKR_GENERAL_ERROR (5) | |
| 2190 | +#define CKR_FUNCTION_FAILED (6) | |
| 2191 | +#define CKR_ARGUMENTS_BAD (7) | |
| 2192 | +#define CKR_NO_EVENT (8) | |
| 2193 | +#define CKR_NEED_TO_CREATE_THREADS (9) | |
| 2194 | +#define CKR_CANT_LOCK (0xa) | |
| 2195 | +#define CKR_ATTRIBUTE_READ_ONLY (0x10) | |
| 2196 | +#define CKR_ATTRIBUTE_SENSITIVE (0x11) | |
| 2197 | +#define CKR_ATTRIBUTE_TYPE_INVALID (0x12) | |
| 2198 | +#define CKR_ATTRIBUTE_VALUE_INVALID (0x13) | |
| 2199 | +#define CKR_DATA_INVALID (0x20) | |
| 2200 | +#define CKR_DATA_LEN_RANGE (0x21) | |
| 2201 | +#define CKR_DEVICE_ERROR (0x30) | |
| 2202 | +#define CKR_DEVICE_MEMORY (0x31) | |
| 2203 | +#define CKR_DEVICE_REMOVED (0x32) | |
| 2204 | +#define CKR_ENCRYPTED_DATA_INVALID (0x40) | |
| 2205 | +#define CKR_ENCRYPTED_DATA_LEN_RANGE (0x41) | |
| 2206 | +#define CKR_FUNCTION_CANCELED (0x50) | |
| 2207 | +#define CKR_FUNCTION_NOT_PARALLEL (0x51) | |
| 2208 | +#define CKR_FUNCTION_NOT_SUPPORTED (0x54) | |
| 2209 | +#define CKR_KEY_HANDLE_INVALID (0x60) | |
| 2210 | +#define CKR_KEY_SIZE_RANGE (0x62) | |
| 2211 | +#define CKR_KEY_TYPE_INCONSISTENT (0x63) | |
| 2212 | +#define CKR_KEY_NOT_NEEDED (0x64) | |
| 2213 | +#define CKR_KEY_CHANGED (0x65) | |
| 2214 | +#define CKR_KEY_NEEDED (0x66) | |
| 2215 | +#define CKR_KEY_INDIGESTIBLE (0x67) | |
| 2216 | +#define CKR_KEY_FUNCTION_NOT_PERMITTED (0x68) | |
| 2217 | +#define CKR_KEY_NOT_WRAPPABLE (0x69) | |
| 2218 | +#define CKR_KEY_UNEXTRACTABLE (0x6a) | |
| 2219 | +#define CKR_MECHANISM_INVALID (0x70) | |
| 2220 | +#define CKR_MECHANISM_PARAM_INVALID (0x71) | |
| 2221 | +#define CKR_OBJECT_HANDLE_INVALID (0x82) | |
| 2222 | +#define CKR_OPERATION_ACTIVE (0x90) | |
| 2223 | +#define CKR_OPERATION_NOT_INITIALIZED (0x91) | |
| 2224 | +#define CKR_PIN_INCORRECT (0xa0) | |
| 2225 | +#define CKR_PIN_INVALID (0xa1) | |
| 2226 | +#define CKR_PIN_LEN_RANGE (0xa2) | |
| 2227 | +#define CKR_PIN_EXPIRED (0xa3) | |
| 2228 | +#define CKR_PIN_LOCKED (0xa4) | |
| 2229 | +#define CKR_SESSION_CLOSED (0xb0) | |
| 2230 | +#define CKR_SESSION_COUNT (0xb1) | |
| 2231 | +#define CKR_SESSION_HANDLE_INVALID (0xb3) | |
| 2232 | +#define CKR_SESSION_PARALLEL_NOT_SUPPORTED (0xb4) | |
| 2233 | +#define CKR_SESSION_READ_ONLY (0xb5) | |
| 2234 | +#define CKR_SESSION_EXISTS (0xb6) | |
| 2235 | +#define CKR_SESSION_READ_ONLY_EXISTS (0xb7) | |
| 2236 | +#define CKR_SESSION_READ_WRITE_SO_EXISTS (0xb8) | |
| 2237 | +#define CKR_SIGNATURE_INVALID (0xc0) | |
| 2238 | +#define CKR_SIGNATURE_LEN_RANGE (0xc1) | |
| 2239 | +#define CKR_TEMPLATE_INCOMPLETE (0xd0) | |
| 2240 | +#define CKR_TEMPLATE_INCONSISTENT (0xd1) | |
| 2241 | +#define CKR_TOKEN_NOT_PRESENT (0xe0) | |
| 2242 | +#define CKR_TOKEN_NOT_RECOGNIZED (0xe1) | |
| 2243 | +#define CKR_TOKEN_WRITE_PROTECTED (0xe2) | |
| 2244 | +#define CKR_UNWRAPPING_KEY_HANDLE_INVALID (0xf0) | |
| 2245 | +#define CKR_UNWRAPPING_KEY_SIZE_RANGE (0xf1) | |
| 2246 | +#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT (0xf2) | |
| 2247 | +#define CKR_USER_ALREADY_LOGGED_IN (0x100) | |
| 2248 | +#define CKR_USER_NOT_LOGGED_IN (0x101) | |
| 2249 | +#define CKR_USER_PIN_NOT_INITIALIZED (0x102) | |
| 2250 | +#define CKR_USER_TYPE_INVALID (0x103) | |
| 2251 | +#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN (0x104) | |
| 2252 | +#define CKR_USER_TOO_MANY_TYPES (0x105) | |
| 2253 | +#define CKR_WRAPPED_KEY_INVALID (0x110) | |
| 2254 | +#define CKR_WRAPPED_KEY_LEN_RANGE (0x112) | |
| 2255 | +#define CKR_WRAPPING_KEY_HANDLE_INVALID (0x113) | |
| 2256 | +#define CKR_WRAPPING_KEY_SIZE_RANGE (0x114) | |
| 2257 | +#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT (0x115) | |
| 2258 | +#define CKR_RANDOM_SEED_NOT_SUPPORTED (0x120) | |
| 2259 | +#define CKR_RANDOM_NO_RNG (0x121) | |
| 2260 | +#define CKR_DOMAIN_PARAMS_INVALID (0x130) | |
| 2261 | +#define CKR_BUFFER_TOO_SMALL (0x150) | |
| 2262 | +#define CKR_SAVED_STATE_INVALID (0x160) | |
| 2263 | +#define CKR_INFORMATION_SENSITIVE (0x170) | |
| 2264 | +#define CKR_STATE_UNSAVEABLE (0x180) | |
| 2265 | +#define CKR_CRYPTOKI_NOT_INITIALIZED (0x190) | |
| 2266 | +#define CKR_CRYPTOKI_ALREADY_INITIALIZED (0x191) | |
| 2267 | +#define CKR_MUTEX_BAD (0x1a0) | |
| 2268 | +#define CKR_MUTEX_NOT_LOCKED (0x1a1) | |
| 2269 | +#define CKR_FUNCTION_REJECTED (0x200) | |
| 2270 | +#define CKR_VENDOR_DEFINED ((unsigned long) (1 << 31)) | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | +/* Compatibility layer. */ | |
| 2275 | + | |
| 2276 | +#ifdef CRYPTOKI_COMPAT | |
| 2277 | + | |
| 2278 | +#undef CK_DEFINE_FUNCTION | |
| 2279 | +#define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name | |
| 2280 | + | |
| 2281 | +/* For NULL. */ | |
| 2282 | +#include <stddef.h> | |
| 2283 | + | |
| 2284 | +typedef unsigned char CK_BYTE; | |
| 2285 | +typedef unsigned char CK_CHAR; | |
| 2286 | +typedef unsigned char CK_UTF8CHAR; | |
| 2287 | +typedef unsigned char CK_BBOOL; | |
| 2288 | +typedef unsigned long int CK_ULONG; | |
| 2289 | +typedef long int CK_LONG; | |
| 2290 | +typedef CK_BYTE *CK_BYTE_PTR; | |
| 2291 | +typedef CK_CHAR *CK_CHAR_PTR; | |
| 2292 | +typedef CK_UTF8CHAR *CK_UTF8CHAR_PTR; | |
| 2293 | +typedef CK_ULONG *CK_ULONG_PTR; | |
| 2294 | +typedef void *CK_VOID_PTR; | |
| 2295 | +typedef void **CK_VOID_PTR_PTR; | |
| 2296 | +#define CK_FALSE 0 | |
| 2297 | +#define CK_TRUE 1 | |
| 2298 | +#ifndef CK_DISABLE_TRUE_FALSE | |
| 2299 | +#ifndef FALSE | |
| 2300 | +#define FALSE 0 | |
| 2301 | +#endif | |
| 2302 | +#ifndef TRUE | |
| 2303 | +#define TRUE 1 | |
| 2304 | +#endif | |
| 2305 | +#endif | |
| 2306 | + | |
| 2307 | +typedef struct ck_version CK_VERSION; | |
| 2308 | +typedef struct ck_version *CK_VERSION_PTR; | |
| 2309 | + | |
| 2310 | +typedef struct ck_info CK_INFO; | |
| 2311 | +typedef struct ck_info *CK_INFO_PTR; | |
| 2312 | + | |
| 2313 | +typedef ck_slot_id_t *CK_SLOT_ID_PTR; | |
| 2314 | + | |
| 2315 | +typedef struct ck_slot_info CK_SLOT_INFO; | |
| 2316 | +typedef struct ck_slot_info *CK_SLOT_INFO_PTR; | |
| 2317 | + | |
| 2318 | +typedef struct ck_token_info CK_TOKEN_INFO; | |
| 2319 | +typedef struct ck_token_info *CK_TOKEN_INFO_PTR; | |
| 2320 | + | |
| 2321 | +typedef ck_session_handle_t *CK_SESSION_HANDLE_PTR; | |
| 2322 | + | |
| 2323 | +typedef struct ck_session_info CK_SESSION_INFO; | |
| 2324 | +typedef struct ck_session_info *CK_SESSION_INFO_PTR; | |
| 2325 | + | |
| 2326 | +typedef ck_object_handle_t *CK_OBJECT_HANDLE_PTR; | |
| 2327 | + | |
| 2328 | +typedef ck_object_class_t *CK_OBJECT_CLASS_PTR; | |
| 2329 | + | |
| 2330 | +typedef struct ck_attribute CK_ATTRIBUTE; | |
| 2331 | +typedef struct ck_attribute *CK_ATTRIBUTE_PTR; | |
| 2332 | + | |
| 2333 | +typedef struct ck_date CK_DATE; | |
| 2334 | +typedef struct ck_date *CK_DATE_PTR; | |
| 2335 | + | |
| 2336 | +typedef ck_mechanism_type_t *CK_MECHANISM_TYPE_PTR; | |
| 2337 | + | |
| 2338 | +typedef struct ck_mechanism CK_MECHANISM; | |
| 2339 | +typedef struct ck_mechanism *CK_MECHANISM_PTR; | |
| 2340 | + | |
| 2341 | +typedef struct ck_mechanism_info CK_MECHANISM_INFO; | |
| 2342 | +typedef struct ck_mechanism_info *CK_MECHANISM_INFO_PTR; | |
| 2343 | + | |
| 2344 | +typedef struct ck_function_list CK_FUNCTION_LIST; | |
| 2345 | +typedef struct ck_function_list *CK_FUNCTION_LIST_PTR; | |
| 2346 | +typedef struct ck_function_list **CK_FUNCTION_LIST_PTR_PTR; | |
| 2347 | + | |
| 2348 | +typedef struct ck_c_initialize_args CK_C_INITIALIZE_ARGS; | |
| 2349 | +typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR; | |
| 2350 | + | |
| 2351 | +#define NULL_PTR NULL | |
| 2352 | + | |
| 2353 | +/* Delete the helper macros defined at the top of the file. */ | |
| 2354 | +#undef ck_flags_t | |
| 2355 | +#undef ck_version | |
| 2356 | + | |
| 2357 | +#undef ck_info | |
| 2358 | +#undef cryptoki_version | |
| 2359 | +#undef manufacturer_id | |
| 2360 | +#undef library_description | |
| 2361 | +#undef library_version | |
| 2362 | + | |
| 2363 | +#undef ck_notification_t | |
| 2364 | +#undef ck_slot_id_t | |
| 2365 | + | |
| 2366 | +#undef ck_slot_info | |
| 2367 | +#undef slot_description | |
| 2368 | +#undef hardware_version | |
| 2369 | +#undef firmware_version | |
| 2370 | + | |
| 2371 | +#undef ck_token_info | |
| 2372 | +#undef serial_number | |
| 2373 | +#undef max_session_count | |
| 2374 | +#undef session_count | |
| 2375 | +#undef max_rw_session_count | |
| 2376 | +#undef rw_session_count | |
| 2377 | +#undef max_pin_len | |
| 2378 | +#undef min_pin_len | |
| 2379 | +#undef total_public_memory | |
| 2380 | +#undef free_public_memory | |
| 2381 | +#undef total_private_memory | |
| 2382 | +#undef free_private_memory | |
| 2383 | +#undef utc_time | |
| 2384 | + | |
| 2385 | +#undef ck_session_handle_t | |
| 2386 | +#undef ck_user_type_t | |
| 2387 | +#undef ck_state_t | |
| 2388 | + | |
| 2389 | +#undef ck_session_info | |
| 2390 | +#undef slot_id | |
| 2391 | +#undef device_error | |
| 2392 | + | |
| 2393 | +#undef ck_object_handle_t | |
| 2394 | +#undef ck_object_class_t | |
| 2395 | +#undef ck_hw_feature_type_t | |
| 2396 | +#undef ck_key_type_t | |
| 2397 | +#undef ck_certificate_type_t | |
| 2398 | +#undef ck_attribute_type_t | |
| 2399 | + | |
| 2400 | +#undef ck_attribute | |
| 2401 | +#undef value | |
| 2402 | +#undef value_len | |
| 2403 | + | |
| 2404 | +#undef ck_date | |
| 2405 | + | |
| 2406 | +#undef ck_mechanism_type_t | |
| 2407 | + | |
| 2408 | +#undef ck_mechanism | |
| 2409 | +#undef parameter | |
| 2410 | +#undef parameter_len | |
| 2411 | + | |
| 2412 | +#undef ck_mechanism_info | |
| 2413 | +#undef min_key_size | |
| 2414 | +#undef max_key_size | |
| 2415 | + | |
| 2416 | +#undef ck_rv_t | |
| 2417 | +#undef ck_notify_t | |
| 2418 | + | |
| 2419 | +#undef ck_function_list | |
| 2420 | + | |
| 2421 | +#undef ck_createmutex_t | |
| 2422 | +#undef ck_destroymutex_t | |
| 2423 | +#undef ck_lockmutex_t | |
| 2424 | +#undef ck_unlockmutex_t | |
| 2425 | + | |
| 2426 | +#undef ck_c_initialize_args | |
| 2427 | +#undef create_mutex | |
| 2428 | +#undef destroy_mutex | |
| 2429 | +#undef lock_mutex | |
| 2430 | +#undef unlock_mutex | |
| 2431 | +#undef reserved | |
| 2432 | + | |
| 2433 | +#endif /* CRYPTOKI_COMPAT */ | |
| 2434 | + | |
| 2435 | + | |
| 2436 | +/* System dependencies. */ | |
| 2437 | +#if defined(_WIN32) || defined(CRYPTOKI_FORCE_WIN32) | |
| 1164 | 2438 | +#pragma pack(pop, cryptoki) |
| 1165 | 2439 | +#endif |
| 2440 | + | |
| 2441 | +#if defined(__cplusplus) | |
| 2442 | +} | |
| 2443 | +#endif | |
| 2444 | + | |
| 2445 | +#endif /* PKCS11_H */ | |
| 2446 | diff -urNp putty-0.58.org/ppkcs11.h putty-0.58+smartcard/ppkcs11.h | |
| 2447 | --- putty-0.58.org/ppkcs11.h 1970-01-01 02:00:00.000000000 +0200 | |
| 2448 | +++ putty-0.58+smartcard/ppkcs11.h 2008-03-15 20:31:43.000000000 +0200 | |
| 2449 | @@ -0,0 +1,20 @@ | |
| 2450 | +#ifndef __PPKCS11_H | |
| 2451 | +#define __PPKCS11_H | |
| 2452 | + | |
| 2453 | +#include "pkcs11.h" | |
| 1166 | 2454 | + |
| 1167 | 2455 | +#ifdef __cplusplus |
| … | … | |
| 1180 | 2468 | + |
| 1181 | 2469 | +#endif |
| 1182 | diff -u |
|
| 1183 | --- putty-0.58.or |
|
| 1184 | +++ putty-0.58 |
|
| 1185 | @@ -431,6 +431,9 @@ |
|
| 2470 | diff -urNp putty-0.58.org/putty.h putty-0.58+smartcard/putty.h | |
| 2471 | --- putty-0.58.org/putty.h 2005-04-05 22:37:51.000000000 +0300 | |
| 2472 | +++ putty-0.58+smartcard/putty.h 2005-06-06 12:50:58.000000000 +0300 | |
| 2473 | @@ -431,6 +431,9 @@ struct config_tag { | |
| 1186 | 2474 | int ssh2_des_cbc; /* "des-cbc" unrecommended SSH-2 cipher */ |
| 1187 | 2475 | int try_tis_auth; |
| … | … | |
| 1193 | 2481 | int ssh_subsys2; /* fallback to go with remote_cmd2 */ |
| 1194 | 2482 | int ssh_no_shell; /* avoid running a shell */ |
| 1195 | @@ -532,6 +535,9 @@ |
|
| 2483 | @@ -532,6 +535,9 @@ struct config_tag { | |
| 1196 | 2484 | int x11_forward; |
| 1197 | 2485 | char x11_display[128]; |
| … | … | |
| 1203 | 2491 | int lport_acceptall; /* accept conns from hosts other than localhost */ |
| 1204 | 2492 | int rport_acceptall; /* same for remote forwarded ports (SSH-2 only) */ |
| 1205 | diff -udrNP putty-0.58.orig/rsaref/pkcs11.h putty-0.58/rsaref/pkcs11.h | |
| 1206 | --- putty-0.58.orig/rsaref/pkcs11.h 1970-01-01 01:00:00.000000000 +0100 | |
| 1207 | +++ putty-0.58/rsaref/pkcs11.h 2005-06-06 11:50:58.480735208 +0200 | |
| 1208 | @@ -0,0 +1,286 @@ | |
| 1209 | +/* pkcs11.h include file for PKCS #11. 2001 June 25 */ | |
| 1210 | + | |
| 1211 | +#ifndef _PKCS11_H_ | |
| 1212 | +#define _PKCS11_H_ 1 | |
| 1213 | + | |
| 1214 | +#ifdef __cplusplus | |
| 1215 | +extern "C" { | |
| 1216 | +#endif | |
| 1217 | + | |
| 1218 | +/* Before including this file (pkcs11.h) (or pkcs11t.h by | |
| 1219 | + * itself), 6 platform-specific macros must be defined. These | |
| 1220 | + * macros are described below, and typical definitions for them | |
| 1221 | + * are also given. Be advised that these definitions can depend | |
| 1222 | + * on both the platform and the compiler used (and possibly also | |
| 1223 | + * on whether a Cryptoki library is linked statically or | |
| 1224 | + * dynamically). | |
| 1225 | + * | |
| 1226 | + * In addition to defining these 6 macros, the packing convention | |
| 1227 | + * for Cryptoki structures should be set. The Cryptoki | |
| 1228 | + * convention on packing is that structures should be 1-byte | |
| 1229 | + * aligned. | |
| 1230 | + * | |
| 1231 | + * If you're using Microsoft Developer Studio 5.0 to produce | |
| 1232 | + * Win32 stuff, this might be done by using the following | |
| 1233 | + * preprocessor directive before including pkcs11.h or pkcs11t.h: | |
| 1234 | + * | |
| 1235 | + * #pragma pack(push, cryptoki, 1) | |
| 1236 | + * | |
| 1237 | + * and using the following preprocessor directive after including | |
| 1238 | + * pkcs11.h or pkcs11t.h: | |
| 1239 | + * | |
| 1240 | + * #pragma pack(pop, cryptoki) | |
| 1241 | + * | |
| 1242 | + * If you're using an earlier version of Microsoft Developer | |
| 1243 | + * Studio to produce Win16 stuff, this might be done by using | |
| 1244 | + * the following preprocessor directive before including | |
| 1245 | + * pkcs11.h or pkcs11t.h: | |
| 1246 | + * | |
| 1247 | + * #pragma pack(1) | |
| 1248 | + * | |
| 1249 | + * In a UNIX environment, you're on your own for this. You might | |
| 1250 | + * not need to do (or be able to do!) anything. | |
| 1251 | + * | |
| 1252 | + * | |
| 1253 | + * Now for the macros: | |
| 1254 | + * | |
| 1255 | + * | |
| 1256 | + * 1. CK_PTR: The indirection string for making a pointer to an | |
| 1257 | + * object. It can be used like this: | |
| 1258 | + * | |
| 1259 | + * typedef CK_BYTE CK_PTR CK_BYTE_PTR; | |
| 1260 | + * | |
| 1261 | + * If you're using Microsoft Developer Studio 5.0 to produce | |
| 1262 | + * Win32 stuff, it might be defined by: | |
| 1263 | + * | |
| 1264 | + * #define CK_PTR * | |
| 1265 | + * | |
| 1266 | + * If you're using an earlier version of Microsoft Developer | |
| 1267 | + * Studio to produce Win16 stuff, it might be defined by: | |
| 1268 | + * | |
| 1269 | + * #define CK_PTR far * | |
| 1270 | + * | |
| 1271 | + * In a typical UNIX environment, it might be defined by: | |
| 1272 | + * | |
| 1273 | + * #define CK_PTR * | |
| 1274 | + * | |
| 1275 | + * | |
| 1276 | + * 2. CK_DEFINE_FUNCTION(returnType, name): A macro which makes | |
| 1277 | + * an exportable Cryptoki library function definition out of a | |
| 1278 | + * return type and a function name. It should be used in the | |
| 1279 | + * following fashion to define the exposed Cryptoki functions in | |
| 1280 | + * a Cryptoki library: | |
| 1281 | + * | |
| 1282 | + * CK_DEFINE_FUNCTION(CK_RV, C_Initialize)( | |
| 1283 | + * CK_VOID_PTR pReserved | |
| 1284 | + * ) | |
| 1285 | + * { | |
| 1286 | + * ... | |
| 1287 | + * } | |
| 1288 | + * | |
| 1289 | + * If you're using Microsoft Developer Studio 5.0 to define a | |
| 1290 | + * function in a Win32 Cryptoki .dll, it might be defined by: | |
| 1291 | + * | |
| 1292 | + * #define CK_DEFINE_FUNCTION(returnType, name) \ | |
| 1293 | + * returnType __declspec(dllexport) name | |
| 1294 | + * | |
| 1295 | + * If you're using an earlier version of Microsoft Developer | |
| 1296 | + * Studio to define a function in a Win16 Cryptoki .dll, it | |
| 1297 | + * might be defined by: | |
| 1298 | + * | |
| 1299 | + * #define CK_DEFINE_FUNCTION(returnType, name) \ | |
| 1300 | + * returnType __export _far _pascal name | |
| 1301 | + * | |
| 1302 | + * In a UNIX environment, it might be defined by: | |
| 1303 | + * | |
| 1304 | + * #define CK_DEFINE_FUNCTION(returnType, name) \ | |
| 1305 | + * returnType name | |
| 1306 | + * | |
| 1307 | + * | |
| 1308 | + * 3. CK_DECLARE_FUNCTION(returnType, name): A macro which makes | |
| 1309 | + * an importable Cryptoki library function declaration out of a | |
| 1310 | + * return type and a function name. It should be used in the | |
| 1311 | + * following fashion: | |
| 1312 | + * | |
| 1313 | + * extern CK_DECLARE_FUNCTION(CK_RV, C_Initialize)( | |
| 1314 | + * CK_VOID_PTR pReserved | |
| 1315 | + * ); | |
| 1316 | + * | |
| 1317 | + * If you're using Microsoft Developer Studio 5.0 to declare a | |
| 1318 | + * function in a Win32 Cryptoki .dll, it might be defined by: | |
| 1319 | + * | |
| 1320 | + * #define CK_DECLARE_FUNCTION(returnType, name) \ | |
| 1321 | + * returnType __declspec(dllimport) name | |
| 1322 | + * | |
| 1323 | + * If you're using an earlier version of Microsoft Developer | |
| 1324 | + * Studio to declare a function in a Win16 Cryptoki .dll, it | |
| 1325 | + * might be defined by: | |
| 1326 | + * | |
| 1327 | + * #define CK_DECLARE_FUNCTION(returnType, name) \ | |
| 1328 | + * returnType __export _far _pascal name | |
| 1329 | + * | |
| 1330 | + * In a UNIX environment, it might be defined by: | |
| 1331 | + * | |
| 1332 | + * #define CK_DECLARE_FUNCTION(returnType, name) \ | |
| 1333 | + * returnType name | |
| 1334 | + * | |
| 1335 | + * | |
| 1336 | + * 4. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro | |
| 1337 | + * which makes a Cryptoki API function pointer declaration or | |
| 1338 | + * function pointer type declaration out of a return type and a | |
| 1339 | + * function name. It should be used in the following fashion: | |
| 1340 | + * | |
| 1341 | + * // Define funcPtr to be a pointer to a Cryptoki API function | |
| 1342 | + * // taking arguments args and returning CK_RV. | |
| 1343 | + * CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtr)(args); | |
| 1344 | + * | |
| 1345 | + * or | |
| 1346 | + * | |
| 1347 | + * // Define funcPtrType to be the type of a pointer to a | |
| 1348 | + * // Cryptoki API function taking arguments args and returning | |
| 1349 | + * // CK_RV, and then define funcPtr to be a variable of type | |
| 1350 | + * // funcPtrType. | |
| 1351 | + * typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, funcPtrType)(args); | |
| 1352 | + * funcPtrType funcPtr; | |
| 1353 | + * | |
| 1354 | + * If you're using Microsoft Developer Studio 5.0 to access | |
| 1355 | + * functions in a Win32 Cryptoki .dll, in might be defined by: | |
| 1356 | + * | |
| 1357 | + * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ | |
| 1358 | + * returnType __declspec(dllimport) (* name) | |
| 1359 | + * | |
| 1360 | + * If you're using an earlier version of Microsoft Developer | |
| 1361 | + * Studio to access functions in a Win16 Cryptoki .dll, it might | |
| 1362 | + * be defined by: | |
| 1363 | + * | |
| 1364 | + * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ | |
| 1365 | + * returnType __export _far _pascal (* name) | |
| 1366 | + * | |
| 1367 | + * In a UNIX environment, it might be defined by: | |
| 1368 | + * | |
| 1369 | + * #define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ | |
| 1370 | + * returnType (* name) | |
| 1371 | + * | |
| 1372 | + * | |
| 1373 | + * 5. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes | |
| 1374 | + * a function pointer type for an application callback out of | |
| 1375 | + * a return type for the callback and a name for the callback. | |
| 1376 | + * It should be used in the following fashion: | |
| 1377 | + * | |
| 1378 | + * CK_CALLBACK_FUNCTION(CK_RV, myCallback)(args); | |
| 1379 | + * | |
| 1380 | + * to declare a function pointer, myCallback, to a callback | |
| 1381 | + * which takes arguments args and returns a CK_RV. It can also | |
| 1382 | + * be used like this: | |
| 1383 | + * | |
| 1384 | + * typedef CK_CALLBACK_FUNCTION(CK_RV, myCallbackType)(args); | |
| 1385 | + * myCallbackType myCallback; | |
| 1386 | + * | |
| 1387 | + * If you're using Microsoft Developer Studio 5.0 to do Win32 | |
| 1388 | + * Cryptoki development, it might be defined by: | |
| 1389 | + * | |
| 1390 | + * #define CK_CALLBACK_FUNCTION(returnType, name) \ | |
| 1391 | + * returnType (* name) | |
| 1392 | + * | |
| 1393 | + * If you're using an earlier version of Microsoft Developer | |
| 1394 | + * Studio to do Win16 development, it might be defined by: | |
| 1395 | + * | |
| 1396 | + * #define CK_CALLBACK_FUNCTION(returnType, name) \ | |
| 1397 | + * returnType _far _pascal (* name) | |
| 1398 | + * | |
| 1399 | + * In a UNIX environment, it might be defined by: | |
| 1400 | + * | |
| 1401 | + * #define CK_CALLBACK_FUNCTION(returnType, name) \ | |
| 1402 | + * returnType (* name) | |
| 1403 | + * | |
| 1404 | + * | |
| 1405 | + * 6. NULL_PTR: This macro is the value of a NULL pointer. | |
| 1406 | + * | |
| 1407 | + * In any ANSI/ISO C environment (and in many others as well), | |
| 1408 | + * this should best be defined by | |
| 1409 | + * | |
| 1410 | + * #ifndef NULL_PTR | |
| 1411 | + * #define NULL_PTR 0 | |
| 1412 | + * #endif | |
| 1413 | + */ | |
| 1414 | + | |
| 1415 | +#if 0 | |
| 1416 | +#include "rsaref/unix.h" | |
| 1417 | +#endif | |
| 1418 | + | |
| 1419 | +/* All the various Cryptoki types and #define'd values are in the | |
| 1420 | + * file pkcs11t.h. */ | |
| 1421 | +#include "rsaref/pkcs11t.h" | |
| 1422 | + | |
| 1423 | +#define __PASTE(x,y) x##y | |
| 1424 | + | |
| 1425 | + | |
| 1426 | +/* ============================================================== | |
| 1427 | + * Define the "extern" form of all the entry points. | |
| 1428 | + * ============================================================== | |
| 1429 | + */ | |
| 1430 | + | |
| 1431 | +#define CK_NEED_ARG_LIST 1 | |
| 1432 | +#define CK_PKCS11_FUNCTION_INFO(name) \ | |
| 1433 | + extern CK_DECLARE_FUNCTION(CK_RV, name) | |
| 1434 | + | |
| 1435 | +/* pkcs11f.h has all the information about the Cryptoki | |
| 1436 | + * function prototypes. */ | |
| 1437 | +#include "rsaref/pkcs11f.h" | |
| 1438 | + | |
| 1439 | +#undef CK_NEED_ARG_LIST | |
| 1440 | +#undef CK_PKCS11_FUNCTION_INFO | |
| 1441 | + | |
| 1442 | + | |
| 1443 | +/* ============================================================== | |
| 1444 | + * Define the typedef form of all the entry points. That is, for | |
| 1445 | + * each Cryptoki function C_XXX, define a type CK_C_XXX which is | |
| 1446 | + * a pointer to that kind of function. | |
| 1447 | + * ============================================================== | |
| 1448 | + */ | |
| 1449 | + | |
| 1450 | +#define CK_NEED_ARG_LIST 1 | |
| 1451 | +#define CK_PKCS11_FUNCTION_INFO(name) \ | |
| 1452 | + typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name)) | |
| 1453 | + | |
| 1454 | +/* pkcs11f.h has all the information about the Cryptoki | |
| 1455 | + * function prototypes. */ | |
| 1456 | +#include "rsaref/pkcs11f.h" | |
| 1457 | + | |
| 1458 | +#undef CK_NEED_ARG_LIST | |
| 1459 | +#undef CK_PKCS11_FUNCTION_INFO | |
| 1460 | + | |
| 1461 | + | |
| 1462 | +/* ============================================================== | |
| 1463 | + * Define structed vector of entry points. A CK_FUNCTION_LIST | |
| 1464 | + * contains a CK_VERSION indicating a library's Cryptoki version | |
| 1465 | + * and then a whole slew of function pointers to the routines in | |
| 1466 | + * the library. This type was declared, but not defined, in | |
| 1467 | + * pkcs11t.h. | |
| 1468 | + * ============================================================== | |
| 1469 | + */ | |
| 1470 | + | |
| 1471 | +#define CK_PKCS11_FUNCTION_INFO(name) \ | |
| 1472 | + __PASTE(CK_,name) name; | |
| 1473 | + | |
| 1474 | +struct CK_FUNCTION_LIST { | |
| 1475 | + | |
| 1476 | + CK_VERSION version; /* Cryptoki version */ | |
| 1477 | + | |
| 1478 | +/* Pile all the function pointers into the CK_FUNCTION_LIST. */ | |
| 1479 | +/* pkcs11f.h has all the information about the Cryptoki | |
| 1480 | + * function prototypes. */ | |
| 1481 | +#include "rsaref/pkcs11f.h" | |
| 1482 | + | |
| 1483 | +}; | |
| 1484 | + | |
| 1485 | +#undef CK_PKCS11_FUNCTION_INFO | |
| 1486 | + | |
| 1487 | + | |
| 1488 | +#undef __PASTE | |
| 1489 | + | |
| 1490 | +#ifdef __cplusplus | |
| 1491 | +} | |
| 1492 | +#endif | |
| 1493 | + | |
| 1494 | +#endif | |
| 1495 | diff -udrNP putty-0.58.orig/rsaref/pkcs11f.h putty-0.58/rsaref/pkcs11f.h | |
| 1496 | --- putty-0.58.orig/rsaref/pkcs11f.h 1970-01-01 01:00:00.000000000 +0100 | |
| 1497 | +++ putty-0.58/rsaref/pkcs11f.h 2005-06-06 11:50:58.483734752 +0200 | |
| 1498 | @@ -0,0 +1,898 @@ | |
| 1499 | +/* pkcs11f.h include file for PKCS #11. 2001 June 25 */ | |
| 1500 | + | |
| 1501 | +/* This function contains pretty much everything about all the */ | |
| 1502 | +/* Cryptoki function prototypes. Because this information is */ | |
| 1503 | +/* used for more than just declaring function prototypes, the */ | |
| 1504 | +/* order of the functions appearing herein is important, and */ | |
| 1505 | +/* should not be altered. */ | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | +/* General-purpose */ | |
| 1510 | + | |
| 1511 | +/* C_Initialize initializes the Cryptoki library. */ | |
| 1512 | +CK_PKCS11_FUNCTION_INFO(C_Initialize) | |
| 1513 | +#ifdef CK_NEED_ARG_LIST | |
| 1514 | +( | |
| 1515 | + CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets | |
| 1516 | + * cast to CK_C_INITIALIZE_ARGS_PTR | |
| 1517 | + * and dereferenced */ | |
| 1518 | +); | |
| 1519 | +#endif | |
| 1520 | + | |
| 1521 | + | |
| 1522 | +/* C_Finalize indicates that an application is done with the | |
| 1523 | + * Cryptoki library. */ | |
| 1524 | +CK_PKCS11_FUNCTION_INFO(C_Finalize) | |
| 1525 | +#ifdef CK_NEED_ARG_LIST | |
| 1526 | +( | |
| 1527 | + CK_VOID_PTR pReserved /* reserved. Should be NULL_PTR */ | |
| 1528 | +); | |
| 1529 | +#endif | |
| 1530 | + | |
| 1531 | + | |
| 1532 | +/* C_GetInfo returns general information about Cryptoki. */ | |
| 1533 | +CK_PKCS11_FUNCTION_INFO(C_GetInfo) | |
| 1534 | +#ifdef CK_NEED_ARG_LIST | |
| 1535 | +( | |
| 1536 | + CK_INFO_PTR pInfo /* location that receives information */ | |
| 1537 | +); | |
| 1538 | +#endif | |
| 1539 | + | |
| 1540 | + | |
| 1541 | +/* C_GetFunctionList returns the function list. */ | |
| 1542 | +CK_PKCS11_FUNCTION_INFO(C_GetFunctionList) | |
| 1543 | +#ifdef CK_NEED_ARG_LIST | |
| 1544 | +( | |
| 1545 | + CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to | |
| 1546 | + * function list */ | |
| 1547 | +); | |
| 1548 | +#endif | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | +/* Slot and token management */ | |
| 1553 | + | |
| 1554 | +/* C_GetSlotList obtains a list of slots in the system. */ | |
| 1555 | +CK_PKCS11_FUNCTION_INFO(C_GetSlotList) | |
| 1556 | +#ifdef CK_NEED_ARG_LIST | |
| 1557 | +( | |
| 1558 | + CK_BBOOL tokenPresent, /* only slots with tokens? */ | |
| 1559 | + CK_SLOT_ID_PTR pSlotList, /* receives array of slot IDs */ | |
| 1560 | + CK_ULONG_PTR pulCount /* receives number of slots */ | |
| 1561 | +); | |
| 1562 | +#endif | |
| 1563 | + | |
| 1564 | + | |
| 1565 | +/* C_GetSlotInfo obtains information about a particular slot in | |
| 1566 | + * the system. */ | |
| 1567 | +CK_PKCS11_FUNCTION_INFO(C_GetSlotInfo) | |
| 1568 | +#ifdef CK_NEED_ARG_LIST | |
| 1569 | +( | |
| 1570 | + CK_SLOT_ID slotID, /* the ID of the slot */ | |
| 1571 | + CK_SLOT_INFO_PTR pInfo /* receives the slot information */ | |
| 1572 | +); | |
| 1573 | +#endif | |
| 1574 | + | |
| 1575 | + | |
| 1576 | +/* C_GetTokenInfo obtains information about a particular token | |
| 1577 | + * in the system. */ | |
| 1578 | +CK_PKCS11_FUNCTION_INFO(C_GetTokenInfo) | |
| 1579 | +#ifdef CK_NEED_ARG_LIST | |
| 1580 | +( | |
| 1581 | + CK_SLOT_ID slotID, /* ID of the token's slot */ | |
| 1582 | + CK_TOKEN_INFO_PTR pInfo /* receives the token information */ | |
| 1583 | +); | |
| 1584 | +#endif | |
| 1585 | + | |
| 1586 | + | |
| 1587 | +/* C_GetMechanismList obtains a list of mechanism types | |
| 1588 | + * supported by a token. */ | |
| 1589 | +CK_PKCS11_FUNCTION_INFO(C_GetMechanismList) | |
| 1590 | +#ifdef CK_NEED_ARG_LIST | |
| 1591 | +( | |
| 1592 | + CK_SLOT_ID slotID, /* ID of token's slot */ | |
| 1593 | + CK_MECHANISM_TYPE_PTR pMechanismList, /* gets mech. array */ | |
| 1594 | + CK_ULONG_PTR pulCount /* gets # of mechs. */ | |
| 1595 | +); | |
| 1596 | +#endif | |
| 1597 | + | |
| 1598 | + | |
| 1599 | +/* C_GetMechanismInfo obtains information about a particular | |
| 1600 | + * mechanism possibly supported by a token. */ | |
| 1601 | +CK_PKCS11_FUNCTION_INFO(C_GetMechanismInfo) | |
| 1602 | +#ifdef CK_NEED_ARG_LIST | |
| 1603 | +( | |
| 1604 | + CK_SLOT_ID slotID, /* ID of the token's slot */ | |
| 1605 | + CK_MECHANISM_TYPE type, /* type of mechanism */ | |
| 1606 | + CK_MECHANISM_INFO_PTR pInfo /* receives mechanism info */ | |
| 1607 | +); | |
| 1608 | +#endif | |
| 1609 | + | |
| 1610 | + | |
| 1611 | +/* C_InitToken initializes a token. */ | |
| 1612 | +CK_PKCS11_FUNCTION_INFO(C_InitToken) | |
| 1613 | +#ifdef CK_NEED_ARG_LIST | |
| 1614 | +/* pLabel changed from CK_CHAR_PTR to CK_UTF8CHAR_PTR for v2.10 */ | |
| 1615 | +( | |
| 1616 | + CK_SLOT_ID slotID, /* ID of the token's slot */ | |
| 1617 | + CK_UTF8CHAR_PTR pPin, /* the SO's initial PIN */ | |
| 1618 | + CK_ULONG ulPinLen, /* length in bytes of the PIN */ | |
| 1619 | + CK_UTF8CHAR_PTR pLabel /* 32-byte token label (blank padded) */ | |
| 1620 | +); | |
| 1621 | +#endif | |
| 1622 | + | |
| 1623 | + | |
| 1624 | +/* C_InitPIN initializes the normal user's PIN. */ | |
| 1625 | +CK_PKCS11_FUNCTION_INFO(C_InitPIN) | |
| 1626 | +#ifdef CK_NEED_ARG_LIST | |
| 1627 | +( | |
| 1628 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1629 | + CK_UTF8CHAR_PTR pPin, /* the normal user's PIN */ | |
| 1630 | + CK_ULONG ulPinLen /* length in bytes of the PIN */ | |
| 1631 | +); | |
| 1632 | +#endif | |
| 1633 | + | |
| 1634 | + | |
| 1635 | +/* C_SetPIN modifies the PIN of the user who is logged in. */ | |
| 1636 | +CK_PKCS11_FUNCTION_INFO(C_SetPIN) | |
| 1637 | +#ifdef CK_NEED_ARG_LIST | |
| 1638 | +( | |
| 1639 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1640 | + CK_UTF8CHAR_PTR pOldPin, /* the old PIN */ | |
| 1641 | + CK_ULONG ulOldLen, /* length of the old PIN */ | |
| 1642 | + CK_UTF8CHAR_PTR pNewPin, /* the new PIN */ | |
| 1643 | + CK_ULONG ulNewLen /* length of the new PIN */ | |
| 1644 | +); | |
| 1645 | +#endif | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | +/* Session management */ | |
| 1650 | + | |
| 1651 | +/* C_OpenSession opens a session between an application and a | |
| 1652 | + * token. */ | |
| 1653 | +CK_PKCS11_FUNCTION_INFO(C_OpenSession) | |
| 1654 | +#ifdef CK_NEED_ARG_LIST | |
| 1655 | +( | |
| 1656 | + CK_SLOT_ID slotID, /* the slot's ID */ | |
| 1657 | + CK_FLAGS flags, /* from CK_SESSION_INFO */ | |
| 1658 | + CK_VOID_PTR pApplication, /* passed to callback */ | |
| 1659 | + CK_NOTIFY Notify, /* callback function */ | |
| 1660 | + CK_SESSION_HANDLE_PTR phSession /* gets session handle */ | |
| 1661 | +); | |
| 1662 | +#endif | |
| 1663 | + | |
| 1664 | + | |
| 1665 | +/* C_CloseSession closes a session between an application and a | |
| 1666 | + * token. */ | |
| 1667 | +CK_PKCS11_FUNCTION_INFO(C_CloseSession) | |
| 1668 | +#ifdef CK_NEED_ARG_LIST | |
| 1669 | +( | |
| 1670 | + CK_SESSION_HANDLE hSession /* the session's handle */ | |
| 1671 | +); | |
| 1672 | +#endif | |
| 1673 | + | |
| 1674 | + | |
| 1675 | +/* C_CloseAllSessions closes all sessions with a token. */ | |
| 1676 | +CK_PKCS11_FUNCTION_INFO(C_CloseAllSessions) | |
| 1677 | +#ifdef CK_NEED_ARG_LIST | |
| 1678 | +( | |
| 1679 | + CK_SLOT_ID slotID /* the token's slot */ | |
| 1680 | +); | |
| 1681 | +#endif | |
| 1682 | + | |
| 1683 | + | |
| 1684 | +/* C_GetSessionInfo obtains information about the session. */ | |
| 1685 | +CK_PKCS11_FUNCTION_INFO(C_GetSessionInfo) | |
| 1686 | +#ifdef CK_NEED_ARG_LIST | |
| 1687 | +( | |
| 1688 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1689 | + CK_SESSION_INFO_PTR pInfo /* receives session info */ | |
| 1690 | +); | |
| 1691 | +#endif | |
| 1692 | + | |
| 1693 | + | |
| 1694 | +/* C_GetOperationState obtains the state of the cryptographic operation | |
| 1695 | + * in a session. */ | |
| 1696 | +CK_PKCS11_FUNCTION_INFO(C_GetOperationState) | |
| 1697 | +#ifdef CK_NEED_ARG_LIST | |
| 1698 | +( | |
| 1699 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1700 | + CK_BYTE_PTR pOperationState, /* gets state */ | |
| 1701 | + CK_ULONG_PTR pulOperationStateLen /* gets state length */ | |
| 1702 | +); | |
| 1703 | +#endif | |
| 1704 | + | |
| 1705 | + | |
| 1706 | +/* C_SetOperationState restores the state of the cryptographic | |
| 1707 | + * operation in a session. */ | |
| 1708 | +CK_PKCS11_FUNCTION_INFO(C_SetOperationState) | |
| 1709 | +#ifdef CK_NEED_ARG_LIST | |
| 1710 | +( | |
| 1711 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1712 | + CK_BYTE_PTR pOperationState, /* holds state */ | |
| 1713 | + CK_ULONG ulOperationStateLen, /* holds state length */ | |
| 1714 | + CK_OBJECT_HANDLE hEncryptionKey, /* en/decryption key */ | |
| 1715 | + CK_OBJECT_HANDLE hAuthenticationKey /* sign/verify key */ | |
| 1716 | +); | |
| 1717 | +#endif | |
| 1718 | + | |
| 1719 | + | |
| 1720 | +/* C_Login logs a user into a token. */ | |
| 1721 | +CK_PKCS11_FUNCTION_INFO(C_Login) | |
| 1722 | +#ifdef CK_NEED_ARG_LIST | |
| 1723 | +( | |
| 1724 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1725 | + CK_USER_TYPE userType, /* the user type */ | |
| 1726 | + CK_UTF8CHAR_PTR pPin, /* the user's PIN */ | |
| 1727 | + CK_ULONG ulPinLen /* the length of the PIN */ | |
| 1728 | +); | |
| 1729 | +#endif | |
| 1730 | + | |
| 1731 | + | |
| 1732 | +/* C_Logout logs a user out from a token. */ | |
| 1733 | +CK_PKCS11_FUNCTION_INFO(C_Logout) | |
| 1734 | +#ifdef CK_NEED_ARG_LIST | |
| 1735 | +( | |
| 1736 | + CK_SESSION_HANDLE hSession /* the session's handle */ | |
| 1737 | +); | |
| 1738 | +#endif | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | +/* Object management */ | |
| 1743 | + | |
| 1744 | +/* C_CreateObject creates a new object. */ | |
| 1745 | +CK_PKCS11_FUNCTION_INFO(C_CreateObject) | |
| 1746 | +#ifdef CK_NEED_ARG_LIST | |
| 1747 | +( | |
| 1748 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1749 | + CK_ATTRIBUTE_PTR pTemplate, /* the object's template */ | |
| 1750 | + CK_ULONG ulCount, /* attributes in template */ | |
| 1751 | + CK_OBJECT_HANDLE_PTR phObject /* gets new object's handle. */ | |
| 1752 | +); | |
| 1753 | +#endif | |
| 1754 | + | |
| 1755 | + | |
| 1756 | +/* C_CopyObject copies an object, creating a new object for the | |
| 1757 | + * copy. */ | |
| 1758 | +CK_PKCS11_FUNCTION_INFO(C_CopyObject) | |
| 1759 | +#ifdef CK_NEED_ARG_LIST | |
| 1760 | +( | |
| 1761 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1762 | + CK_OBJECT_HANDLE hObject, /* the object's handle */ | |
| 1763 | + CK_ATTRIBUTE_PTR pTemplate, /* template for new object */ | |
| 1764 | + CK_ULONG ulCount, /* attributes in template */ | |
| 1765 | + CK_OBJECT_HANDLE_PTR phNewObject /* receives handle of copy */ | |
| 1766 | +); | |
| 1767 | +#endif | |
| 1768 | + | |
| 1769 | + | |
| 1770 | +/* C_DestroyObject destroys an object. */ | |
| 1771 | +CK_PKCS11_FUNCTION_INFO(C_DestroyObject) | |
| 1772 | +#ifdef CK_NEED_ARG_LIST | |
| 1773 | +( | |
| 1774 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1775 | + CK_OBJECT_HANDLE hObject /* the object's handle */ | |
| 1776 | +); | |
| 1777 | +#endif | |
| 1778 | + | |
| 1779 | + | |
| 1780 | +/* C_GetObjectSize gets the size of an object in bytes. */ | |
| 1781 | +CK_PKCS11_FUNCTION_INFO(C_GetObjectSize) | |
| 1782 | +#ifdef CK_NEED_ARG_LIST | |
| 1783 | +( | |
| 1784 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1785 | + CK_OBJECT_HANDLE hObject, /* the object's handle */ | |
| 1786 | + CK_ULONG_PTR pulSize /* receives size of object */ | |
| 1787 | +); | |
| 1788 | +#endif | |
| 1789 | + | |
| 1790 | + | |
| 1791 | +/* C_GetAttributeValue obtains the value of one or more object | |
| 1792 | + * attributes. */ | |
| 1793 | +CK_PKCS11_FUNCTION_INFO(C_GetAttributeValue) | |
| 1794 | +#ifdef CK_NEED_ARG_LIST | |
| 1795 | +( | |
| 1796 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1797 | + CK_OBJECT_HANDLE hObject, /* the object's handle */ | |
| 1798 | + CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs; gets vals */ | |
| 1799 | + CK_ULONG ulCount /* attributes in template */ | |
| 1800 | +); | |
| 1801 | +#endif | |
| 1802 | + | |
| 1803 | + | |
| 1804 | +/* C_SetAttributeValue modifies the value of one or more object | |
| 1805 | + * attributes */ | |
| 1806 | +CK_PKCS11_FUNCTION_INFO(C_SetAttributeValue) | |
| 1807 | +#ifdef CK_NEED_ARG_LIST | |
| 1808 | +( | |
| 1809 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1810 | + CK_OBJECT_HANDLE hObject, /* the object's handle */ | |
| 1811 | + CK_ATTRIBUTE_PTR pTemplate, /* specifies attrs and values */ | |
| 1812 | + CK_ULONG ulCount /* attributes in template */ | |
| 1813 | +); | |
| 1814 | +#endif | |
| 1815 | + | |
| 1816 | + | |
| 1817 | +/* C_FindObjectsInit initializes a search for token and session | |
| 1818 | + * objects that match a template. */ | |
| 1819 | +CK_PKCS11_FUNCTION_INFO(C_FindObjectsInit) | |
| 1820 | +#ifdef CK_NEED_ARG_LIST | |
| 1821 | +( | |
| 1822 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1823 | + CK_ATTRIBUTE_PTR pTemplate, /* attribute values to match */ | |
| 1824 | + CK_ULONG ulCount /* attrs in search template */ | |
| 1825 | +); | |
| 1826 | +#endif | |
| 1827 | + | |
| 1828 | + | |
| 1829 | +/* C_FindObjects continues a search for token and session | |
| 1830 | + * objects that match a template, obtaining additional object | |
| 1831 | + * handles. */ | |
| 1832 | +CK_PKCS11_FUNCTION_INFO(C_FindObjects) | |
| 1833 | +#ifdef CK_NEED_ARG_LIST | |
| 1834 | +( | |
| 1835 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1836 | + CK_OBJECT_HANDLE_PTR phObject, /* gets obj. handles */ | |
| 1837 | + CK_ULONG ulMaxObjectCount, /* max handles to get */ | |
| 1838 | + CK_ULONG_PTR pulObjectCount /* actual # returned */ | |
| 1839 | +); | |
| 1840 | +#endif | |
| 1841 | + | |
| 1842 | + | |
| 1843 | +/* C_FindObjectsFinal finishes a search for token and session | |
| 1844 | + * objects. */ | |
| 1845 | +CK_PKCS11_FUNCTION_INFO(C_FindObjectsFinal) | |
| 1846 | +#ifdef CK_NEED_ARG_LIST | |
| 1847 | +( | |
| 1848 | + CK_SESSION_HANDLE hSession /* the session's handle */ | |
| 1849 | +); | |
| 1850 | +#endif | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | +/* Encryption and decryption */ | |
| 1855 | + | |
| 1856 | +/* C_EncryptInit initializes an encryption operation. */ | |
| 1857 | +CK_PKCS11_FUNCTION_INFO(C_EncryptInit) | |
| 1858 | +#ifdef CK_NEED_ARG_LIST | |
| 1859 | +( | |
| 1860 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1861 | + CK_MECHANISM_PTR pMechanism, /* the encryption mechanism */ | |
| 1862 | + CK_OBJECT_HANDLE hKey /* handle of encryption key */ | |
| 1863 | +); | |
| 1864 | +#endif | |
| 1865 | + | |
| 1866 | + | |
| 1867 | +/* C_Encrypt encrypts single-part data. */ | |
| 1868 | +CK_PKCS11_FUNCTION_INFO(C_Encrypt) | |
| 1869 | +#ifdef CK_NEED_ARG_LIST | |
| 1870 | +( | |
| 1871 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1872 | + CK_BYTE_PTR pData, /* the plaintext data */ | |
| 1873 | + CK_ULONG ulDataLen, /* bytes of plaintext */ | |
| 1874 | + CK_BYTE_PTR pEncryptedData, /* gets ciphertext */ | |
| 1875 | + CK_ULONG_PTR pulEncryptedDataLen /* gets c-text size */ | |
| 1876 | +); | |
| 1877 | +#endif | |
| 1878 | + | |
| 1879 | + | |
| 1880 | +/* C_EncryptUpdate continues a multiple-part encryption | |
| 1881 | + * operation. */ | |
| 1882 | +CK_PKCS11_FUNCTION_INFO(C_EncryptUpdate) | |
| 1883 | +#ifdef CK_NEED_ARG_LIST | |
| 1884 | +( | |
| 1885 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1886 | + CK_BYTE_PTR pPart, /* the plaintext data */ | |
| 1887 | + CK_ULONG ulPartLen, /* plaintext data len */ | |
| 1888 | + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ | |
| 1889 | + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text size */ | |
| 1890 | +); | |
| 1891 | +#endif | |
| 1892 | + | |
| 1893 | + | |
| 1894 | +/* C_EncryptFinal finishes a multiple-part encryption | |
| 1895 | + * operation. */ | |
| 1896 | +CK_PKCS11_FUNCTION_INFO(C_EncryptFinal) | |
| 1897 | +#ifdef CK_NEED_ARG_LIST | |
| 1898 | +( | |
| 1899 | + CK_SESSION_HANDLE hSession, /* session handle */ | |
| 1900 | + CK_BYTE_PTR pLastEncryptedPart, /* last c-text */ | |
| 1901 | + CK_ULONG_PTR pulLastEncryptedPartLen /* gets last size */ | |
| 1902 | +); | |
| 1903 | +#endif | |
| 1904 | + | |
| 1905 | + | |
| 1906 | +/* C_DecryptInit initializes a decryption operation. */ | |
| 1907 | +CK_PKCS11_FUNCTION_INFO(C_DecryptInit) | |
| 1908 | +#ifdef CK_NEED_ARG_LIST | |
| 1909 | +( | |
| 1910 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1911 | + CK_MECHANISM_PTR pMechanism, /* the decryption mechanism */ | |
| 1912 | + CK_OBJECT_HANDLE hKey /* handle of decryption key */ | |
| 1913 | +); | |
| 1914 | +#endif | |
| 1915 | + | |
| 1916 | + | |
| 1917 | +/* C_Decrypt decrypts encrypted data in a single part. */ | |
| 1918 | +CK_PKCS11_FUNCTION_INFO(C_Decrypt) | |
| 1919 | +#ifdef CK_NEED_ARG_LIST | |
| 1920 | +( | |
| 1921 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1922 | + CK_BYTE_PTR pEncryptedData, /* ciphertext */ | |
| 1923 | + CK_ULONG ulEncryptedDataLen, /* ciphertext length */ | |
| 1924 | + CK_BYTE_PTR pData, /* gets plaintext */ | |
| 1925 | + CK_ULONG_PTR pulDataLen /* gets p-text size */ | |
| 1926 | +); | |
| 1927 | +#endif | |
| 1928 | + | |
| 1929 | + | |
| 1930 | +/* C_DecryptUpdate continues a multiple-part decryption | |
| 1931 | + * operation. */ | |
| 1932 | +CK_PKCS11_FUNCTION_INFO(C_DecryptUpdate) | |
| 1933 | +#ifdef CK_NEED_ARG_LIST | |
| 1934 | +( | |
| 1935 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 1936 | + CK_BYTE_PTR pEncryptedPart, /* encrypted data */ | |
| 1937 | + CK_ULONG ulEncryptedPartLen, /* input length */ | |
| 1938 | + CK_BYTE_PTR pPart, /* gets plaintext */ | |
| 1939 | + CK_ULONG_PTR pulPartLen /* p-text size */ | |
| 1940 | +); | |
| 1941 | +#endif | |
| 1942 | + | |
| 1943 | + | |
| 1944 | +/* C_DecryptFinal finishes a multiple-part decryption | |
| 1945 | + * operation. */ | |
| 1946 | +CK_PKCS11_FUNCTION_INFO(C_DecryptFinal) | |
| 1947 | +#ifdef CK_NEED_ARG_LIST | |
| 1948 | +( | |
| 1949 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1950 | + CK_BYTE_PTR pLastPart, /* gets plaintext */ | |
| 1951 | + CK_ULONG_PTR pulLastPartLen /* p-text size */ | |
| 1952 | +); | |
| 1953 | +#endif | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | +/* Message digesting */ | |
| 1958 | + | |
| 1959 | +/* C_DigestInit initializes a message-digesting operation. */ | |
| 1960 | +CK_PKCS11_FUNCTION_INFO(C_DigestInit) | |
| 1961 | +#ifdef CK_NEED_ARG_LIST | |
| 1962 | +( | |
| 1963 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1964 | + CK_MECHANISM_PTR pMechanism /* the digesting mechanism */ | |
| 1965 | +); | |
| 1966 | +#endif | |
| 1967 | + | |
| 1968 | + | |
| 1969 | +/* C_Digest digests data in a single part. */ | |
| 1970 | +CK_PKCS11_FUNCTION_INFO(C_Digest) | |
| 1971 | +#ifdef CK_NEED_ARG_LIST | |
| 1972 | +( | |
| 1973 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1974 | + CK_BYTE_PTR pData, /* data to be digested */ | |
| 1975 | + CK_ULONG ulDataLen, /* bytes of data to digest */ | |
| 1976 | + CK_BYTE_PTR pDigest, /* gets the message digest */ | |
| 1977 | + CK_ULONG_PTR pulDigestLen /* gets digest length */ | |
| 1978 | +); | |
| 1979 | +#endif | |
| 1980 | + | |
| 1981 | + | |
| 1982 | +/* C_DigestUpdate continues a multiple-part message-digesting | |
| 1983 | + * operation. */ | |
| 1984 | +CK_PKCS11_FUNCTION_INFO(C_DigestUpdate) | |
| 1985 | +#ifdef CK_NEED_ARG_LIST | |
| 1986 | +( | |
| 1987 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 1988 | + CK_BYTE_PTR pPart, /* data to be digested */ | |
| 1989 | + CK_ULONG ulPartLen /* bytes of data to be digested */ | |
| 1990 | +); | |
| 1991 | +#endif | |
| 1992 | + | |
| 1993 | + | |
| 1994 | +/* C_DigestKey continues a multi-part message-digesting | |
| 1995 | + * operation, by digesting the value of a secret key as part of | |
| 1996 | + * the data already digested. */ | |
| 1997 | +CK_PKCS11_FUNCTION_INFO(C_DigestKey) | |
| 1998 | +#ifdef CK_NEED_ARG_LIST | |
| 1999 | +( | |
| 2000 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2001 | + CK_OBJECT_HANDLE hKey /* secret key to digest */ | |
| 2002 | +); | |
| 2003 | +#endif | |
| 2004 | + | |
| 2005 | + | |
| 2006 | +/* C_DigestFinal finishes a multiple-part message-digesting | |
| 2007 | + * operation. */ | |
| 2008 | +CK_PKCS11_FUNCTION_INFO(C_DigestFinal) | |
| 2009 | +#ifdef CK_NEED_ARG_LIST | |
| 2010 | +( | |
| 2011 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2012 | + CK_BYTE_PTR pDigest, /* gets the message digest */ | |
| 2013 | + CK_ULONG_PTR pulDigestLen /* gets byte count of digest */ | |
| 2014 | +); | |
| 2015 | +#endif | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | +/* Signing and MACing */ | |
| 2020 | + | |
| 2021 | +/* C_SignInit initializes a signature (private key encryption) | |
| 2022 | + * operation, where the signature is (will be) an appendix to | |
| 2023 | + * the data, and plaintext cannot be recovered from the | |
| 2024 | + *signature. */ | |
| 2025 | +CK_PKCS11_FUNCTION_INFO(C_SignInit) | |
| 2026 | +#ifdef CK_NEED_ARG_LIST | |
| 2027 | +( | |
| 2028 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2029 | + CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ | |
| 2030 | + CK_OBJECT_HANDLE hKey /* handle of signature key */ | |
| 2031 | +); | |
| 2032 | +#endif | |
| 2033 | + | |
| 2034 | + | |
| 2035 | +/* C_Sign signs (encrypts with private key) data in a single | |
| 2036 | + * part, where the signature is (will be) an appendix to the | |
| 2037 | + * data, and plaintext cannot be recovered from the signature. */ | |
| 2038 | +CK_PKCS11_FUNCTION_INFO(C_Sign) | |
| 2039 | +#ifdef CK_NEED_ARG_LIST | |
| 2040 | +( | |
| 2041 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2042 | + CK_BYTE_PTR pData, /* the data to sign */ | |
| 2043 | + CK_ULONG ulDataLen, /* count of bytes to sign */ | |
| 2044 | + CK_BYTE_PTR pSignature, /* gets the signature */ | |
| 2045 | + CK_ULONG_PTR pulSignatureLen /* gets signature length */ | |
| 2046 | +); | |
| 2047 | +#endif | |
| 2048 | + | |
| 2049 | + | |
| 2050 | +/* C_SignUpdate continues a multiple-part signature operation, | |
| 2051 | + * where the signature is (will be) an appendix to the data, | |
| 2052 | + * and plaintext cannot be recovered from the signature. */ | |
| 2053 | +CK_PKCS11_FUNCTION_INFO(C_SignUpdate) | |
| 2054 | +#ifdef CK_NEED_ARG_LIST | |
| 2055 | +( | |
| 2056 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2057 | + CK_BYTE_PTR pPart, /* the data to sign */ | |
| 2058 | + CK_ULONG ulPartLen /* count of bytes to sign */ | |
| 2059 | +); | |
| 2060 | +#endif | |
| 2061 | + | |
| 2062 | + | |
| 2063 | +/* C_SignFinal finishes a multiple-part signature operation, | |
| 2064 | + * returning the signature. */ | |
| 2065 | +CK_PKCS11_FUNCTION_INFO(C_SignFinal) | |
| 2066 | +#ifdef CK_NEED_ARG_LIST | |
| 2067 | +( | |
| 2068 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2069 | + CK_BYTE_PTR pSignature, /* gets the signature */ | |
| 2070 | + CK_ULONG_PTR pulSignatureLen /* gets signature length */ | |
| 2071 | +); | |
| 2072 | +#endif | |
| 2073 | + | |
| 2074 | + | |
| 2075 | +/* C_SignRecoverInit initializes a signature operation, where | |
| 2076 | + * the data can be recovered from the signature. */ | |
| 2077 | +CK_PKCS11_FUNCTION_INFO(C_SignRecoverInit) | |
| 2078 | +#ifdef CK_NEED_ARG_LIST | |
| 2079 | +( | |
| 2080 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2081 | + CK_MECHANISM_PTR pMechanism, /* the signature mechanism */ | |
| 2082 | + CK_OBJECT_HANDLE hKey /* handle of the signature key */ | |
| 2083 | +); | |
| 2084 | +#endif | |
| 2085 | + | |
| 2086 | + | |
| 2087 | +/* C_SignRecover signs data in a single operation, where the | |
| 2088 | + * data can be recovered from the signature. */ | |
| 2089 | +CK_PKCS11_FUNCTION_INFO(C_SignRecover) | |
| 2090 | +#ifdef CK_NEED_ARG_LIST | |
| 2091 | +( | |
| 2092 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2093 | + CK_BYTE_PTR pData, /* the data to sign */ | |
| 2094 | + CK_ULONG ulDataLen, /* count of bytes to sign */ | |
| 2095 | + CK_BYTE_PTR pSignature, /* gets the signature */ | |
| 2096 | + CK_ULONG_PTR pulSignatureLen /* gets signature length */ | |
| 2097 | +); | |
| 2098 | +#endif | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | +/* Verifying signatures and MACs */ | |
| 2103 | + | |
| 2104 | +/* C_VerifyInit initializes a verification operation, where the | |
| 2105 | + * signature is an appendix to the data, and plaintext cannot | |
| 2106 | + * cannot be recovered from the signature (e.g. DSA). */ | |
| 2107 | +CK_PKCS11_FUNCTION_INFO(C_VerifyInit) | |
| 2108 | +#ifdef CK_NEED_ARG_LIST | |
| 2109 | +( | |
| 2110 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2111 | + CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ | |
| 2112 | + CK_OBJECT_HANDLE hKey /* verification key */ | |
| 2113 | +); | |
| 2114 | +#endif | |
| 2115 | + | |
| 2116 | + | |
| 2117 | +/* C_Verify verifies a signature in a single-part operation, | |
| 2118 | + * where the signature is an appendix to the data, and plaintext | |
| 2119 | + * cannot be recovered from the signature. */ | |
| 2120 | +CK_PKCS11_FUNCTION_INFO(C_Verify) | |
| 2121 | +#ifdef CK_NEED_ARG_LIST | |
| 2122 | +( | |
| 2123 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2124 | + CK_BYTE_PTR pData, /* signed data */ | |
| 2125 | + CK_ULONG ulDataLen, /* length of signed data */ | |
| 2126 | + CK_BYTE_PTR pSignature, /* signature */ | |
| 2127 | + CK_ULONG ulSignatureLen /* signature length*/ | |
| 2128 | +); | |
| 2129 | +#endif | |
| 2130 | + | |
| 2131 | + | |
| 2132 | +/* C_VerifyUpdate continues a multiple-part verification | |
| 2133 | + * operation, where the signature is an appendix to the data, | |
| 2134 | + * and plaintext cannot be recovered from the signature. */ | |
| 2135 | +CK_PKCS11_FUNCTION_INFO(C_VerifyUpdate) | |
| 2136 | +#ifdef CK_NEED_ARG_LIST | |
| 2137 | +( | |
| 2138 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2139 | + CK_BYTE_PTR pPart, /* signed data */ | |
| 2140 | + CK_ULONG ulPartLen /* length of signed data */ | |
| 2141 | +); | |
| 2142 | +#endif | |
| 2143 | + | |
| 2144 | + | |
| 2145 | +/* C_VerifyFinal finishes a multiple-part verification | |
| 2146 | + * operation, checking the signature. */ | |
| 2147 | +CK_PKCS11_FUNCTION_INFO(C_VerifyFinal) | |
| 2148 | +#ifdef CK_NEED_ARG_LIST | |
| 2149 | +( | |
| 2150 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2151 | + CK_BYTE_PTR pSignature, /* signature to verify */ | |
| 2152 | + CK_ULONG ulSignatureLen /* signature length */ | |
| 2153 | +); | |
| 2154 | +#endif | |
| 2155 | + | |
| 2156 | + | |
| 2157 | +/* C_VerifyRecoverInit initializes a signature verification | |
| 2158 | + * operation, where the data is recovered from the signature. */ | |
| 2159 | +CK_PKCS11_FUNCTION_INFO(C_VerifyRecoverInit) | |
| 2160 | +#ifdef CK_NEED_ARG_LIST | |
| 2161 | +( | |
| 2162 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2163 | + CK_MECHANISM_PTR pMechanism, /* the verification mechanism */ | |
| 2164 | + CK_OBJECT_HANDLE hKey /* verification key */ | |
| 2165 | +); | |
| 2166 | +#endif | |
| 2167 | + | |
| 2168 | + | |
| 2169 | +/* C_VerifyRecover verifies a signature in a single-part | |
| 2170 | + * operation, where the data is recovered from the signature. */ | |
| 2171 | +CK_PKCS11_FUNCTION_INFO(C_VerifyRecover) | |
| 2172 | +#ifdef CK_NEED_ARG_LIST | |
| 2173 | +( | |
| 2174 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2175 | + CK_BYTE_PTR pSignature, /* signature to verify */ | |
| 2176 | + CK_ULONG ulSignatureLen, /* signature length */ | |
| 2177 | + CK_BYTE_PTR pData, /* gets signed data */ | |
| 2178 | + CK_ULONG_PTR pulDataLen /* gets signed data len */ | |
| 2179 | +); | |
| 2180 | +#endif | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | +/* Dual-function cryptographic operations */ | |
| 2185 | + | |
| 2186 | +/* C_DigestEncryptUpdate continues a multiple-part digesting | |
| 2187 | + * and encryption operation. */ | |
| 2188 | +CK_PKCS11_FUNCTION_INFO(C_DigestEncryptUpdate) | |
| 2189 | +#ifdef CK_NEED_ARG_LIST | |
| 2190 | +( | |
| 2191 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2192 | + CK_BYTE_PTR pPart, /* the plaintext data */ | |
| 2193 | + CK_ULONG ulPartLen, /* plaintext length */ | |
| 2194 | + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ | |
| 2195 | + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ | |
| 2196 | +); | |
| 2197 | +#endif | |
| 2198 | + | |
| 2199 | + | |
| 2200 | +/* C_DecryptDigestUpdate continues a multiple-part decryption and | |
| 2201 | + * digesting operation. */ | |
| 2202 | +CK_PKCS11_FUNCTION_INFO(C_DecryptDigestUpdate) | |
| 2203 | +#ifdef CK_NEED_ARG_LIST | |
| 2204 | +( | |
| 2205 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2206 | + CK_BYTE_PTR pEncryptedPart, /* ciphertext */ | |
| 2207 | + CK_ULONG ulEncryptedPartLen, /* ciphertext length */ | |
| 2208 | + CK_BYTE_PTR pPart, /* gets plaintext */ | |
| 2209 | + CK_ULONG_PTR pulPartLen /* gets plaintext len */ | |
| 2210 | +); | |
| 2211 | +#endif | |
| 2212 | + | |
| 2213 | + | |
| 2214 | +/* C_SignEncryptUpdate continues a multiple-part signing and | |
| 2215 | + * encryption operation. */ | |
| 2216 | +CK_PKCS11_FUNCTION_INFO(C_SignEncryptUpdate) | |
| 2217 | +#ifdef CK_NEED_ARG_LIST | |
| 2218 | +( | |
| 2219 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2220 | + CK_BYTE_PTR pPart, /* the plaintext data */ | |
| 2221 | + CK_ULONG ulPartLen, /* plaintext length */ | |
| 2222 | + CK_BYTE_PTR pEncryptedPart, /* gets ciphertext */ | |
| 2223 | + CK_ULONG_PTR pulEncryptedPartLen /* gets c-text length */ | |
| 2224 | +); | |
| 2225 | +#endif | |
| 2226 | + | |
| 2227 | + | |
| 2228 | +/* C_DecryptVerifyUpdate continues a multiple-part decryption and | |
| 2229 | + * verify operation. */ | |
| 2230 | +CK_PKCS11_FUNCTION_INFO(C_DecryptVerifyUpdate) | |
| 2231 | +#ifdef CK_NEED_ARG_LIST | |
| 2232 | +( | |
| 2233 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2234 | + CK_BYTE_PTR pEncryptedPart, /* ciphertext */ | |
| 2235 | + CK_ULONG ulEncryptedPartLen, /* ciphertext length */ | |
| 2236 | + CK_BYTE_PTR pPart, /* gets plaintext */ | |
| 2237 | + CK_ULONG_PTR pulPartLen /* gets p-text length */ | |
| 2238 | +); | |
| 2239 | +#endif | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | +/* Key management */ | |
| 2244 | + | |
| 2245 | +/* C_GenerateKey generates a secret key, creating a new key | |
| 2246 | + * object. */ | |
| 2247 | +CK_PKCS11_FUNCTION_INFO(C_GenerateKey) | |
| 2248 | +#ifdef CK_NEED_ARG_LIST | |
| 2249 | +( | |
| 2250 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2251 | + CK_MECHANISM_PTR pMechanism, /* key generation mech. */ | |
| 2252 | + CK_ATTRIBUTE_PTR pTemplate, /* template for new key */ | |
| 2253 | + CK_ULONG ulCount, /* # of attrs in template */ | |
| 2254 | + CK_OBJECT_HANDLE_PTR phKey /* gets handle of new key */ | |
| 2255 | +); | |
| 2256 | +#endif | |
| 2257 | + | |
| 2258 | + | |
| 2259 | +/* C_GenerateKeyPair generates a public-key/private-key pair, | |
| 2260 | + * creating new key objects. */ | |
| 2261 | +CK_PKCS11_FUNCTION_INFO(C_GenerateKeyPair) | |
| 2262 | +#ifdef CK_NEED_ARG_LIST | |
| 2263 | +( | |
| 2264 | + CK_SESSION_HANDLE hSession, /* session | |
| 2265 | + * handle */ | |
| 2266 | + CK_MECHANISM_PTR pMechanism, /* key-gen | |
| 2267 | + * mech. */ | |
| 2268 | + CK_ATTRIBUTE_PTR pPublicKeyTemplate, /* template | |
| 2269 | + * for pub. | |
| 2270 | + * key */ | |
| 2271 | + CK_ULONG ulPublicKeyAttributeCount, /* # pub. | |
| 2272 | + * attrs. */ | |
| 2273 | + CK_ATTRIBUTE_PTR pPrivateKeyTemplate, /* template | |
| 2274 | + * for priv. | |
| 2275 | + * key */ | |
| 2276 | + CK_ULONG ulPrivateKeyAttributeCount, /* # priv. | |
| 2277 | + * attrs. */ | |
| 2278 | + CK_OBJECT_HANDLE_PTR phPublicKey, /* gets pub. | |
| 2279 | + * key | |
| 2280 | + * handle */ | |
| 2281 | + CK_OBJECT_HANDLE_PTR phPrivateKey /* gets | |
| 2282 | + * priv. key | |
| 2283 | + * handle */ | |
| 2284 | +); | |
| 2285 | +#endif | |
| 2286 | + | |
| 2287 | + | |
| 2288 | +/* C_WrapKey wraps (i.e., encrypts) a key. */ | |
| 2289 | +CK_PKCS11_FUNCTION_INFO(C_WrapKey) | |
| 2290 | +#ifdef CK_NEED_ARG_LIST | |
| 2291 | +( | |
| 2292 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2293 | + CK_MECHANISM_PTR pMechanism, /* the wrapping mechanism */ | |
| 2294 | + CK_OBJECT_HANDLE hWrappingKey, /* wrapping key */ | |
| 2295 | + CK_OBJECT_HANDLE hKey, /* key to be wrapped */ | |
| 2296 | + CK_BYTE_PTR pWrappedKey, /* gets wrapped key */ | |
| 2297 | + CK_ULONG_PTR pulWrappedKeyLen /* gets wrapped key size */ | |
| 2298 | +); | |
| 2299 | +#endif | |
| 2300 | + | |
| 2301 | + | |
| 2302 | +/* C_UnwrapKey unwraps (decrypts) a wrapped key, creating a new | |
| 2303 | + * key object. */ | |
| 2304 | +CK_PKCS11_FUNCTION_INFO(C_UnwrapKey) | |
| 2305 | +#ifdef CK_NEED_ARG_LIST | |
| 2306 | +( | |
| 2307 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2308 | + CK_MECHANISM_PTR pMechanism, /* unwrapping mech. */ | |
| 2309 | + CK_OBJECT_HANDLE hUnwrappingKey, /* unwrapping key */ | |
| 2310 | + CK_BYTE_PTR pWrappedKey, /* the wrapped key */ | |
| 2311 | + CK_ULONG ulWrappedKeyLen, /* wrapped key len */ | |
| 2312 | + CK_ATTRIBUTE_PTR pTemplate, /* new key template */ | |
| 2313 | + CK_ULONG ulAttributeCount, /* template length */ | |
| 2314 | + CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ | |
| 2315 | +); | |
| 2316 | +#endif | |
| 2317 | + | |
| 2318 | + | |
| 2319 | +/* C_DeriveKey derives a key from a base key, creating a new key | |
| 2320 | + * object. */ | |
| 2321 | +CK_PKCS11_FUNCTION_INFO(C_DeriveKey) | |
| 2322 | +#ifdef CK_NEED_ARG_LIST | |
| 2323 | +( | |
| 2324 | + CK_SESSION_HANDLE hSession, /* session's handle */ | |
| 2325 | + CK_MECHANISM_PTR pMechanism, /* key deriv. mech. */ | |
| 2326 | + CK_OBJECT_HANDLE hBaseKey, /* base key */ | |
| 2327 | + CK_ATTRIBUTE_PTR pTemplate, /* new key template */ | |
| 2328 | + CK_ULONG ulAttributeCount, /* template length */ | |
| 2329 | + CK_OBJECT_HANDLE_PTR phKey /* gets new handle */ | |
| 2330 | +); | |
| 2331 | +#endif | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | +/* Random number generation */ | |
| 2336 | + | |
| 2337 | +/* C_SeedRandom mixes additional seed material into the token's | |
| 2338 | + * random number generator. */ | |
| 2339 | +CK_PKCS11_FUNCTION_INFO(C_SeedRandom) | |
| 2340 | +#ifdef CK_NEED_ARG_LIST | |
| 2341 | +( | |
| 2342 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2343 | + CK_BYTE_PTR pSeed, /* the seed material */ | |
| 2344 | + CK_ULONG ulSeedLen /* length of seed material */ | |
| 2345 | +); | |
| 2346 | +#endif | |
| 2347 | + | |
| 2348 | + | |
| 2349 | +/* C_GenerateRandom generates random data. */ | |
| 2350 | +CK_PKCS11_FUNCTION_INFO(C_GenerateRandom) | |
| 2351 | +#ifdef CK_NEED_ARG_LIST | |
| 2352 | +( | |
| 2353 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 2354 | + CK_BYTE_PTR RandomData, /* receives the random data */ | |
| 2355 | + CK_ULONG ulRandomLen /* # of bytes to generate */ | |
| 2356 | +); | |
| 2357 | +#endif | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | +/* Parallel function management */ | |
| 2362 | + | |
| 2363 | +/* C_GetFunctionStatus is a legacy function; it obtains an | |
| 2364 | + * updated status of a function running in parallel with an | |
| 2365 | + * application. */ | |
| 2366 | +CK_PKCS11_FUNCTION_INFO(C_GetFunctionStatus) | |
| 2367 | +#ifdef CK_NEED_ARG_LIST | |
| 2368 | +( | |
| 2369 | + CK_SESSION_HANDLE hSession /* the session's handle */ | |
| 2370 | +); | |
| 2371 | +#endif | |
| 2372 | + | |
| 2373 | + | |
| 2374 | +/* C_CancelFunction is a legacy function; it cancels a function | |
| 2375 | + * running in parallel. */ | |
| 2376 | +CK_PKCS11_FUNCTION_INFO(C_CancelFunction) | |
| 2377 | +#ifdef CK_NEED_ARG_LIST | |
| 2378 | +( | |
| 2379 | + CK_SESSION_HANDLE hSession /* the session's handle */ | |
| 2380 | +); | |
| 2381 | +#endif | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | +/* Functions added in for Cryptoki Version 2.01 or later */ | |
| 2386 | + | |
| 2387 | +/* C_WaitForSlotEvent waits for a slot event (token insertion, | |
| 2388 | + * removal, etc.) to occur. */ | |
| 2389 | +CK_PKCS11_FUNCTION_INFO(C_WaitForSlotEvent) | |
| 2390 | +#ifdef CK_NEED_ARG_LIST | |
| 2391 | +( | |
| 2392 | + CK_FLAGS flags, /* blocking/nonblocking flag */ | |
| 2393 | + CK_SLOT_ID_PTR pSlot, /* location that receives the slot ID */ | |
| 2394 | + CK_VOID_PTR pRserved /* reserved. Should be NULL_PTR */ | |
| 2395 | +); | |
| 2396 | +#endif | |
| 2397 | diff -udrNP putty-0.58.orig/rsaref/pkcs11t.h putty-0.58/rsaref/pkcs11t.h | |
| 2398 | --- putty-0.58.orig/rsaref/pkcs11t.h 1970-01-01 01:00:00.000000000 +0100 | |
| 2399 | +++ putty-0.58/rsaref/pkcs11t.h 2005-06-06 11:50:58.486734296 +0200 | |
| 2400 | @@ -0,0 +1,1334 @@ | |
| 2401 | +/* pkcs11t.h include file for PKCS #11. 2001 June 25 */ | |
| 2402 | + | |
| 2403 | +/* See top of pkcs11.h for information about the macros that | |
| 2404 | + * must be defined and the structure-packing conventions that | |
| 2405 | + * must be set before including this file. */ | |
| 2406 | + | |
| 2407 | +#ifndef _PKCS11T_H_ | |
| 2408 | +#define _PKCS11T_H_ 1 | |
| 2409 | + | |
| 2410 | +#ifndef FALSE | |
| 2411 | +#define FALSE 0 | |
| 2412 | +#endif | |
| 2413 | + | |
| 2414 | +#ifndef TRUE | |
| 2415 | +#define TRUE (!FALSE) | |
| 2416 | +#endif | |
| 2417 | + | |
| 2418 | + | |
| 2419 | +/* an unsigned 8-bit value */ | |
| 2420 | +typedef unsigned char CK_BYTE; | |
| 2421 | + | |
| 2422 | +/* an unsigned 8-bit character */ | |
| 2423 | +typedef CK_BYTE CK_CHAR; | |
| 2424 | + | |
| 2425 | +/* an 8-bit UTF-8 character */ | |
| 2426 | +typedef CK_BYTE CK_UTF8CHAR; | |
| 2427 | + | |
| 2428 | +/* a BYTE-sized Boolean flag */ | |
| 2429 | +typedef CK_BYTE CK_BBOOL; | |
| 2430 | + | |
| 2431 | +/* an unsigned value, at least 32 bits long */ | |
| 2432 | +typedef unsigned long int CK_ULONG; | |
| 2433 | + | |
| 2434 | +/* a signed value, the same size as a CK_ULONG */ | |
| 2435 | +/* CK_LONG is new for v2.0 */ | |
| 2436 | +typedef long int CK_LONG; | |
| 2437 | + | |
| 2438 | +/* at least 32 bits; each bit is a Boolean flag */ | |
| 2439 | +typedef CK_ULONG CK_FLAGS; | |
| 2440 | + | |
| 2441 | + | |
| 2442 | +/* some special values for certain CK_ULONG variables */ | |
| 2443 | +#define CK_UNAVAILABLE_INFORMATION (~0UL) | |
| 2444 | +#define CK_EFFECTIVELY_INFINITE 0 | |
| 2445 | + | |
| 2446 | + | |
| 2447 | +typedef CK_BYTE CK_PTR CK_BYTE_PTR; | |
| 2448 | +typedef CK_CHAR CK_PTR CK_CHAR_PTR; | |
| 2449 | +typedef CK_UTF8CHAR CK_PTR CK_UTF8CHAR_PTR; | |
| 2450 | +typedef CK_ULONG CK_PTR CK_ULONG_PTR; | |
| 2451 | +typedef void CK_PTR CK_VOID_PTR; | |
| 2452 | + | |
| 2453 | +/* Pointer to a CK_VOID_PTR-- i.e., pointer to pointer to void */ | |
| 2454 | +typedef CK_VOID_PTR CK_PTR CK_VOID_PTR_PTR; | |
| 2455 | + | |
| 2456 | + | |
| 2457 | +/* The following value is always invalid if used as a session */ | |
| 2458 | +/* handle or object handle */ | |
| 2459 | +#define CK_INVALID_HANDLE 0 | |
| 2460 | + | |
| 2461 | + | |
| 2462 | +typedef struct CK_VERSION { | |
| 2463 | + CK_BYTE major; /* integer portion of version number */ | |
| 2464 | + CK_BYTE minor; /* 1/100ths portion of version number */ | |
| 2465 | +} CK_VERSION; | |
| 2466 | + | |
| 2467 | +typedef CK_VERSION CK_PTR CK_VERSION_PTR; | |
| 2468 | + | |
| 2469 | + | |
| 2470 | +typedef struct CK_INFO { | |
| 2471 | + /* manufacturerID and libraryDecription have been changed from | |
| 2472 | + * CK_CHAR to CK_UTF8CHAR for v2.10 */ | |
| 2473 | + CK_VERSION cryptokiVersion; /* Cryptoki interface ver */ | |
| 2474 | + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ | |
| 2475 | + CK_FLAGS flags; /* must be zero */ | |
| 2476 | + | |
| 2477 | + /* libraryDescription and libraryVersion are new for v2.0 */ | |
| 2478 | + CK_UTF8CHAR libraryDescription[32]; /* blank padded */ | |
| 2479 | + CK_VERSION libraryVersion; /* version of library */ | |
| 2480 | +} CK_INFO; | |
| 2481 | + | |
| 2482 | +typedef CK_INFO CK_PTR CK_INFO_PTR; | |
| 2483 | + | |
| 2484 | + | |
| 2485 | +/* CK_NOTIFICATION enumerates the types of notifications that | |
| 2486 | + * Cryptoki provides to an application */ | |
| 2487 | +/* CK_NOTIFICATION has been changed from an enum to a CK_ULONG | |
| 2488 | + * for v2.0 */ | |
| 2489 | +typedef CK_ULONG CK_NOTIFICATION; | |
| 2490 | +#define CKN_SURRENDER 0 | |
| 2491 | + | |
| 2492 | + | |
| 2493 | +typedef CK_ULONG CK_SLOT_ID; | |
| 2494 | + | |
| 2495 | +typedef CK_SLOT_ID CK_PTR CK_SLOT_ID_PTR; | |
| 2496 | + | |
| 2497 | + | |
| 2498 | +/* CK_SLOT_INFO provides information about a slot */ | |
| 2499 | +typedef struct CK_SLOT_INFO { | |
| 2500 | + /* slotDescription and manufacturerID have been changed from | |
| 2501 | + * CK_CHAR to CK_UTF8CHAR for v2.10 */ | |
| 2502 | + CK_UTF8CHAR slotDescription[64]; /* blank padded */ | |
| 2503 | + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ | |
| 2504 | + CK_FLAGS flags; | |
| 2505 | + | |
| 2506 | + /* hardwareVersion and firmwareVersion are new for v2.0 */ | |
| 2507 | + CK_VERSION hardwareVersion; /* version of hardware */ | |
| 2508 | + CK_VERSION firmwareVersion; /* version of firmware */ | |
| 2509 | +} CK_SLOT_INFO; | |
| 2510 | + | |
| 2511 | +/* flags: bit flags that provide capabilities of the slot | |
| 2512 | + * Bit Flag Mask Meaning | |
| 2513 | + */ | |
| 2514 | +#define CKF_TOKEN_PRESENT 0x00000001 /* a token is there */ | |
| 2515 | +#define CKF_REMOVABLE_DEVICE 0x00000002 /* removable devices*/ | |
| 2516 | +#define CKF_HW_SLOT 0x00000004 /* hardware slot */ | |
| 2517 | + | |
| 2518 | +typedef CK_SLOT_INFO CK_PTR CK_SLOT_INFO_PTR; | |
| 2519 | + | |
| 2520 | + | |
| 2521 | +/* CK_TOKEN_INFO provides information about a token */ | |
| 2522 | +typedef struct CK_TOKEN_INFO { | |
| 2523 | + /* label, manufacturerID, and model have been changed from | |
| 2524 | + * CK_CHAR to CK_UTF8CHAR for v2.10 */ | |
| 2525 | + CK_UTF8CHAR label[32]; /* blank padded */ | |
| 2526 | + CK_UTF8CHAR manufacturerID[32]; /* blank padded */ | |
| 2527 | + CK_UTF8CHAR model[16]; /* blank padded */ | |
| 2528 | + CK_CHAR serialNumber[16]; /* blank padded */ | |
| 2529 | + CK_FLAGS flags; /* see below */ | |
| 2530 | + | |
| 2531 | + /* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount, | |
| 2532 | + * ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been | |
| 2533 | + * changed from CK_USHORT to CK_ULONG for v2.0 */ | |
| 2534 | + CK_ULONG ulMaxSessionCount; /* max open sessions */ | |
| 2535 | + CK_ULONG ulSessionCount; /* sess. now open */ | |
| 2536 | + CK_ULONG ulMaxRwSessionCount; /* max R/W sessions */ | |
| 2537 | + CK_ULONG ulRwSessionCount; /* R/W sess. now open */ | |
| 2538 | + CK_ULONG ulMaxPinLen; /* in bytes */ | |
| 2539 | + CK_ULONG ulMinPinLen; /* in bytes */ | |
| 2540 | + CK_ULONG ulTotalPublicMemory; /* in bytes */ | |
| 2541 | + CK_ULONG ulFreePublicMemory; /* in bytes */ | |
| 2542 | + CK_ULONG ulTotalPrivateMemory; /* in bytes */ | |
| 2543 | + CK_ULONG ulFreePrivateMemory; /* in bytes */ | |
| 2544 | + | |
| 2545 | + /* hardwareVersion, firmwareVersion, and time are new for | |
| 2546 | + * v2.0 */ | |
| 2547 | + CK_VERSION hardwareVersion; /* version of hardware */ | |
| 2548 | + CK_VERSION firmwareVersion; /* version of firmware */ | |
| 2549 | + CK_CHAR utcTime[16]; /* time */ | |
| 2550 | +} CK_TOKEN_INFO; | |
| 2551 | + | |
| 2552 | +/* The flags parameter is defined as follows: | |
| 2553 | + * Bit Flag Mask Meaning | |
| 2554 | + */ | |
| 2555 | +#define CKF_RNG 0x00000001 /* has random # | |
| 2556 | + * generator */ | |
| 2557 | +#define CKF_WRITE_PROTECTED 0x00000002 /* token is | |
| 2558 | + * write- | |
| 2559 | + * protected */ | |
| 2560 | +#define CKF_LOGIN_REQUIRED 0x00000004 /* user must | |
| 2561 | + * login */ | |
| 2562 | +#define CKF_USER_PIN_INITIALIZED 0x00000008 /* normal user's | |
| 2563 | + * PIN is set */ | |
| 2564 | + | |
| 2565 | +/* CKF_RESTORE_KEY_NOT_NEEDED is new for v2.0. If it is set, | |
| 2566 | + * that means that *every* time the state of cryptographic | |
| 2567 | + * operations of a session is successfully saved, all keys | |
| 2568 | + * needed to continue those operations are stored in the state */ | |
| 2569 | +#define CKF_RESTORE_KEY_NOT_NEEDED 0x00000020 | |
| 2570 | + | |
| 2571 | +/* CKF_CLOCK_ON_TOKEN is new for v2.0. If it is set, that means | |
| 2572 | + * that the token has some sort of clock. The time on that | |
| 2573 | + * clock is returned in the token info structure */ | |
| 2574 | +#define CKF_CLOCK_ON_TOKEN 0x00000040 | |
| 2575 | + | |
| 2576 | +/* CKF_PROTECTED_AUTHENTICATION_PATH is new for v2.0. If it is | |
| 2577 | + * set, that means that there is some way for the user to login | |
| 2578 | + * without sending a PIN through the Cryptoki library itself */ | |
| 2579 | +#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100 | |
| 2580 | + | |
| 2581 | +/* CKF_DUAL_CRYPTO_OPERATIONS is new for v2.0. If it is true, | |
| 2582 | + * that means that a single session with the token can perform | |
| 2583 | + * dual simultaneous cryptographic operations (digest and | |
| 2584 | + * encrypt; decrypt and digest; sign and encrypt; and decrypt | |
| 2585 | + * and sign) */ | |
| 2586 | +#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200 | |
| 2587 | + | |
| 2588 | +/* CKF_TOKEN_INITIALIZED if new for v2.10. If it is true, the | |
| 2589 | + * token has been initialized using C_InitializeToken or an | |
| 2590 | + * equivalent mechanism outside the scope of PKCS #11. | |
| 2591 | + * Calling C_InitializeToken when this flag is set will cause | |
| 2592 | + * the token to be reinitialized. */ | |
| 2593 | +#define CKF_TOKEN_INITIALIZED 0x00000400 | |
| 2594 | + | |
| 2595 | +/* CKF_SECONDARY_AUTHENTICATION if new for v2.10. If it is | |
| 2596 | + * true, the token supports secondary authentication for | |
| 2597 | + * private key objects. */ | |
| 2598 | +#define CKF_SECONDARY_AUTHENTICATION 0x00000800 | |
| 2599 | + | |
| 2600 | +/* CKF_USER_PIN_COUNT_LOW if new for v2.10. If it is true, an | |
| 2601 | + * incorrect user login PIN has been entered at least once | |
| 2602 | + * since the last successful authentication. */ | |
| 2603 | +#define CKF_USER_PIN_COUNT_LOW 0x00010000 | |
| 2604 | + | |
| 2605 | +/* CKF_USER_PIN_FINAL_TRY if new for v2.10. If it is true, | |
| 2606 | + * supplying an incorrect user PIN will it to become locked. */ | |
| 2607 | +#define CKF_USER_PIN_FINAL_TRY 0x00020000 | |
| 2608 | + | |
| 2609 | +/* CKF_USER_PIN_LOCKED if new for v2.10. If it is true, the | |
| 2610 | + * user PIN has been locked. User login to the token is not | |
| 2611 | + * possible. */ | |
| 2612 | +#define CKF_USER_PIN_LOCKED 0x00040000 | |
| 2613 | + | |
| 2614 | +/* CKF_USER_PIN_TO_BE_CHANGED if new for v2.10. If it is true, | |
| 2615 | + * the user PIN value is the default value set by token | |
| 2616 | + * initialization or manufacturing, or the PIN has been | |
| 2617 | + * expired by the card. */ | |
| 2618 | +#define CKF_USER_PIN_TO_BE_CHANGED 0x00080000 | |
| 2619 | + | |
| 2620 | +/* CKF_SO_PIN_COUNT_LOW if new for v2.10. If it is true, an | |
| 2621 | + * incorrect SO login PIN has been entered at least once since | |
| 2622 | + * the last successful authentication. */ | |
| 2623 | +#define CKF_SO_PIN_COUNT_LOW 0x00100000 | |
| 2624 | + | |
| 2625 | +/* CKF_SO_PIN_FINAL_TRY if new for v2.10. If it is true, | |
| 2626 | + * supplying an incorrect SO PIN will it to become locked. */ | |
| 2627 | +#define CKF_SO_PIN_FINAL_TRY 0x00200000 | |
| 2628 | + | |
| 2629 | +/* CKF_SO_PIN_LOCKED if new for v2.10. If it is true, the SO | |
| 2630 | + * PIN has been locked. SO login to the token is not possible. | |
| 2631 | + */ | |
| 2632 | +#define CKF_SO_PIN_LOCKED 0x00400000 | |
| 2633 | + | |
| 2634 | +/* CKF_SO_PIN_TO_BE_CHANGED if new for v2.10. If it is true, | |
| 2635 | + * the SO PIN value is the default value set by token | |
| 2636 | + * initialization or manufacturing, or the PIN has been | |
| 2637 | + * expired by the card. */ | |
| 2638 | +#define CKF_SO_PIN_TO_BE_CHANGED 0x00800000 | |
| 2639 | + | |
| 2640 | +typedef CK_TOKEN_INFO CK_PTR CK_TOKEN_INFO_PTR; | |
| 2641 | + | |
| 2642 | + | |
| 2643 | +/* CK_SESSION_HANDLE is a Cryptoki-assigned value that | |
| 2644 | + * identifies a session */ | |
| 2645 | +typedef CK_ULONG CK_SESSION_HANDLE; | |
| 2646 | + | |
| 2647 | +typedef CK_SESSION_HANDLE CK_PTR CK_SESSION_HANDLE_PTR; | |
| 2648 | + | |
| 2649 | + | |
| 2650 | +/* CK_USER_TYPE enumerates the types of Cryptoki users */ | |
| 2651 | +/* CK_USER_TYPE has been changed from an enum to a CK_ULONG for | |
| 2652 | + * v2.0 */ | |
| 2653 | +typedef CK_ULONG CK_USER_TYPE; | |
| 2654 | +/* Security Officer */ | |
| 2655 | +#define CKU_SO 0 | |
| 2656 | +/* Normal user */ | |
| 2657 | +#define CKU_USER 1 | |
| 2658 | + | |
| 2659 | + | |
| 2660 | +/* CK_STATE enumerates the session states */ | |
| 2661 | +/* CK_STATE has been changed from an enum to a CK_ULONG for | |
| 2662 | + * v2.0 */ | |
| 2663 | +typedef CK_ULONG CK_STATE; | |
| 2664 | +#define CKS_RO_PUBLIC_SESSION 0 | |
| 2665 | +#define CKS_RO_USER_FUNCTIONS 1 | |
| 2666 | +#define CKS_RW_PUBLIC_SESSION 2 | |
| 2667 | +#define CKS_RW_USER_FUNCTIONS 3 | |
| 2668 | +#define CKS_RW_SO_FUNCTIONS 4 | |
| 2669 | + | |
| 2670 | + | |
| 2671 | +/* CK_SESSION_INFO provides information about a session */ | |
| 2672 | +typedef struct CK_SESSION_INFO { | |
| 2673 | + CK_SLOT_ID slotID; | |
| 2674 | + CK_STATE state; | |
| 2675 | + CK_FLAGS flags; /* see below */ | |
| 2676 | + | |
| 2677 | + /* ulDeviceError was changed from CK_USHORT to CK_ULONG for | |
| 2678 | + * v2.0 */ | |
| 2679 | + CK_ULONG ulDeviceError; /* device-dependent error code */ | |
| 2680 | +} CK_SESSION_INFO; | |
| 2681 | + | |
| 2682 | +/* The flags are defined in the following table: | |
| 2683 | + * Bit Flag Mask Meaning | |
| 2684 | + */ | |
| 2685 | +#define CKF_RW_SESSION 0x00000002 /* session is r/w */ | |
| 2686 | +#define CKF_SERIAL_SESSION 0x00000004 /* no parallel */ | |
| 2687 | + | |
| 2688 | +typedef CK_SESSION_INFO CK_PTR CK_SESSION_INFO_PTR; | |
| 2689 | + | |
| 2690 | + | |
| 2691 | +/* CK_OBJECT_HANDLE is a token-specific identifier for an | |
| 2692 | + * object */ | |
| 2693 | +typedef CK_ULONG CK_OBJECT_HANDLE; | |
| 2694 | + | |
| 2695 | +typedef CK_OBJECT_HANDLE CK_PTR CK_OBJECT_HANDLE_PTR; | |
| 2696 | + | |
| 2697 | + | |
| 2698 | +/* CK_OBJECT_CLASS is a value that identifies the classes (or | |
| 2699 | + * types) of objects that Cryptoki recognizes. It is defined | |
| 2700 | + * as follows: */ | |
| 2701 | +/* CK_OBJECT_CLASS was changed from CK_USHORT to CK_ULONG for | |
| 2702 | + * v2.0 */ | |
| 2703 | +typedef CK_ULONG CK_OBJECT_CLASS; | |
| 2704 | + | |
| 2705 | +/* The following classes of objects are defined: */ | |
| 2706 | +/* CKO_HW_FEATURE is new for v2.10 */ | |
| 2707 | +/* CKO_DOMAIN_PARAMETERS is new for v2.11 */ | |
| 2708 | +#define CKO_DATA 0x00000000 | |
| 2709 | +#define CKO_CERTIFICATE 0x00000001 | |
| 2710 | +#define CKO_PUBLIC_KEY 0x00000002 | |
| 2711 | +#define CKO_PRIVATE_KEY 0x00000003 | |
| 2712 | +#define CKO_SECRET_KEY 0x00000004 | |
| 2713 | +#define CKO_HW_FEATURE 0x00000005 | |
| 2714 | +#define CKO_DOMAIN_PARAMETERS 0x00000006 | |
| 2715 | +#define CKO_VENDOR_DEFINED 0x80000000 | |
| 2716 | + | |
| 2717 | +typedef CK_OBJECT_CLASS CK_PTR CK_OBJECT_CLASS_PTR; | |
| 2718 | + | |
| 2719 | +/* CK_HW_FEATURE_TYPE is new for v2.10. CK_HW_FEATURE_TYPE is a | |
| 2720 | + * value that identifies the hardware feature type of an object | |
| 2721 | + * with CK_OBJECT_CLASS equal to CKO_HW_FEATURE. */ | |
| 2722 | +typedef CK_ULONG CK_HW_FEATURE_TYPE; | |
| 2723 | + | |
| 2724 | +/* The following hardware feature types are defined */ | |
| 2725 | +#define CKH_MONOTONIC_COUNTER 0x00000001 | |
| 2726 | +#define CKH_CLOCK 0x00000002 | |
| 2727 | +#define CKH_VENDOR_DEFINED 0x80000000 | |
| 2728 | + | |
| 2729 | +/* CK_KEY_TYPE is a value that identifies a key type */ | |
| 2730 | +/* CK_KEY_TYPE was changed from CK_USHORT to CK_ULONG for v2.0 */ | |
| 2731 | +typedef CK_ULONG CK_KEY_TYPE; | |
| 2732 | + | |
| 2733 | +/* the following key types are defined: */ | |
| 2734 | +#define CKK_RSA 0x00000000 | |
| 2735 | +#define CKK_DSA 0x00000001 | |
| 2736 | +#define CKK_DH 0x00000002 | |
| 2737 | + | |
| 2738 | +/* CKK_ECDSA and CKK_KEA are new for v2.0 */ | |
| 2739 | +/* CKK_ECDSA is deprecated in v2.11, CKK_EC is preferred. */ | |
| 2740 | +#define CKK_ECDSA 0x00000003 | |
| 2741 | +#define CKK_EC 0x00000003 | |
| 2742 | +#define CKK_X9_42_DH 0x00000004 | |
| 2743 | +#define CKK_KEA 0x00000005 | |
| 2744 | + | |
| 2745 | +#define CKK_GENERIC_SECRET 0x00000010 | |
| 2746 | +#define CKK_RC2 0x00000011 | |
| 2747 | +#define CKK_RC4 0x00000012 | |
| 2748 | +#define CKK_DES 0x00000013 | |
| 2749 | +#define CKK_DES2 0x00000014 | |
| 2750 | +#define CKK_DES3 0x00000015 | |
| 2751 | + | |
| 2752 | +/* all these key types are new for v2.0 */ | |
| 2753 | +#define CKK_CAST 0x00000016 | |
| 2754 | +#define CKK_CAST3 0x00000017 | |
| 2755 | +/* CKK_CAST5 is deprecated in v2.11, CKK_CAST128 is preferred. */ | |
| 2756 | +#define CKK_CAST5 0x00000018 | |
| 2757 | +#define CKK_CAST128 0x00000018 | |
| 2758 | +#define CKK_RC5 0x00000019 | |
| 2759 | +#define CKK_IDEA 0x0000001A | |
| 2760 | +#define CKK_SKIPJACK 0x0000001B | |
| 2761 | +#define CKK_BATON 0x0000001C | |
| 2762 | +#define CKK_JUNIPER 0x0000001D | |
| 2763 | +#define CKK_CDMF 0x0000001E | |
| 2764 | +#define CKK_AES 0x0000001F | |
| 2765 | + | |
| 2766 | +#define CKK_VENDOR_DEFINED 0x80000000 | |
| 2767 | + | |
| 2768 | + | |
| 2769 | +/* CK_CERTIFICATE_TYPE is a value that identifies a certificate | |
| 2770 | + * type */ | |
| 2771 | +/* CK_CERTIFICATE_TYPE was changed from CK_USHORT to CK_ULONG | |
| 2772 | + * for v2.0 */ | |
| 2773 | +typedef CK_ULONG CK_CERTIFICATE_TYPE; | |
| 2774 | + | |
| 2775 | +/* The following certificate types are defined: */ | |
| 2776 | +/* CKC_X_509_ATTR_CERT is new for v2.10 */ | |
| 2777 | +#define CKC_X_509 0x00000000 | |
| 2778 | +#define CKC_X_509_ATTR_CERT 0x00000001 | |
| 2779 | +#define CKC_VENDOR_DEFINED 0x80000000 | |
| 2780 | + | |
| 2781 | + | |
| 2782 | +/* CK_ATTRIBUTE_TYPE is a value that identifies an attribute | |
| 2783 | + * type */ | |
| 2784 | +/* CK_ATTRIBUTE_TYPE was changed from CK_USHORT to CK_ULONG for | |
| 2785 | + * v2.0 */ | |
| 2786 | +typedef CK_ULONG CK_ATTRIBUTE_TYPE; | |
| 2787 | + | |
| 2788 | +/* The following attribute types are defined: */ | |
| 2789 | +#define CKA_CLASS 0x00000000 | |
| 2790 | +#define CKA_TOKEN 0x00000001 | |
| 2791 | +#define CKA_PRIVATE 0x00000002 | |
| 2792 | +#define CKA_LABEL 0x00000003 | |
| 2793 | +#define CKA_APPLICATION 0x00000010 | |
| 2794 | +#define CKA_VALUE 0x00000011 | |
| 2795 | + | |
| 2796 | +/* CKA_OBJECT_ID is new for v2.10 */ | |
| 2797 | +#define CKA_OBJECT_ID 0x00000012 | |
| 2798 | + | |
| 2799 | +#define CKA_CERTIFICATE_TYPE 0x00000080 | |
| 2800 | +#define CKA_ISSUER 0x00000081 | |
| 2801 | +#define CKA_SERIAL_NUMBER 0x00000082 | |
| 2802 | + | |
| 2803 | +/* CKA_AC_ISSUER, CKA_OWNER, and CKA_ATTR_TYPES are new | |
| 2804 | + * for v2.10 */ | |
| 2805 | +#define CKA_AC_ISSUER 0x00000083 | |
| 2806 | +#define CKA_OWNER 0x00000084 | |
| 2807 | +#define CKA_ATTR_TYPES 0x00000085 | |
| 2808 | + | |
| 2809 | +/* CKA_TRUSTED is new for v2.11 */ | |
| 2810 | +#define CKA_TRUSTED 0x00000086 | |
| 2811 | + | |
| 2812 | +#define CKA_KEY_TYPE 0x00000100 | |
| 2813 | +#define CKA_SUBJECT 0x00000101 | |
| 2814 | +#define CKA_ID 0x00000102 | |
| 2815 | +#define CKA_SENSITIVE 0x00000103 | |
| 2816 | +#define CKA_ENCRYPT 0x00000104 | |
| 2817 | +#define CKA_DECRYPT 0x00000105 | |
| 2818 | +#define CKA_WRAP 0x00000106 | |
| 2819 | +#define CKA_UNWRAP 0x00000107 | |
| 2820 | +#define CKA_SIGN 0x00000108 | |
| 2821 | +#define CKA_SIGN_RECOVER 0x00000109 | |
| 2822 | +#define CKA_VERIFY 0x0000010A | |
| 2823 | +#define CKA_VERIFY_RECOVER 0x0000010B | |
| 2824 | +#define CKA_DERIVE 0x0000010C | |
| 2825 | +#define CKA_START_DATE 0x00000110 | |
| 2826 | +#define CKA_END_DATE 0x00000111 | |
| 2827 | +#define CKA_MODULUS 0x00000120 | |
| 2828 | +#define CKA_MODULUS_BITS 0x00000121 | |
| 2829 | +#define CKA_PUBLIC_EXPONENT 0x00000122 | |
| 2830 | +#define CKA_PRIVATE_EXPONENT 0x00000123 | |
| 2831 | +#define CKA_PRIME_1 0x00000124 | |
| 2832 | +#define CKA_PRIME_2 0x00000125 | |
| 2833 | +#define CKA_EXPONENT_1 0x00000126 | |
| 2834 | +#define CKA_EXPONENT_2 0x00000127 | |
| 2835 | +#define CKA_COEFFICIENT 0x00000128 | |
| 2836 | +#define CKA_PRIME 0x00000130 | |
| 2837 | +#define CKA_SUBPRIME 0x00000131 | |
| 2838 | +#define CKA_BASE 0x00000132 | |
| 2839 | + | |
| 2840 | +/* CKA_PRIME_BITS and CKA_SUB_PRIME_BITS are new for v2.11 */ | |
| 2841 | +#define CKA_PRIME_BITS 0x00000133 | |
| 2842 | +#define CKA_SUB_PRIME_BITS 0x00000134 | |
| 2843 | + | |
| 2844 | +#define CKA_VALUE_BITS 0x00000160 | |
| 2845 | +#define CKA_VALUE_LEN 0x00000161 | |
| 2846 | + | |
| 2847 | +/* CKA_EXTRACTABLE, CKA_LOCAL, CKA_NEVER_EXTRACTABLE, | |
| 2848 | + * CKA_ALWAYS_SENSITIVE, CKA_MODIFIABLE, CKA_ECDSA_PARAMS, | |
| 2849 | + * and CKA_EC_POINT are new for v2.0 */ | |
| 2850 | +#define CKA_EXTRACTABLE 0x00000162 | |
| 2851 | +#define CKA_LOCAL 0x00000163 | |
| 2852 | +#define CKA_NEVER_EXTRACTABLE 0x00000164 | |
| 2853 | +#define CKA_ALWAYS_SENSITIVE 0x00000165 | |
| 2854 | + | |
| 2855 | +/* CKA_KEY_GEN_MECHANISM is new for v2.11 */ | |
| 2856 | +#define CKA_KEY_GEN_MECHANISM 0x00000166 | |
| 2857 | + | |
| 2858 | +#define CKA_MODIFIABLE 0x00000170 | |
| 2859 | + | |
| 2860 | +/* CKA_ECDSA_PARAMS is deprecated in v2.11, | |
| 2861 | + * CKA_EC_PARAMS is preferred. */ | |
| 2862 | +#define CKA_ECDSA_PARAMS 0x00000180 | |
| 2863 | +#define CKA_EC_PARAMS 0x00000180 | |
| 2864 | + | |
| 2865 | +#define CKA_EC_POINT 0x00000181 | |
| 2866 | + | |
| 2867 | +/* CKA_SECONDARY_AUTH, CKA_AUTH_PIN_FLAGS, | |
| 2868 | + * CKA_HW_FEATURE_TYPE, CKA_RESET_ON_INIT, and CKA_HAS_RESET | |
| 2869 | + * are new for v2.10 */ | |
| 2870 | +#define CKA_SECONDARY_AUTH 0x00000200 | |
| 2871 | +#define CKA_AUTH_PIN_FLAGS 0x00000201 | |
| 2872 | +#define CKA_HW_FEATURE_TYPE 0x00000300 | |
| 2873 | +#define CKA_RESET_ON_INIT 0x00000301 | |
| 2874 | +#define CKA_HAS_RESET 0x00000302 | |
| 2875 | + | |
| 2876 | +#define CKA_VENDOR_DEFINED 0x80000000 | |
| 2877 | + | |
| 2878 | + | |
| 2879 | +/* CK_ATTRIBUTE is a structure that includes the type, length | |
| 2880 | + * and value of an attribute */ | |
| 2881 | +typedef struct CK_ATTRIBUTE { | |
| 2882 | + CK_ATTRIBUTE_TYPE type; | |
| 2883 | + CK_VOID_PTR pValue; | |
| 2884 | + | |
| 2885 | + /* ulValueLen went from CK_USHORT to CK_ULONG for v2.0 */ | |
| 2886 | + CK_ULONG ulValueLen; /* in bytes */ | |
| 2887 | +} CK_ATTRIBUTE; | |
| 2888 | + | |
| 2889 | +typedef CK_ATTRIBUTE CK_PTR CK_ATTRIBUTE_PTR; | |
| 2890 | + | |
| 2891 | + | |
| 2892 | +/* CK_DATE is a structure that defines a date */ | |
| 2893 | +typedef struct CK_DATE{ | |
| 2894 | + CK_CHAR year[4]; /* the year ("1900" - "9999") */ | |
| 2895 | + CK_CHAR month[2]; /* the month ("01" - "12") */ | |
| 2896 | + CK_CHAR day[2]; /* the day ("01" - "31") */ | |
| 2897 | +} CK_DATE; | |
| 2898 | + | |
| 2899 | + | |
| 2900 | +/* CK_MECHANISM_TYPE is a value that identifies a mechanism | |
| 2901 | + * type */ | |
| 2902 | +/* CK_MECHANISM_TYPE was changed from CK_USHORT to CK_ULONG for | |
| 2903 | + * v2.0 */ | |
| 2904 | +typedef CK_ULONG CK_MECHANISM_TYPE; | |
| 2905 | + | |
| 2906 | +/* the following mechanism types are defined: */ | |
| 2907 | +#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000 | |
| 2908 | +#define CKM_RSA_PKCS 0x00000001 | |
| 2909 | +#define CKM_RSA_9796 0x00000002 | |
| 2910 | +#define CKM_RSA_X_509 0x00000003 | |
| 2911 | + | |
| 2912 | +/* CKM_MD2_RSA_PKCS, CKM_MD5_RSA_PKCS, and CKM_SHA1_RSA_PKCS | |
| 2913 | + * are new for v2.0. They are mechanisms which hash and sign */ | |
| 2914 | +#define CKM_MD2_RSA_PKCS 0x00000004 | |
| 2915 | +#define CKM_MD5_RSA_PKCS 0x00000005 | |
| 2916 | +#define CKM_SHA1_RSA_PKCS 0x00000006 | |
| 2917 | + | |
| 2918 | +/* CKM_RIPEMD128_RSA_PKCS, CKM_RIPEMD160_RSA_PKCS, and | |
| 2919 | + * CKM_RSA_PKCS_OAEP are new for v2.10 */ | |
| 2920 | +#define CKM_RIPEMD128_RSA_PKCS 0x00000007 | |
| 2921 | +#define CKM_RIPEMD160_RSA_PKCS 0x00000008 | |
| 2922 | +#define CKM_RSA_PKCS_OAEP 0x00000009 | |
| 2923 | + | |
| 2924 | +/* CKM_RSA_X9_31_KEY_PAIR_GEN, CKM_RSA_X9_31, CKM_SHA1_RSA_X9_31, | |
| 2925 | + * CKM_RSA_PKCS_PSS, and CKM_SHA1_RSA_PKCS_PSS are new for v2.11 */ | |
| 2926 | +#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000A | |
| 2927 | +#define CKM_RSA_X9_31 0x0000000B | |
| 2928 | +#define CKM_SHA1_RSA_X9_31 0x0000000C | |
| 2929 | +#define CKM_RSA_PKCS_PSS 0x0000000D | |
| 2930 | +#define CKM_SHA1_RSA_PKCS_PSS 0x0000000E | |
| 2931 | + | |
| 2932 | +#define CKM_DSA_KEY_PAIR_GEN 0x00000010 | |
| 2933 | +#define CKM_DSA 0x00000011 | |
| 2934 | +#define CKM_DSA_SHA1 0x00000012 | |
| 2935 | +#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020 | |
| 2936 | +#define CKM_DH_PKCS_DERIVE 0x00000021 | |
| 2937 | + | |
| 2938 | +/* CKM_X9_42_DH_KEY_PAIR_GEN, CKM_X9_42_DH_DERIVE, | |
| 2939 | + * CKM_X9_42_DH_HYBRID_DERIVE, and CKM_X9_42_MQV_DERIVE are new for | |
| 2940 | + * v2.11 */ | |
| 2941 | +#define CKM_X9_42_DH_KEY_PAIR_GEN 0x00000030 | |
| 2942 | +#define CKM_X9_42_DH_DERIVE 0x00000031 | |
| 2943 | +#define CKM_X9_42_DH_HYBRID_DERIVE 0x00000032 | |
| 2944 | +#define CKM_X9_42_MQV_DERIVE 0x00000033 | |
| 2945 | + | |
| 2946 | +#define CKM_RC2_KEY_GEN 0x00000100 | |
| 2947 | +#define CKM_RC2_ECB 0x00000101 | |
| 2948 | +#define CKM_RC2_CBC 0x00000102 | |
| 2949 | +#define CKM_RC2_MAC 0x00000103 | |
| 2950 | + | |
| 2951 | +/* CKM_RC2_MAC_GENERAL and CKM_RC2_CBC_PAD are new for v2.0 */ | |
| 2952 | +#define CKM_RC2_MAC_GENERAL 0x00000104 | |
| 2953 | +#define CKM_RC2_CBC_PAD 0x00000105 | |
| 2954 | + | |
| 2955 | +#define CKM_RC4_KEY_GEN 0x00000110 | |
| 2956 | +#define CKM_RC4 0x00000111 | |
| 2957 | +#define CKM_DES_KEY_GEN 0x00000120 | |
| 2958 | +#define CKM_DES_ECB 0x00000121 | |
| 2959 | +#define CKM_DES_CBC 0x00000122 | |
| 2960 | +#define CKM_DES_MAC 0x00000123 | |
| 2961 | + | |
| 2962 | +/* CKM_DES_MAC_GENERAL and CKM_DES_CBC_PAD are new for v2.0 */ | |
| 2963 | +#define CKM_DES_MAC_GENERAL 0x00000124 | |
| 2964 | +#define CKM_DES_CBC_PAD 0x00000125 | |
| 2965 | + | |
| 2966 | +#define CKM_DES2_KEY_GEN 0x00000130 | |
| 2967 | +#define CKM_DES3_KEY_GEN 0x00000131 | |
| 2968 | +#define CKM_DES3_ECB 0x00000132 | |
| 2969 | +#define CKM_DES3_CBC 0x00000133 | |
| 2970 | +#define CKM_DES3_MAC 0x00000134 | |
| 2971 | + | |
| 2972 | +/* CKM_DES3_MAC_GENERAL, CKM_DES3_CBC_PAD, CKM_CDMF_KEY_GEN, | |
| 2973 | + * CKM_CDMF_ECB, CKM_CDMF_CBC, CKM_CDMF_MAC, | |
| 2974 | + * CKM_CDMF_MAC_GENERAL, and CKM_CDMF_CBC_PAD are new for v2.0 */ | |
| 2975 | +#define CKM_DES3_MAC_GENERAL 0x00000135 | |
| 2976 | +#define CKM_DES3_CBC_PAD 0x00000136 | |
| 2977 | +#define CKM_CDMF_KEY_GEN 0x00000140 | |
| 2978 | +#define CKM_CDMF_ECB 0x00000141 | |
| 2979 | +#define CKM_CDMF_CBC 0x00000142 | |
| 2980 | +#define CKM_CDMF_MAC 0x00000143 | |
| 2981 | +#define CKM_CDMF_MAC_GENERAL 0x00000144 | |
| 2982 | +#define CKM_CDMF_CBC_PAD 0x00000145 | |
| 2983 | + | |
| 2984 | +#define CKM_MD2 0x00000200 | |
| 2985 | + | |
| 2986 | +/* CKM_MD2_HMAC and CKM_MD2_HMAC_GENERAL are new for v2.0 */ | |
| 2987 | +#define CKM_MD2_HMAC 0x00000201 | |
| 2988 | +#define CKM_MD2_HMAC_GENERAL 0x00000202 | |
| 2989 | + | |
| 2990 | +#define CKM_MD5 0x00000210 | |
| 2991 | + | |
| 2992 | +/* CKM_MD5_HMAC and CKM_MD5_HMAC_GENERAL are new for v2.0 */ | |
| 2993 | +#define CKM_MD5_HMAC 0x00000211 | |
| 2994 | +#define CKM_MD5_HMAC_GENERAL 0x00000212 | |
| 2995 | + | |
| 2996 | +#define CKM_SHA_1 0x00000220 | |
| 2997 | + | |
| 2998 | +/* CKM_SHA_1_HMAC and CKM_SHA_1_HMAC_GENERAL are new for v2.0 */ | |
| 2999 | +#define CKM_SHA_1_HMAC 0x00000221 | |
| 3000 | +#define CKM_SHA_1_HMAC_GENERAL 0x00000222 | |
| 3001 | + | |
| 3002 | +/* CKM_RIPEMD128, CKM_RIPEMD128_HMAC, | |
| 3003 | + * CKM_RIPEMD128_HMAC_GENERAL, CKM_RIPEMD160, CKM_RIPEMD160_HMAC, | |
| 3004 | + * and CKM_RIPEMD160_HMAC_GENERAL are new for v2.10 */ | |
| 3005 | +#define CKM_RIPEMD128 0x00000230 | |
| 3006 | +#define CKM_RIPEMD128_HMAC 0x00000231 | |
| 3007 | +#define CKM_RIPEMD128_HMAC_GENERAL 0x00000232 | |
| 3008 | +#define CKM_RIPEMD160 0x00000240 | |
| 3009 | +#define CKM_RIPEMD160_HMAC 0x00000241 | |
| 3010 | +#define CKM_RIPEMD160_HMAC_GENERAL 0x00000242 | |
| 3011 | + | |
| 3012 | +/* All of the following mechanisms are new for v2.0 */ | |
| 3013 | +/* Note that CAST128 and CAST5 are the same algorithm */ | |
| 3014 | +#define CKM_CAST_KEY_GEN 0x00000300 | |
| 3015 | +#define CKM_CAST_ECB 0x00000301 | |
| 3016 | +#define CKM_CAST_CBC 0x00000302 | |
| 3017 | +#define CKM_CAST_MAC 0x00000303 | |
| 3018 | +#define CKM_CAST_MAC_GENERAL 0x00000304 | |
| 3019 | +#define CKM_CAST_CBC_PAD 0x00000305 | |
| 3020 | +#define CKM_CAST3_KEY_GEN 0x00000310 | |
| 3021 | +#define CKM_CAST3_ECB 0x00000311 | |
| 3022 | +#define CKM_CAST3_CBC 0x00000312 | |
| 3023 | +#define CKM_CAST3_MAC 0x00000313 | |
| 3024 | +#define CKM_CAST3_MAC_GENERAL 0x00000314 | |
| 3025 | +#define CKM_CAST3_CBC_PAD 0x00000315 | |
| 3026 | +#define CKM_CAST5_KEY_GEN 0x00000320 | |
| 3027 | +#define CKM_CAST128_KEY_GEN 0x00000320 | |
| 3028 | +#define CKM_CAST5_ECB 0x00000321 | |
| 3029 | +#define CKM_CAST128_ECB 0x00000321 | |
| 3030 | +#define CKM_CAST5_CBC 0x00000322 | |
| 3031 | +#define CKM_CAST128_CBC 0x00000322 | |
| 3032 | +#define CKM_CAST5_MAC 0x00000323 | |
| 3033 | +#define CKM_CAST128_MAC 0x00000323 | |
| 3034 | +#define CKM_CAST5_MAC_GENERAL 0x00000324 | |
| 3035 | +#define CKM_CAST128_MAC_GENERAL 0x00000324 | |
| 3036 | +#define CKM_CAST5_CBC_PAD 0x00000325 | |
| 3037 | +#define CKM_CAST128_CBC_PAD 0x00000325 | |
| 3038 | +#define CKM_RC5_KEY_GEN 0x00000330 | |
| 3039 | +#define CKM_RC5_ECB 0x00000331 | |
| 3040 | +#define CKM_RC5_CBC 0x00000332 | |
| 3041 | +#define CKM_RC5_MAC 0x00000333 | |
| 3042 | +#define CKM_RC5_MAC_GENERAL 0x00000334 | |
| 3043 | +#define CKM_RC5_CBC_PAD 0x00000335 | |
| 3044 | +#define CKM_IDEA_KEY_GEN 0x00000340 | |
| 3045 | +#define CKM_IDEA_ECB 0x00000341 | |
| 3046 | +#define CKM_IDEA_CBC 0x00000342 | |
| 3047 | +#define CKM_IDEA_MAC 0x00000343 | |
| 3048 | +#define CKM_IDEA_MAC_GENERAL 0x00000344 | |
| 3049 | +#define CKM_IDEA_CBC_PAD 0x00000345 | |
| 3050 | +#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350 | |
| 3051 | +#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360 | |
| 3052 | +#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362 | |
| 3053 | +#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363 | |
| 3054 | +#define CKM_XOR_BASE_AND_DATA 0x00000364 | |
| 3055 | +#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365 | |
| 3056 | +#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370 | |
| 3057 | +#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371 | |
| 3058 | +#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372 | |
| 3059 | + | |
| 3060 | +/* CKM_SSL3_MASTER_KEY_DERIVE_DH, CKM_TLS_PRE_MASTER_KEY_GEN, | |
| 3061 | + * CKM_TLS_MASTER_KEY_DERIVE, CKM_TLS_KEY_AND_MAC_DERIVE, and | |
| 3062 | + * CKM_TLS_MASTER_KEY_DERIVE_DH are new for v2.11 */ | |
| 3063 | +#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373 | |
| 3064 | +#define CKM_TLS_PRE_MASTER_KEY_GEN 0x00000374 | |
| 3065 | +#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375 | |
| 3066 | +#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376 | |
| 3067 | +#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377 | |
| 3068 | + | |
| 3069 | +#define CKM_SSL3_MD5_MAC 0x00000380 | |
| 3070 | +#define CKM_SSL3_SHA1_MAC 0x00000381 | |
| 3071 | +#define CKM_MD5_KEY_DERIVATION 0x00000390 | |
| 3072 | +#define CKM_MD2_KEY_DERIVATION 0x00000391 | |
| 3073 | +#define CKM_SHA1_KEY_DERIVATION 0x00000392 | |
| 3074 | +#define CKM_PBE_MD2_DES_CBC 0x000003A0 | |
| 3075 | +#define CKM_PBE_MD5_DES_CBC 0x000003A1 | |
| 3076 | +#define CKM_PBE_MD5_CAST_CBC 0x000003A2 | |
| 3077 | +#define CKM_PBE_MD5_CAST3_CBC 0x000003A3 | |
| 3078 | +#define CKM_PBE_MD5_CAST5_CBC 0x000003A4 | |
| 3079 | +#define CKM_PBE_MD5_CAST128_CBC 0x000003A4 | |
| 3080 | +#define CKM_PBE_SHA1_CAST5_CBC 0x000003A5 | |
| 3081 | +#define CKM_PBE_SHA1_CAST128_CBC 0x000003A5 | |
| 3082 | +#define CKM_PBE_SHA1_RC4_128 0x000003A6 | |
| 3083 | +#define CKM_PBE_SHA1_RC4_40 0x000003A7 | |
| 3084 | +#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8 | |
| 3085 | +#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9 | |
| 3086 | +#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AA | |
| 3087 | +#define CKM_PBE_SHA1_RC2_40_CBC 0x000003AB | |
| 3088 | + | |
| 3089 | +/* CKM_PKCS5_PBKD2 is new for v2.10 */ | |
| 3090 | +#define CKM_PKCS5_PBKD2 0x000003B0 | |
| 3091 | + | |
| 3092 | +#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0 | |
| 3093 | +#define CKM_KEY_WRAP_LYNKS 0x00000400 | |
| 3094 | +#define CKM_KEY_WRAP_SET_OAEP 0x00000401 | |
| 3095 | + | |
| 3096 | +/* Fortezza mechanisms */ | |
| 3097 | +#define CKM_SKIPJACK_KEY_GEN 0x00001000 | |
| 3098 | +#define CKM_SKIPJACK_ECB64 0x00001001 | |
| 3099 | +#define CKM_SKIPJACK_CBC64 0x00001002 | |
| 3100 | +#define CKM_SKIPJACK_OFB64 0x00001003 | |
| 3101 | +#define CKM_SKIPJACK_CFB64 0x00001004 | |
| 3102 | +#define CKM_SKIPJACK_CFB32 0x00001005 | |
| 3103 | +#define CKM_SKIPJACK_CFB16 0x00001006 | |
| 3104 | +#define CKM_SKIPJACK_CFB8 0x00001007 | |
| 3105 | +#define CKM_SKIPJACK_WRAP 0x00001008 | |
| 3106 | +#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009 | |
| 3107 | +#define CKM_SKIPJACK_RELAYX 0x0000100a | |
| 3108 | +#define CKM_KEA_KEY_PAIR_GEN 0x00001010 | |
| 3109 | +#define CKM_KEA_KEY_DERIVE 0x00001011 | |
| 3110 | +#define CKM_FORTEZZA_TIMESTAMP 0x00001020 | |
| 3111 | +#define CKM_BATON_KEY_GEN 0x00001030 | |
| 3112 | +#define CKM_BATON_ECB128 0x00001031 | |
| 3113 | +#define CKM_BATON_ECB96 0x00001032 | |
| 3114 | +#define CKM_BATON_CBC128 0x00001033 | |
| 3115 | +#define CKM_BATON_COUNTER 0x00001034 | |
| 3116 | +#define CKM_BATON_SHUFFLE 0x00001035 | |
| 3117 | +#define CKM_BATON_WRAP 0x00001036 | |
| 3118 | + | |
| 3119 | +/* CKM_ECDSA_KEY_PAIR_GEN is deprecated in v2.11, | |
| 3120 | + * CKM_EC_KEY_PAIR_GEN is preferred */ | |
| 3121 | +#define CKM_ECDSA_KEY_PAIR_GEN 0x00001040 | |
| 3122 | +#define CKM_EC_KEY_PAIR_GEN 0x00001040 | |
| 3123 | + | |
| 3124 | +#define CKM_ECDSA 0x00001041 | |
| 3125 | +#define CKM_ECDSA_SHA1 0x00001042 | |
| 3126 | + | |
| 3127 | +/* CKM_ECDH1_DERIVE, CKM_ECDH1_COFACTOR_DERIVE, and CKM_ECMQV_DERIVE | |
| 3128 | + * are new for v2.11 */ | |
| 3129 | +#define CKM_ECDH1_DERIVE 0x00001050 | |
| 3130 | +#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051 | |
| 3131 | +#define CKM_ECMQV_DERIVE 0x00001052 | |
| 3132 | + | |
| 3133 | +#define CKM_JUNIPER_KEY_GEN 0x00001060 | |
| 3134 | +#define CKM_JUNIPER_ECB128 0x00001061 | |
| 3135 | +#define CKM_JUNIPER_CBC128 0x00001062 | |
| 3136 | +#define CKM_JUNIPER_COUNTER 0x00001063 | |
| 3137 | +#define CKM_JUNIPER_SHUFFLE 0x00001064 | |
| 3138 | +#define CKM_JUNIPER_WRAP 0x00001065 | |
| 3139 | +#define CKM_FASTHASH 0x00001070 | |
| 3140 | + | |
| 3141 | +/* CKM_AES_KEY_GEN, CKM_AES_ECB, CKM_AES_CBC, CKM_AES_MAC, | |
| 3142 | + * CKM_AES_MAC_GENERAL, CKM_AES_CBC_PAD, CKM_DSA_PARAMETER_GEN, | |
| 3143 | + * CKM_DH_PKCS_PARAMETER_GEN, and CKM_X9_42_DH_PARAMETER_GEN are | |
| 3144 | + * new for v2.11 */ | |
| 3145 | +#define CKM_AES_KEY_GEN 0x00001080 | |
| 3146 | +#define CKM_AES_ECB 0x00001081 | |
| 3147 | +#define CKM_AES_CBC 0x00001082 | |
| 3148 | +#define CKM_AES_MAC 0x00001083 | |
| 3149 | +#define CKM_AES_MAC_GENERAL 0x00001084 | |
| 3150 | +#define CKM_AES_CBC_PAD 0x00001085 | |
| 3151 | +#define CKM_DSA_PARAMETER_GEN 0x00002000 | |
| 3152 | +#define CKM_DH_PKCS_PARAMETER_GEN 0x00002001 | |
| 3153 | +#define CKM_X9_42_DH_PARAMETER_GEN 0x00002002 | |
| 3154 | + | |
| 3155 | +#define CKM_VENDOR_DEFINED 0x80000000 | |
| 3156 | + | |
| 3157 | +typedef CK_MECHANISM_TYPE CK_PTR CK_MECHANISM_TYPE_PTR; | |
| 3158 | + | |
| 3159 | + | |
| 3160 | +/* CK_MECHANISM is a structure that specifies a particular | |
| 3161 | + * mechanism */ | |
| 3162 | +typedef struct CK_MECHANISM { | |
| 3163 | + CK_MECHANISM_TYPE mechanism; | |
| 3164 | + CK_VOID_PTR pParameter; | |
| 3165 | + | |
| 3166 | + /* ulParameterLen was changed from CK_USHORT to CK_ULONG for | |
| 3167 | + * v2.0 */ | |
| 3168 | + CK_ULONG ulParameterLen; /* in bytes */ | |
| 3169 | +} CK_MECHANISM; | |
| 3170 | + | |
| 3171 | +typedef CK_MECHANISM CK_PTR CK_MECHANISM_PTR; | |
| 3172 | + | |
| 3173 | + | |
| 3174 | +/* CK_MECHANISM_INFO provides information about a particular | |
| 3175 | + * mechanism */ | |
| 3176 | +typedef struct CK_MECHANISM_INFO { | |
| 3177 | + CK_ULONG ulMinKeySize; | |
| 3178 | + CK_ULONG ulMaxKeySize; | |
| 3179 | + CK_FLAGS flags; | |
| 3180 | +} CK_MECHANISM_INFO; | |
| 3181 | + | |
| 3182 | +/* The flags are defined as follows: | |
| 3183 | + * Bit Flag Mask Meaning */ | |
| 3184 | +#define CKF_HW 0x00000001 /* performed by HW */ | |
| 3185 | + | |
| 3186 | +/* The flags CKF_ENCRYPT, CKF_DECRYPT, CKF_DIGEST, CKF_SIGN, | |
| 3187 | + * CKG_SIGN_RECOVER, CKF_VERIFY, CKF_VERIFY_RECOVER, | |
| 3188 | + * CKF_GENERATE, CKF_GENERATE_KEY_PAIR, CKF_WRAP, CKF_UNWRAP, | |
| 3189 | + * and CKF_DERIVE are new for v2.0. They specify whether or not | |
| 3190 | + * a mechanism can be used for a particular task */ | |
| 3191 | +#define CKF_ENCRYPT 0x00000100 | |
| 3192 | +#define CKF_DECRYPT 0x00000200 | |
| 3193 | +#define CKF_DIGEST 0x00000400 | |
| 3194 | +#define CKF_SIGN 0x00000800 | |
| 3195 | +#define CKF_SIGN_RECOVER 0x00001000 | |
| 3196 | +#define CKF_VERIFY 0x00002000 | |
| 3197 | +#define CKF_VERIFY_RECOVER 0x00004000 | |
| 3198 | +#define CKF_GENERATE 0x00008000 | |
| 3199 | +#define CKF_GENERATE_KEY_PAIR 0x00010000 | |
| 3200 | +#define CKF_WRAP 0x00020000 | |
| 3201 | +#define CKF_UNWRAP 0x00040000 | |
| 3202 | +#define CKF_DERIVE 0x00080000 | |
| 3203 | + | |
| 3204 | +/* CKF_EC_F_P, CKF_EC_F_2M, CKF_EC_ECPARAMETERS, CKF_EC_NAMEDCURVE, | |
| 3205 | + * CKF_EC_UNCOMPRESS, and CKF_EC_COMPRESS are new for v2.11. They | |
| 3206 | + * describe a token's EC capabilities not available in mechanism | |
| 3207 | + * information. */ | |
| 3208 | +#define CKF_EC_F_P 0x00100000 | |
| 3209 | +#define CKF_EC_F_2M 0x00200000 | |
| 3210 | +#define CKF_EC_ECPARAMETERS 0x00400000 | |
| 3211 | +#define CKF_EC_NAMEDCURVE 0x00800000 | |
| 3212 | +#define CKF_EC_UNCOMPRESS 0x01000000 | |
| 3213 | +#define CKF_EC_COMPRESS 0x02000000 | |
| 3214 | + | |
| 3215 | +#define CKF_EXTENSION 0x80000000 /* FALSE for 2.01 */ | |
| 3216 | + | |
| 3217 | +typedef CK_MECHANISM_INFO CK_PTR CK_MECHANISM_INFO_PTR; | |
| 3218 | + | |
| 3219 | + | |
| 3220 | +/* CK_RV is a value that identifies the return value of a | |
| 3221 | + * Cryptoki function */ | |
| 3222 | +/* CK_RV was changed from CK_USHORT to CK_ULONG for v2.0 */ | |
| 3223 | +typedef CK_ULONG CK_RV; | |
| 3224 | + | |
| 3225 | +#define CKR_OK 0x00000000 | |
| 3226 | +#define CKR_CANCEL 0x00000001 | |
| 3227 | +#define CKR_HOST_MEMORY 0x00000002 | |
| 3228 | +#define CKR_SLOT_ID_INVALID 0x00000003 | |
| 3229 | + | |
| 3230 | +/* CKR_FLAGS_INVALID was removed for v2.0 */ | |
| 3231 | + | |
| 3232 | +/* CKR_GENERAL_ERROR and CKR_FUNCTION_FAILED are new for v2.0 */ | |
| 3233 | +#define CKR_GENERAL_ERROR 0x00000005 | |
| 3234 | +#define CKR_FUNCTION_FAILED 0x00000006 | |
| 3235 | + | |
| 3236 | +/* CKR_ARGUMENTS_BAD, CKR_NO_EVENT, CKR_NEED_TO_CREATE_THREADS, | |
| 3237 | + * and CKR_CANT_LOCK are new for v2.01 */ | |
| 3238 | +#define CKR_ARGUMENTS_BAD 0x00000007 | |
| 3239 | +#define CKR_NO_EVENT 0x00000008 | |
| 3240 | +#define CKR_NEED_TO_CREATE_THREADS 0x00000009 | |
| 3241 | +#define CKR_CANT_LOCK 0x0000000A | |
| 3242 | + | |
| 3243 | +#define CKR_ATTRIBUTE_READ_ONLY 0x00000010 | |
| 3244 | +#define CKR_ATTRIBUTE_SENSITIVE 0x00000011 | |
| 3245 | +#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012 | |
| 3246 | +#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013 | |
| 3247 | +#define CKR_DATA_INVALID 0x00000020 | |
| 3248 | +#define CKR_DATA_LEN_RANGE 0x00000021 | |
| 3249 | +#define CKR_DEVICE_ERROR 0x00000030 | |
| 3250 | +#define CKR_DEVICE_MEMORY 0x00000031 | |
| 3251 | +#define CKR_DEVICE_REMOVED 0x00000032 | |
| 3252 | +#define CKR_ENCRYPTED_DATA_INVALID 0x00000040 | |
| 3253 | +#define CKR_ENCRYPTED_DATA_LEN_RANGE 0x00000041 | |
| 3254 | +#define CKR_FUNCTION_CANCELED 0x00000050 | |
| 3255 | +#define CKR_FUNCTION_NOT_PARALLEL 0x00000051 | |
| 3256 | + | |
| 3257 | +/* CKR_FUNCTION_NOT_SUPPORTED is new for v2.0 */ | |
| 3258 | +#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054 | |
| 3259 | + | |
| 3260 | +#define CKR_KEY_HANDLE_INVALID 0x00000060 | |
| 3261 | + | |
| 3262 | +/* CKR_KEY_SENSITIVE was removed for v2.0 */ | |
| 3263 | + | |
| 3264 | +#define CKR_KEY_SIZE_RANGE 0x00000062 | |
| 3265 | +#define CKR_KEY_TYPE_INCONSISTENT 0x00000063 | |
| 3266 | + | |
| 3267 | +/* CKR_KEY_NOT_NEEDED, CKR_KEY_CHANGED, CKR_KEY_NEEDED, | |
| 3268 | + * CKR_KEY_INDIGESTIBLE, CKR_KEY_FUNCTION_NOT_PERMITTED, | |
| 3269 | + * CKR_KEY_NOT_WRAPPABLE, and CKR_KEY_UNEXTRACTABLE are new for | |
| 3270 | + * v2.0 */ | |
| 3271 | +#define CKR_KEY_NOT_NEEDED 0x00000064 | |
| 3272 | +#define CKR_KEY_CHANGED 0x00000065 | |
| 3273 | +#define CKR_KEY_NEEDED 0x00000066 | |
| 3274 | +#define CKR_KEY_INDIGESTIBLE 0x00000067 | |
| 3275 | +#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068 | |
| 3276 | +#define CKR_KEY_NOT_WRAPPABLE 0x00000069 | |
| 3277 | +#define CKR_KEY_UNEXTRACTABLE 0x0000006A | |
| 3278 | + | |
| 3279 | +#define CKR_MECHANISM_INVALID 0x00000070 | |
| 3280 | +#define CKR_MECHANISM_PARAM_INVALID 0x00000071 | |
| 3281 | + | |
| 3282 | +/* CKR_OBJECT_CLASS_INCONSISTENT and CKR_OBJECT_CLASS_INVALID | |
| 3283 | + * were removed for v2.0 */ | |
| 3284 | +#define CKR_OBJECT_HANDLE_INVALID 0x00000082 | |
| 3285 | +#define CKR_OPERATION_ACTIVE 0x00000090 | |
| 3286 | +#define CKR_OPERATION_NOT_INITIALIZED 0x00000091 | |
| 3287 | +#define CKR_PIN_INCORRECT 0x000000A0 | |
| 3288 | +#define CKR_PIN_INVALID 0x000000A1 | |
| 3289 | +#define CKR_PIN_LEN_RANGE 0x000000A2 | |
| 3290 | + | |
| 3291 | +/* CKR_PIN_EXPIRED and CKR_PIN_LOCKED are new for v2.0 */ | |
| 3292 | +#define CKR_PIN_EXPIRED 0x000000A3 | |
| 3293 | +#define CKR_PIN_LOCKED 0x000000A4 | |
| 3294 | + | |
| 3295 | +#define CKR_SESSION_CLOSED 0x000000B0 | |
| 3296 | +#define CKR_SESSION_COUNT 0x000000B1 | |
| 3297 | +#define CKR_SESSION_HANDLE_INVALID 0x000000B3 | |
| 3298 | +#define CKR_SESSION_PARALLEL_NOT_SUPPORTED 0x000000B4 | |
| 3299 | +#define CKR_SESSION_READ_ONLY 0x000000B5 | |
| 3300 | +#define CKR_SESSION_EXISTS 0x000000B6 | |
| 3301 | + | |
| 3302 | +/* CKR_SESSION_READ_ONLY_EXISTS and | |
| 3303 | + * CKR_SESSION_READ_WRITE_SO_EXISTS are new for v2.0 */ | |
| 3304 | +#define CKR_SESSION_READ_ONLY_EXISTS 0x000000B7 | |
| 3305 | +#define CKR_SESSION_READ_WRITE_SO_EXISTS 0x000000B8 | |
| 3306 | + | |
| 3307 | +#define CKR_SIGNATURE_INVALID 0x000000C0 | |
| 3308 | +#define CKR_SIGNATURE_LEN_RANGE 0x000000C1 | |
| 3309 | +#define CKR_TEMPLATE_INCOMPLETE 0x000000D0 | |
| 3310 | +#define CKR_TEMPLATE_INCONSISTENT 0x000000D1 | |
| 3311 | +#define CKR_TOKEN_NOT_PRESENT 0x000000E0 | |
| 3312 | +#define CKR_TOKEN_NOT_RECOGNIZED 0x000000E1 | |
| 3313 | +#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2 | |
| 3314 | +#define CKR_UNWRAPPING_KEY_HANDLE_INVALID 0x000000F0 | |
| 3315 | +#define CKR_UNWRAPPING_KEY_SIZE_RANGE 0x000000F1 | |
| 3316 | +#define CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x000000F2 | |
| 3317 | +#define CKR_USER_ALREADY_LOGGED_IN 0x00000100 | |
| 3318 | +#define CKR_USER_NOT_LOGGED_IN 0x00000101 | |
| 3319 | +#define CKR_USER_PIN_NOT_INITIALIZED 0x00000102 | |
| 3320 | +#define CKR_USER_TYPE_INVALID 0x00000103 | |
| 3321 | + | |
| 3322 | +/* CKR_USER_ANOTHER_ALREADY_LOGGED_IN and CKR_USER_TOO_MANY_TYPES | |
| 3323 | + * are new to v2.01 */ | |
| 3324 | +#define CKR_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000104 | |
| 3325 | +#define CKR_USER_TOO_MANY_TYPES 0x00000105 | |
| 3326 | + | |
| 3327 | +#define CKR_WRAPPED_KEY_INVALID 0x00000110 | |
| 3328 | +#define CKR_WRAPPED_KEY_LEN_RANGE 0x00000112 | |
| 3329 | +#define CKR_WRAPPING_KEY_HANDLE_INVALID 0x00000113 | |
| 3330 | +#define CKR_WRAPPING_KEY_SIZE_RANGE 0x00000114 | |
| 3331 | +#define CKR_WRAPPING_KEY_TYPE_INCONSISTENT 0x00000115 | |
| 3332 | +#define CKR_RANDOM_SEED_NOT_SUPPORTED 0x00000120 | |
| 3333 | + | |
| 3334 | +/* These are new to v2.0 */ | |
| 3335 | +#define CKR_RANDOM_NO_RNG 0x00000121 | |
| 3336 | + | |
| 3337 | +/* These are new to v2.11 */ | |
| 3338 | +#define CKR_DOMAIN_PARAMS_INVALID 0x00000130 | |
| 3339 | + | |
| 3340 | +/* These are new to v2.0 */ | |
| 3341 | +#define CKR_BUFFER_TOO_SMALL 0x00000150 | |
| 3342 | +#define CKR_SAVED_STATE_INVALID 0x00000160 | |
| 3343 | +#define CKR_INFORMATION_SENSITIVE 0x00000170 | |
| 3344 | +#define CKR_STATE_UNSAVEABLE 0x00000180 | |
| 3345 | + | |
| 3346 | +/* These are new to v2.01 */ | |
| 3347 | +#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190 | |
| 3348 | +#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191 | |
| 3349 | +#define CKR_MUTEX_BAD 0x000001A0 | |
| 3350 | +#define CKR_MUTEX_NOT_LOCKED 0x000001A1 | |
| 3351 | + | |
| 3352 | +#define CKR_VENDOR_DEFINED 0x80000000 | |
| 3353 | + | |
| 3354 | + | |
| 3355 | +/* CK_NOTIFY is an application callback that processes events */ | |
| 3356 | +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_NOTIFY)( | |
| 3357 | + CK_SESSION_HANDLE hSession, /* the session's handle */ | |
| 3358 | + CK_NOTIFICATION event, | |
| 3359 | + CK_VOID_PTR pApplication /* passed to C_OpenSession */ | |
| 3360 | +); | |
| 3361 | + | |
| 3362 | + | |
| 3363 | +/* CK_FUNCTION_LIST is a structure holding a Cryptoki spec | |
| 3364 | + * version and pointers of appropriate types to all the | |
| 3365 | + * Cryptoki functions */ | |
| 3366 | +/* CK_FUNCTION_LIST is new for v2.0 */ | |
| 3367 | +typedef struct CK_FUNCTION_LIST CK_FUNCTION_LIST; | |
| 3368 | + | |
| 3369 | +typedef CK_FUNCTION_LIST CK_PTR CK_FUNCTION_LIST_PTR; | |
| 3370 | + | |
| 3371 | +typedef CK_FUNCTION_LIST_PTR CK_PTR CK_FUNCTION_LIST_PTR_PTR; | |
| 3372 | + | |
| 3373 | + | |
| 3374 | +/* CK_CREATEMUTEX is an application callback for creating a | |
| 3375 | + * mutex object */ | |
| 3376 | +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_CREATEMUTEX)( | |
| 3377 | + CK_VOID_PTR_PTR ppMutex /* location to receive ptr to mutex */ | |
| 3378 | +); | |
| 3379 | + | |
| 3380 | + | |
| 3381 | +/* CK_DESTROYMUTEX is an application callback for destroying a | |
| 3382 | + * mutex object */ | |
| 3383 | +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_DESTROYMUTEX)( | |
| 3384 | + CK_VOID_PTR pMutex /* pointer to mutex */ | |
| 3385 | +); | |
| 3386 | + | |
| 3387 | + | |
| 3388 | +/* CK_LOCKMUTEX is an application callback for locking a mutex */ | |
| 3389 | +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_LOCKMUTEX)( | |
| 3390 | + CK_VOID_PTR pMutex /* pointer to mutex */ | |
| 3391 | +); | |
| 3392 | + | |
| 3393 | + | |
| 3394 | +/* CK_UNLOCKMUTEX is an application callback for unlocking a | |
| 3395 | + * mutex */ | |
| 3396 | +typedef CK_CALLBACK_FUNCTION(CK_RV, CK_UNLOCKMUTEX)( | |
| 3397 | + CK_VOID_PTR pMutex /* pointer to mutex */ | |
| 3398 | +); | |
| 3399 | + | |
| 3400 | + | |
| 3401 | +/* CK_C_INITIALIZE_ARGS provides the optional arguments to | |
| 3402 | + * C_Initialize */ | |
| 3403 | +typedef struct CK_C_INITIALIZE_ARGS { | |
| 3404 | + CK_CREATEMUTEX CreateMutex; | |
| 3405 | + CK_DESTROYMUTEX DestroyMutex; | |
| 3406 | + CK_LOCKMUTEX LockMutex; | |
| 3407 | + CK_UNLOCKMUTEX UnlockMutex; | |
| 3408 | + CK_FLAGS flags; | |
| 3409 | + CK_VOID_PTR pReserved; | |
| 3410 | +} CK_C_INITIALIZE_ARGS; | |
| 3411 | + | |
| 3412 | +/* flags: bit flags that provide capabilities of the slot | |
| 3413 | + * Bit Flag Mask Meaning | |
| 3414 | + */ | |
| 3415 | +#define CKF_LIBRARY_CANT_CREATE_OS_THREADS 0x00000001 | |
| 3416 | +#define CKF_OS_LOCKING_OK 0x00000002 | |
| 3417 | + | |
| 3418 | +typedef CK_C_INITIALIZE_ARGS CK_PTR CK_C_INITIALIZE_ARGS_PTR; | |
| 3419 | + | |
| 3420 | + | |
| 3421 | +/* additional flags for parameters to functions */ | |
| 3422 | + | |
| 3423 | +/* CKF_DONT_BLOCK is for the function C_WaitForSlotEvent */ | |
| 3424 | +#define CKF_DONT_BLOCK 1 | |
| 3425 | + | |
| 3426 | +/* CK_RSA_PKCS_OAEP_MGF_TYPE is new for v2.10. | |
| 3427 | + * CK_RSA_PKCS_OAEP_MGF_TYPE is used to indicate the Message | |
| 3428 | + * Generation Function (MGF) applied to a message block when | |
| 3429 | + * formatting a message block for the PKCS #1 OAEP encryption | |
| 3430 | + * scheme. */ | |
| 3431 | +typedef CK_ULONG CK_RSA_PKCS_MGF_TYPE; | |
| 3432 | + | |
| 3433 | +typedef CK_RSA_PKCS_MGF_TYPE CK_PTR CK_RSA_PKCS_MGF_TYPE_PTR; | |
| 3434 | + | |
| 3435 | +/* The following MGFs are defined */ | |
| 3436 | +#define CKG_MGF1_SHA1 0x00000001 | |
| 3437 | + | |
| 3438 | +/* CK_RSA_PKCS_OAEP_SOURCE_TYPE is new for v2.10. | |
| 3439 | + * CK_RSA_PKCS_OAEP_SOURCE_TYPE is used to indicate the source | |
| 3440 | + * of the encoding parameter when formatting a message block | |
| 3441 | + * for the PKCS #1 OAEP encryption scheme. */ | |
| 3442 | +typedef CK_ULONG CK_RSA_PKCS_OAEP_SOURCE_TYPE; | |
| 3443 | + | |
| 3444 | +typedef CK_RSA_PKCS_OAEP_SOURCE_TYPE CK_PTR CK_RSA_PKCS_OAEP_SOURCE_TYPE_PTR; | |
| 3445 | + | |
| 3446 | +/* The following encoding parameter sources are defined */ | |
| 3447 | +#define CKZ_DATA_SPECIFIED 0x00000001 | |
| 3448 | + | |
| 3449 | +/* CK_RSA_PKCS_OAEP_PARAMS is new for v2.10. | |
| 3450 | + * CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the | |
| 3451 | + * CKM_RSA_PKCS_OAEP mechanism. */ | |
| 3452 | +typedef struct CK_RSA_PKCS_OAEP_PARAMS { | |
| 3453 | + CK_MECHANISM_TYPE hashAlg; | |
| 3454 | + CK_RSA_PKCS_MGF_TYPE mgf; | |
| 3455 | + CK_RSA_PKCS_OAEP_SOURCE_TYPE source; | |
| 3456 | + CK_VOID_PTR pSourceData; | |
| 3457 | + CK_ULONG ulSourceDataLen; | |
| 3458 | +} CK_RSA_PKCS_OAEP_PARAMS; | |
| 3459 | + | |
| 3460 | +typedef CK_RSA_PKCS_OAEP_PARAMS CK_PTR CK_RSA_PKCS_OAEP_PARAMS_PTR; | |
| 3461 | + | |
| 3462 | +/* CK_RSA_PKCS_PSS_PARAMS is new for v2.11. | |
| 3463 | + * CK_RSA_PKCS_PSS_PARAMS provides the parameters to the | |
| 3464 | + * CKM_RSA_PKCS_PSS mechanism(s). */ | |
| 3465 | +typedef struct CK_RSA_PKCS_PSS_PARAMS { | |
| 3466 | + CK_MECHANISM_TYPE hashAlg; | |
| 3467 | + CK_RSA_PKCS_MGF_TYPE mgf; | |
| 3468 | + CK_ULONG sLen; | |
| 3469 | +} CK_RSA_PKCS_PSS_PARAMS; | |
| 3470 | + | |
| 3471 | +/* CK_KEA_DERIVE_PARAMS provides the parameters to the | |
| 3472 | + * CKM_KEA_DERIVE mechanism */ | |
| 3473 | +/* CK_KEA_DERIVE_PARAMS is new for v2.0 */ | |
| 3474 | +typedef struct CK_KEA_DERIVE_PARAMS { | |
| 3475 | + CK_BBOOL isSender; | |
| 3476 | + CK_ULONG ulRandomLen; | |
| 3477 | + CK_BYTE_PTR pRandomA; | |
| 3478 | + CK_BYTE_PTR pRandomB; | |
| 3479 | + CK_ULONG ulPublicDataLen; | |
| 3480 | + CK_BYTE_PTR pPublicData; | |
| 3481 | +} CK_KEA_DERIVE_PARAMS; | |
| 3482 | + | |
| 3483 | +typedef CK_KEA_DERIVE_PARAMS CK_PTR CK_KEA_DERIVE_PARAMS_PTR; | |
| 3484 | + | |
| 3485 | + | |
| 3486 | +/* CK_RC2_PARAMS provides the parameters to the CKM_RC2_ECB and | |
| 3487 | + * CKM_RC2_MAC mechanisms. An instance of CK_RC2_PARAMS just | |
| 3488 | + * holds the effective keysize */ | |
| 3489 | +typedef CK_ULONG CK_RC2_PARAMS; | |
| 3490 | + | |
| 3491 | +typedef CK_RC2_PARAMS CK_PTR CK_RC2_PARAMS_PTR; | |
| 3492 | + | |
| 3493 | + | |
| 3494 | +/* CK_RC2_CBC_PARAMS provides the parameters to the CKM_RC2_CBC | |
| 3495 | + * mechanism */ | |
| 3496 | +typedef struct CK_RC2_CBC_PARAMS { | |
| 3497 | + /* ulEffectiveBits was changed from CK_USHORT to CK_ULONG for | |
| 3498 | + * v2.0 */ | |
| 3499 | + CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ | |
| 3500 | + | |
| 3501 | + CK_BYTE iv[8]; /* IV for CBC mode */ | |
| 3502 | +} CK_RC2_CBC_PARAMS; | |
| 3503 | + | |
| 3504 | +typedef CK_RC2_CBC_PARAMS CK_PTR CK_RC2_CBC_PARAMS_PTR; | |
| 3505 | + | |
| 3506 | + | |
| 3507 | +/* CK_RC2_MAC_GENERAL_PARAMS provides the parameters for the | |
| 3508 | + * CKM_RC2_MAC_GENERAL mechanism */ | |
| 3509 | +/* CK_RC2_MAC_GENERAL_PARAMS is new for v2.0 */ | |
| 3510 | +typedef struct CK_RC2_MAC_GENERAL_PARAMS { | |
| 3511 | + CK_ULONG ulEffectiveBits; /* effective bits (1-1024) */ | |
| 3512 | + CK_ULONG ulMacLength; /* Length of MAC in bytes */ | |
| 3513 | +} CK_RC2_MAC_GENERAL_PARAMS; | |
| 3514 | + | |
| 3515 | +typedef CK_RC2_MAC_GENERAL_PARAMS CK_PTR \ | |
| 3516 | + CK_RC2_MAC_GENERAL_PARAMS_PTR; | |
| 3517 | + | |
| 3518 | + | |
| 3519 | +/* CK_RC5_PARAMS provides the parameters to the CKM_RC5_ECB and | |
| 3520 | + * CKM_RC5_MAC mechanisms */ | |
| 3521 | +/* CK_RC5_PARAMS is new for v2.0 */ | |
| 3522 | +typedef struct CK_RC5_PARAMS { | |
| 3523 | + CK_ULONG ulWordsize; /* wordsize in bits */ | |
| 3524 | + CK_ULONG ulRounds; /* number of rounds */ | |
| 3525 | +} CK_RC5_PARAMS; | |
| 3526 | + | |
| 3527 | +typedef CK_RC5_PARAMS CK_PTR CK_RC5_PARAMS_PTR; | |
| 3528 | + | |
| 3529 | + | |
| 3530 | +/* CK_RC5_CBC_PARAMS provides the parameters to the CKM_RC5_CBC | |
| 3531 | + * mechanism */ | |
| 3532 | +/* CK_RC5_CBC_PARAMS is new for v2.0 */ | |
| 3533 | +typedef struct CK_RC5_CBC_PARAMS { | |
| 3534 | + CK_ULONG ulWordsize; /* wordsize in bits */ | |
| 3535 | + CK_ULONG ulRounds; /* number of rounds */ | |
| 3536 | + CK_BYTE_PTR pIv; /* pointer to IV */ | |
| 3537 | + CK_ULONG ulIvLen; /* length of IV in bytes */ | |
| 3538 | +} CK_RC5_CBC_PARAMS; | |
| 3539 | + | |
| 3540 | +typedef CK_RC5_CBC_PARAMS CK_PTR CK_RC5_CBC_PARAMS_PTR; | |
| 3541 | + | |
| 3542 | + | |
| 3543 | +/* CK_RC5_MAC_GENERAL_PARAMS provides the parameters for the | |
| 3544 | + * CKM_RC5_MAC_GENERAL mechanism */ | |
| 3545 | +/* CK_RC5_MAC_GENERAL_PARAMS is new for v2.0 */ | |
| 3546 | +typedef struct CK_RC5_MAC_GENERAL_PARAMS { | |
| 3547 | + CK_ULONG ulWordsize; /* wordsize in bits */ | |
| 3548 | + CK_ULONG ulRounds; /* number of rounds */ | |
| 3549 | + CK_ULONG ulMacLength; /* Length of MAC in bytes */ | |
| 3550 | +} CK_RC5_MAC_GENERAL_PARAMS; | |
| 3551 | + | |
| 3552 | +typedef CK_RC5_MAC_GENERAL_PARAMS CK_PTR \ | |
| 3553 | + CK_RC5_MAC_GENERAL_PARAMS_PTR; | |
| 3554 | + | |
| 3555 | + | |
| 3556 | +/* CK_MAC_GENERAL_PARAMS provides the parameters to most block | |
| 3557 | + * ciphers' MAC_GENERAL mechanisms. Its value is the length of | |
| 3558 | + * the MAC */ | |
| 3559 | +/* CK_MAC_GENERAL_PARAMS is new for v2.0 */ | |
| 3560 | +typedef CK_ULONG CK_MAC_GENERAL_PARAMS; | |
| 3561 | + | |
| 3562 | +typedef CK_MAC_GENERAL_PARAMS CK_PTR CK_MAC_GENERAL_PARAMS_PTR; | |
| 3563 | + | |
| 3564 | + | |
| 3565 | +/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS provides the parameters to the | |
| 3566 | + * CKM_SKIPJACK_PRIVATE_WRAP mechanism */ | |
| 3567 | +/* CK_SKIPJACK_PRIVATE_WRAP_PARAMS is new for v2.0 */ | |
| 3568 | +typedef struct CK_SKIPJACK_PRIVATE_WRAP_PARAMS { | |
| 3569 | + CK_ULONG ulPasswordLen; | |
| 3570 | + CK_BYTE_PTR pPassword; | |
| 3571 | + CK_ULONG ulPublicDataLen; | |
| 3572 | + CK_BYTE_PTR pPublicData; | |
| 3573 | + CK_ULONG ulPAndGLen; | |
| 3574 | + CK_ULONG ulQLen; | |
| 3575 | + CK_ULONG ulRandomLen; | |
| 3576 | + CK_BYTE_PTR pRandomA; | |
| 3577 | + CK_BYTE_PTR pPrimeP; | |
| 3578 | + CK_BYTE_PTR pBaseG; | |
| 3579 | + CK_BYTE_PTR pSubprimeQ; | |
| 3580 | +} CK_SKIPJACK_PRIVATE_WRAP_PARAMS; | |
| 3581 | + | |
| 3582 | +typedef CK_SKIPJACK_PRIVATE_WRAP_PARAMS CK_PTR \ | |
| 3583 | + CK_SKIPJACK_PRIVATE_WRAP_PTR; | |
| 3584 | + | |
| 3585 | + | |
| 3586 | +/* CK_SKIPJACK_RELAYX_PARAMS provides the parameters to the | |
| 3587 | + * CKM_SKIPJACK_RELAYX mechanism */ | |
| 3588 | +/* CK_SKIPJACK_RELAYX_PARAMS is new for v2.0 */ | |
| 3589 | +typedef struct CK_SKIPJACK_RELAYX_PARAMS { | |
| 3590 | + CK_ULONG ulOldWrappedXLen; | |
| 3591 | + CK_BYTE_PTR pOldWrappedX; | |
| 3592 | + CK_ULONG ulOldPasswordLen; | |
| 3593 | + CK_BYTE_PTR pOldPassword; | |
| 3594 | + CK_ULONG ulOldPublicDataLen; | |
| 3595 | + CK_BYTE_PTR pOldPublicData; | |
| 3596 | + CK_ULONG ulOldRandomLen; | |
| 3597 | + CK_BYTE_PTR pOldRandomA; | |
| 3598 | + CK_ULONG ulNewPasswordLen; | |
| 3599 | + CK_BYTE_PTR pNewPassword; | |
| 3600 | + CK_ULONG ulNewPublicDataLen; | |
| 3601 | + CK_BYTE_PTR pNewPublicData; | |
| 3602 | + CK_ULONG ulNewRandomLen; | |
| 3603 | + CK_BYTE_PTR pNewRandomA; | |
| 3604 | +} CK_SKIPJACK_RELAYX_PARAMS; | |
| 3605 | + | |
| 3606 | +typedef CK_SKIPJACK_RELAYX_PARAMS CK_PTR \ | |
| 3607 | + CK_SKIPJACK_RELAYX_PARAMS_PTR; | |
| 3608 | + | |
| 3609 | + | |
| 3610 | +typedef struct CK_PBE_PARAMS { | |
| 3611 | + CK_BYTE_PTR pInitVector; | |
| 3612 | + CK_UTF8CHAR_PTR pPassword; | |
| 3613 | + CK_ULONG ulPasswordLen; | |
| 3614 | + CK_BYTE_PTR pSalt; | |
| 3615 | + CK_ULONG ulSaltLen; | |
| 3616 | + CK_ULONG ulIteration; | |
| 3617 | +} CK_PBE_PARAMS; | |
| 3618 | + | |
| 3619 | +typedef CK_PBE_PARAMS CK_PTR CK_PBE_PARAMS_PTR; | |
| 3620 | + | |
| 3621 | + | |
| 3622 | +/* CK_KEY_WRAP_SET_OAEP_PARAMS provides the parameters to the | |
| 3623 | + * CKM_KEY_WRAP_SET_OAEP mechanism */ | |
| 3624 | +/* CK_KEY_WRAP_SET_OAEP_PARAMS is new for v2.0 */ | |
| 3625 | +typedef struct CK_KEY_WRAP_SET_OAEP_PARAMS { | |
| 3626 | + CK_BYTE bBC; /* block contents byte */ | |
| 3627 | + CK_BYTE_PTR pX; /* extra data */ | |
| 3628 | + CK_ULONG ulXLen; /* length of extra data in bytes */ | |
| 3629 | +} CK_KEY_WRAP_SET_OAEP_PARAMS; | |
| 3630 | + | |
| 3631 | +typedef CK_KEY_WRAP_SET_OAEP_PARAMS CK_PTR \ | |
| 3632 | + CK_KEY_WRAP_SET_OAEP_PARAMS_PTR; | |
| 3633 | + | |
| 3634 | + | |
| 3635 | +typedef struct CK_SSL3_RANDOM_DATA { | |
| 3636 | + CK_BYTE_PTR pClientRandom; | |
| 3637 | + CK_ULONG ulClientRandomLen; | |
| 3638 | + CK_BYTE_PTR pServerRandom; | |
| 3639 | + CK_ULONG ulServerRandomLen; | |
| 3640 | +} CK_SSL3_RANDOM_DATA; | |
| 3641 | + | |
| 3642 | + | |
| 3643 | +typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS { | |
| 3644 | + CK_SSL3_RANDOM_DATA RandomInfo; | |
| 3645 | + CK_VERSION_PTR pVersion; | |
| 3646 | +} CK_SSL3_MASTER_KEY_DERIVE_PARAMS; | |
| 3647 | + | |
| 3648 | +typedef struct CK_SSL3_MASTER_KEY_DERIVE_PARAMS CK_PTR \ | |
| 3649 | + CK_SSL3_MASTER_KEY_DERIVE_PARAMS_PTR; | |
| 3650 | + | |
| 3651 | + | |
| 3652 | +typedef struct CK_SSL3_KEY_MAT_OUT { | |
| 3653 | + CK_OBJECT_HANDLE hClientMacSecret; | |
| 3654 | + CK_OBJECT_HANDLE hServerMacSecret; | |
| 3655 | + CK_OBJECT_HANDLE hClientKey; | |
| 3656 | + CK_OBJECT_HANDLE hServerKey; | |
| 3657 | + CK_BYTE_PTR pIVClient; | |
| 3658 | + CK_BYTE_PTR pIVServer; | |
| 3659 | +} CK_SSL3_KEY_MAT_OUT; | |
| 3660 | + | |
| 3661 | +typedef CK_SSL3_KEY_MAT_OUT CK_PTR CK_SSL3_KEY_MAT_OUT_PTR; | |
| 3662 | + | |
| 3663 | + | |
| 3664 | +typedef struct CK_SSL3_KEY_MAT_PARAMS { | |
| 3665 | + CK_ULONG ulMacSizeInBits; | |
| 3666 | + CK_ULONG ulKeySizeInBits; | |
| 3667 | + CK_ULONG ulIVSizeInBits; | |
| 3668 | + CK_BBOOL bIsExport; | |
| 3669 | + CK_SSL3_RANDOM_DATA RandomInfo; | |
| 3670 | + CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial; | |
| 3671 | +} CK_SSL3_KEY_MAT_PARAMS; | |
| 3672 | + | |
| 3673 | +typedef CK_SSL3_KEY_MAT_PARAMS CK_PTR CK_SSL3_KEY_MAT_PARAMS_PTR; | |
| 3674 | + | |
| 3675 | + | |
| 3676 | +typedef struct CK_KEY_DERIVATION_STRING_DATA { | |
| 3677 | + CK_BYTE_PTR pData; | |
| 3678 | + CK_ULONG ulLen; | |
| 3679 | +} CK_KEY_DERIVATION_STRING_DATA; | |
| 3680 | + | |
| 3681 | +typedef CK_KEY_DERIVATION_STRING_DATA CK_PTR \ | |
| 3682 | + CK_KEY_DERIVATION_STRING_DATA_PTR; | |
| 3683 | + | |
| 3684 | + | |
| 3685 | +/* The CK_EXTRACT_PARAMS is used for the | |
| 3686 | + * CKM_EXTRACT_KEY_FROM_KEY mechanism. It specifies which bit | |
| 3687 | + * of the base key should be used as the first bit of the | |
| 3688 | + * derived key */ | |
| 3689 | +/* CK_EXTRACT_PARAMS is new for v2.0 */ | |
| 3690 | +typedef CK_ULONG CK_EXTRACT_PARAMS; | |
| 3691 | + | |
| 3692 | +typedef CK_EXTRACT_PARAMS CK_PTR CK_EXTRACT_PARAMS_PTR; | |
| 3693 | + | |
| 3694 | +/* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is new for v2.10. | |
| 3695 | + * CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE is used to | |
| 3696 | + * indicate the Pseudo-Random Function (PRF) used to generate | |
| 3697 | + * key bits using PKCS #5 PBKDF2. */ | |
| 3698 | +typedef CK_ULONG CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE; | |
| 3699 | + | |
| 3700 | +typedef CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE CK_PTR CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE_PTR; | |
| 3701 | + | |
| 3702 | +/* The following PRFs are defined in PKCS #5 v2.0. */ | |
| 3703 | +#define CKP_PKCS5_PBKD2_HMAC_SHA1 0x00000001 | |
| 3704 | + | |
| 3705 | + | |
| 3706 | +/* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is new for v2.10. | |
| 3707 | + * CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the | |
| 3708 | + * source of the salt value when deriving a key using PKCS #5 | |
| 3709 | + * PBKDF2. */ | |
| 3710 | +typedef CK_ULONG CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE; | |
| 3711 | + | |
| 3712 | +typedef CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE CK_PTR CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE_PTR; | |
| 3713 | + | |
| 3714 | +/* The following salt value sources are defined in PKCS #5 v2.0. */ | |
| 3715 | +#define CKZ_SALT_SPECIFIED 0x00000001 | |
| 3716 | + | |
| 3717 | +/* CK_PKCS5_PBKD2_PARAMS is new for v2.10. | |
| 3718 | + * CK_PKCS5_PBKD2_PARAMS is a structure that provides the | |
| 3719 | + * parameters to the CKM_PKCS5_PBKD2 mechanism. */ | |
| 3720 | +typedef struct CK_PKCS5_PBKD2_PARAMS { | |
| 3721 | + CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource; | |
| 3722 | + CK_VOID_PTR pSaltSourceData; | |
| 3723 | + CK_ULONG ulSaltSourceDataLen; | |
| 3724 | + CK_ULONG iterations; | |
| 3725 | + CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf; | |
| 3726 | + CK_VOID_PTR pPrfData; | |
| 3727 | + CK_ULONG ulPrfDataLen; | |
| 3728 | + CK_UTF8CHAR_PTR pPassword; | |
| 3729 | + CK_ULONG_PTR ulPasswordLen; | |
| 3730 | +} CK_PKCS5_PBKD2_PARAMS; | |
| 3731 | + | |
| 3732 | +typedef CK_PKCS5_PBKD2_PARAMS CK_PTR CK_PKCS5_PBKD2_PARAMS_PTR; | |
| 3733 | + | |
| 3734 | +#endif | |
| 3735 | diff -udrNP putty-0.58.orig/rsaref/unix.h putty-0.58/rsaref/unix.h | |
| 3736 | --- putty-0.58.orig/rsaref/unix.h 1970-01-01 01:00:00.000000000 +0100 | |
| 3737 | +++ putty-0.58/rsaref/unix.h 2005-06-06 11:50:58.487734144 +0200 | |
| 3738 | @@ -0,0 +1,24 @@ | |
| 3739 | + | |
| 3740 | + | |
| 3741 | +#ifndef UNIX_H | |
| 3742 | +#define UNIX_H | |
| 3743 | + | |
| 3744 | +#define CK_PTR * | |
| 3745 | + | |
| 3746 | +#define CK_DEFINE_FUNCTION(returnType, name) \ | |
| 3747 | + returnType name | |
| 3748 | + | |
| 3749 | +#define CK_DECLARE_FUNCTION(returnType, name) \ | |
| 3750 | + returnType name | |
| 3751 | + | |
| 3752 | +#define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ | |
| 3753 | + returnType (* name) | |
| 3754 | + | |
| 3755 | +#define CK_CALLBACK_FUNCTION(returnType, name) \ | |
| 3756 | + returnType (* name) | |
| 3757 | + | |
| 3758 | +#ifndef NULL_PTR | |
| 3759 | +#define NULL_PTR 0 | |
| 3760 | +#endif | |
| 3761 | + | |
| 3762 | +#endif | |
| 3763 | diff -udrNP putty-0.58.orig/rsaref/win32.h putty-0.58/rsaref/win32.h | |
| 3764 | --- putty-0.58.orig/rsaref/win32.h 1970-01-01 01:00:00.000000000 +0100 | |
| 3765 | +++ putty-0.58/rsaref/win32.h 2005-06-06 11:50:58.487734144 +0200 | |
| 3766 | @@ -0,0 +1,24 @@ | |
| 3767 | + | |
| 3768 | + | |
| 3769 | +#ifndef WIN32_H | |
| 3770 | +#define WIN32_H | |
| 3771 | + | |
| 3772 | +#define CK_PTR * | |
| 3773 | + | |
| 3774 | +#define CK_DEFINE_FUNCTION(returnType, name) \ | |
| 3775 | + returnType __declspec(dllexport) name | |
| 3776 | + | |
| 3777 | +#define CK_DECLARE_FUNCTION(returnType, name) \ | |
| 3778 | + returnType __declspec(dllexport) name | |
| 3779 | + | |
| 3780 | +#define CK_DECLARE_FUNCTION_POINTER(returnType, name) \ | |
| 3781 | + returnType __declspec(dllimport) (* name) | |
| 3782 | + | |
| 3783 | +#define CK_CALLBACK_FUNCTION(returnType, name) \ | |
| 3784 | + returnType (* name) | |
| 3785 | + | |
| 3786 | +#ifndef NULL_PTR | |
| 3787 | +#define NULL_PTR 0 | |
| 3788 | +#endif | |
| 3789 | + | |
| 3790 | +#endif | |
| 3791 | diff -udrNP putty-0.58.orig/settings.c putty-0.58/settings.c | |
| 3792 | --- putty-0.58.orig/settings.c 2005-04-05 21:37:51.000000000 +0200 | |
| 3793 | +++ putty-0.58/settings.c 2005-06-06 11:50:58.488733992 +0200 | |
| 3794 | @@ -243,11 +243,16 @@ | |
| 2493 | diff -urNp putty-0.58.org/Recipe putty-0.58+smartcard/Recipe | |
| 2494 | --- putty-0.58.org/Recipe 2005-04-05 22:37:51.000000000 +0300 | |
| 2495 | +++ putty-0.58+smartcard/Recipe 2005-06-06 13:14:36.000000000 +0300 | |
| 2496 | @@ -205,7 +205,7 @@ NONSSH = telnet raw rlogin ldisc pinge | |
| 2497 | # SSH back end (putty, plink, pscp, psftp). | |
| 2498 | SSH = ssh sshcrc sshdes sshmd5 sshrsa sshrand sshsha sshblowf | |
| 2499 | + sshdh sshcrcda sshpubk sshzlib sshdss x11fwd portfwd | |
| 2500 | - + sshaes sshsh512 sshbn wildcard pinger | |
| 2501 | + + sshaes sshsh512 sshbn wildcard pinger libpkcs11 sshscard local_cmd | |
| 2502 | WINSSH = SSH winnoise winpgntc | |
| 2503 | UXSSH = SSH uxnoise uxagentc | |
| 2504 | MACSSH = SSH macnoise | |
| 2505 | @@ -252,7 +252,7 @@ psftp : [C] psftp winsftp wincons WIN | |
| 2506 | ||
| 2507 | pageant : [G] winpgnt sshrsa sshpubk sshdes sshbn sshmd5 version tree234 | |
| 2508 | + misc sshaes sshsha winpgntc sshdss sshsh512 winutils winmisc | |
| 2509 | - + pageant.res LIBS | |
| 2510 | + + pageant.res libpkcs11 sshscard LIBS | |
| 2511 | ||
| 2512 | puttygen : [G] winpgen sshrsag sshdssg sshprime sshdes sshbn sshmd5 version | |
| 2513 | + sshrand winnoise sshsha winstore misc winctrls sshrsa sshdss winmisc | |
| 2514 | diff -urNp putty-0.58.org/settings.c putty-0.58+smartcard/settings.c | |
| 2515 | --- putty-0.58.org/settings.c 2005-04-05 22:37:51.000000000 +0300 | |
| 2516 | +++ putty-0.58+smartcard/settings.c 2005-06-06 12:50:58.000000000 +0300 | |
| 2517 | @@ -243,11 +243,16 @@ void save_open_settings(void *sesskey, i | |
| 3795 | 2518 | write_setting_s(sesskey, "RekeyBytes", cfg->ssh_rekey_data); |
| 3796 | 2519 | write_setting_i(sesskey, "AuthTIS", cfg->try_tis_auth); |
| … | … | |
| 3809 | 2532 | write_setting_i(sesskey, "PassiveTelnet", cfg->passive_telnet); |
| 3810 | 2533 | write_setting_i(sesskey, "BackspaceIsDelete", cfg->bksp_is_delete); |
| 3811 | @@ -538,10 +543,17 @@ |
|
| 2534 | @@ -538,10 +543,17 @@ void load_open_settings(void *sesskey, i | |
| 3812 | 2535 | gppi(sesskey, "SSH2DES", 0, &cfg->ssh2_des_cbc); |
| 3813 | 2536 | gppi(sesskey, "AuthTIS", 0, &cfg->try_tis_auth); |
| … | … | |
| 3827 | 2550 | gppi(sesskey, "PassiveTelnet", 0, &cfg->passive_telnet); |
| 3828 | 2551 | gppi(sesskey, "BackspaceIsDelete", 1, &cfg->bksp_is_delete); |
| 3829 | diff -u |
|
| 3830 | --- putty-0.58.or |
|
| 3831 | +++ putty-0.58 |
|
| 2552 | diff -urNp putty-0.58.org/smartcard.ppk putty-0.58+smartcard/smartcard.ppk | |
| 2553 | --- putty-0.58.org/smartcard.ppk 1970-01-01 02:00:00.000000000 +0200 | |
| 2554 | +++ putty-0.58+smartcard/smartcard.ppk 2005-06-06 22:39:23.000000000 +0300 | |
| 3832 | 2555 | @@ -0,0 +1,2 @@ |
| 3833 | 2556 | +PuTTY-User-Smartcard-Key-File- |
| 3834 | 2557 | +Testing |
| 3835 | diff -u |
|
| 3836 | --- putty-0.58.or |
|
| 3837 | +++ putty-0.58 |
|
| 2558 | diff -urNp putty-0.58.org/ssh.c putty-0.58+smartcard/ssh.c | |
| 2559 | --- putty-0.58.org/ssh.c 2005-04-05 22:37:51.000000000 +0300 | |
| 2560 | +++ putty-0.58+smartcard/ssh.c 2008-03-15 20:37:28.000000000 +0200 | |
| 3838 | 2561 | @@ -6,6 +6,11 @@ |
| 3839 | 2562 | #include "putty.h" |
| 3840 | 2563 | #include "tree234.h" |
| 3841 | 2564 | #include "ssh.h" |
| 3842 | +#include "p |
|
| 2565 | +#include "ppkcs11.h" | |
| 3843 | 2566 | +#include "sshscard.h" |
| 3844 | 2567 | + |
| … | … | |
| 3848 | 2571 | #ifndef FALSE |
| 3849 | 2572 | #define FALSE 0 |
| 3850 | @@ -772,7 +777,20 @@ | |
| 2573 | @@ -316,7 +321,6 @@ enum { | |
| 2574 | #define crWaitUntil(c) do { crReturn(0); } while (!(c)) | |
| 2575 | #define crWaitUntilV(c) do { crReturnV; } while (!(c)) | |
| 2576 | ||
| 2577 | -typedef struct ssh_tag *Ssh; | |
| 2578 | struct Packet; | |
| 2579 | ||
| 2580 | static struct Packet *ssh2_pkt_init(int pkt_type); | |
| 2581 | @@ -565,8 +569,8 @@ static void ssh2_add_channel_data(struct | |
| 2582 | static void ssh_throttle_all(Ssh ssh, int enable, int bufsize); | |
| 2583 | static void ssh2_set_window(struct ssh_channel *c, unsigned newwin); | |
| 2584 | static int ssh_sendbuffer(void *handle); | |
| 2585 | -static int ssh_do_close(Ssh ssh, int notify_exit); | |
| 2586 | -static unsigned long ssh_pkt_getuint32(struct Packet *pkt); | |
| 2587 | +int ssh_do_close(Ssh ssh, int notify_exit); | |
| 2588 | +unsigned long ssh_pkt_getuint32(struct Packet *pkt); | |
| 2589 | static int ssh2_pkt_getbool(struct Packet *pkt); | |
| 2590 | static void ssh_pkt_getstring(struct Packet *pkt, char **p, int *length); | |
| 2591 | static void ssh2_timer(void *ctx, long now); | |
| 2592 | @@ -772,7 +776,20 @@ struct ssh_tag { | |
| 3851 | 2593 | char *deferred_rekey_reason; /* points to STATIC string; don't free */ |
| 3852 | 2594 | }; |
| … | … | |
| 3869 | 2611 | /* logevent, only printf-formatted. */ |
| 3870 | 2612 | static void logeventf(Ssh ssh, const char *fmt, ...) |
| 3871 | @@ -2438,6 +2456,12 @@ | |
| 2613 | @@ -1903,7 +1920,7 @@ static void sha_mpint(SHA_State * s, Big | |
| 2614 | /* | |
| 2615 | * Packet decode functions for both SSH-1 and SSH-2. | |
| 2616 | */ | |
| 2617 | -static unsigned long ssh_pkt_getuint32(struct Packet *pkt) | |
| 2618 | +unsigned long ssh_pkt_getuint32(struct Packet *pkt) | |
| 2619 | { | |
| 2620 | unsigned long value; | |
| 2621 | if (pkt->length - pkt->savedpos < 4) | |
| 2622 | @@ -2438,7 +2455,13 @@ static void ssh_gotdata(Ssh ssh, unsigne | |
| 3872 | 2623 | crFinishV; |
| 3873 | 2624 | } |
| 3874 | 2625 | |
| 2626 | -static int ssh_do_close(Ssh ssh, int notify_exit) | |
| 3875 | 2627 | +void do_close(void * ssh) { |
| 3876 | 2628 | + // logevent("closing"); |
| … | … | |
| 3879 | 2631 | + |
| 3880 | 2632 | + |
| 3881 | ||
| 2633 | +int ssh_do_close(Ssh ssh, int notify_exit) | |
| 3882 | 2634 | { |
| 3883 | 2635 | int ret = 0; |
| 3884 | @@ -6274,7 +6298,7 @@ | |
| 2636 | struct ssh_channel *c; | |
| 2637 | @@ -6274,7 +6297,7 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3885 | 2638 | { |
| 3886 | 2639 | struct do_ssh2_authconn_state { |
| … | … | |
| 3891 | 2644 | AUTH_KEYBOARD_INTERACTIVE |
| 3892 | 2645 | } method; |
| 3893 | @@ -6287,8 +631 |
|
| 2646 | @@ -6287,8 +6310,9 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3894 | 2647 | AUTH_TYPE_KEYBOARD_INTERACTIVE, |
| 3895 | 2648 | AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET |
| … | … | |
| 3903 | 2656 | int we_are_in; |
| 3904 | 2657 | int num_prompts, curr_prompt, echo; |
| 3905 | @@ -6421,6 +644 |
|
| 2658 | @@ -6421,6 +6445,7 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3906 | 2659 | s->tried_agent = FALSE; |
| 3907 | 2660 | s->kbd_inter_running = FALSE; |
| … | … | |
| 3911 | 2664 | if (!filename_is_null(ssh->cfg.keyfile)) { |
| 3912 | 2665 | int keytype; |
| 3913 | @@ -6444,9 +64 |
|
| 2666 | @@ -6444,9 +6469,21 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3914 | 2667 | s->publickey_blob = NULL; |
| 3915 | 2668 | } |
| … | … | |
| 3935 | 2688 | * Wait for the result of the last authentication request. |
| 3936 | 2689 | */ |
| 3937 | @@ -6559,6 +659 |
|
| 2690 | @@ -6559,6 +6596,7 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3938 | 2691 | |
| 3939 | 2692 | s->can_pubkey = |
| … | … | |
| 3943 | 2696 | in_commasep_string("password", methods, methlen); |
| 3944 | 2697 | s->can_keyb_inter = ssh->cfg.try_ki_auth && |
| 3945 | @@ -6743,13 +678 |
|
| 2698 | @@ -6743,13 +6781,13 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3946 | 2699 | sfree(s->response); |
| 3947 | 2700 | } |
| … | … | |
| 3960 | 2713 | ssh->pkt_ctx &= ~SSH2_PKTCTX_AUTH_MASK; |
| 3961 | 2714 | ssh->pkt_ctx |= SSH2_PKTCTX_PUBLICKEY; |
| 3962 | @@ -6760,12 +679 |
|
| 2715 | @@ -6760,12 +6798,27 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3963 | 2716 | * First, offer the public blob to see if the server is |
| 3964 | 2717 | * willing to accept it. |
| … | … | |
| 3988 | 2741 | ssh2_pkt_addstring(s->pktout, s->username); |
| 3989 | 2742 | ssh2_pkt_addstring(s->pktout, "ssh-connection"); /* service requested */ |
| 3990 | @@ -6790,20 +684 |
|
| 2743 | @@ -6790,20 +6843,30 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 3991 | 2744 | * Actually attempt a serious authentication using |
| 3992 | 2745 | * the key. |
| … | … | |
| 4027 | 2780 | } |
| 4028 | 2781 | |
| 4029 | @@ -6947,24 +701 |
|
| 2782 | @@ -6947,24 +7010,38 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 4030 | 2783 | } |
| 4031 | 2784 | } |
| … | … | |
| 4073 | 2826 | /* Send a spurious AUTH_NONE to return to the top. */ |
| 4074 | 2827 | s->pktout = ssh2_pkt_init(SSH2_MSG_USERAUTH_REQUEST); |
| 4075 | @@ -7015,14 +709 |
|
| 2828 | @@ -7015,14 +7092,26 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 4076 | 2829 | s->pktout->length - 5); |
| 4077 | 2830 | p += s->pktout->length - 5; |
| … | … | |
| 4100 | 2853 | s->type = AUTH_TYPE_PUBLICKEY; |
| 4101 | 2854 | key->alg->freekey(key->data); |
| 4102 | @@ -7233,6 +732 |
|
| 2855 | @@ -7233,6 +7322,14 @@ static void do_ssh2_authconn(Ssh ssh, un | |
| 4103 | 2856 | } |
| 4104 | 2857 | |
| … | … | |
| 4115 | 2868 | */ |
| 4116 | 2869 | if (ssh->mainchan && !ssh->cfg.nopty) { |
| 4117 | diff -u |
|
| 4118 | --- putty-0.58.or |
|
| 4119 | +++ putty-0.58 |
|
| 4120 | @@ -11,6 +11,10 @@ |
|
| 2870 | diff -urNp putty-0.58.org/ssh.h putty-0.58+smartcard/ssh.h | |
| 2871 | --- putty-0.58.org/ssh.h 2005-04-05 22:37:51.000000000 +0300 | |
| 2872 | +++ putty-0.58+smartcard/ssh.h 2005-06-06 13:06:34.000000000 +0300 | |
| 2873 | @@ -11,6 +11,10 @@ struct ssh_channel; | |
| 4121 | 2874 | extern void sshfwd_close(struct ssh_channel *c); |
| 4122 | 2875 | extern int sshfwd_write(struct ssh_channel *c, char *, int); |
| … | … | |
| 4129 | 2882 | /* |
| 4130 | 2883 | * Useful thing. |
| 4131 | @@ -378,7 +382,8 @@ |
|
| 2884 | @@ -378,7 +382,8 @@ enum { | |
| 4132 | 2885 | SSH_KEYTYPE_UNOPENABLE, |
| 4133 | 2886 | SSH_KEYTYPE_UNKNOWN, |
| … | … | |
| 4139 | 2892 | int key_type(const Filename *filename); |
| 4140 | 2893 | char *key_type_to_str(int type); |
| 4141 | diff -u |
|
| 4142 | --- putty-0.58.or |
|
| 4143 | +++ putty-0.58 |
|
| 4144 | @@ -1182,6 +1182,7 @@ |
|
| 2894 | diff -urNp putty-0.58.org/sshpubk.c putty-0.58+smartcard/sshpubk.c | |
| 2895 | --- putty-0.58.org/sshpubk.c 2005-04-05 22:37:51.000000000 +0300 | |
| 2896 | +++ putty-0.58+smartcard/sshpubk.c 2005-06-06 12:51:02.000000000 +0300 | |
| 2897 | @@ -1182,6 +1182,7 @@ int key_type(const Filename *filename) | |
| 4145 | 2898 | const char putty2_sig[] = "PuTTY-User-Key-File-"; |
| 4146 | 2899 | const char sshcom_sig[] = "---- BEGIN SSH2 ENCRYPTED PRIVAT"; |
| … | … | |
| 4150 | 2903 | |
| 4151 | 2904 | fp = f_open(*filename, "r"); |
| 4152 | @@ -1199,6 +1200,8 @@ |
|
| 2905 | @@ -1199,6 +1200,8 @@ int key_type(const Filename *filename) | |
| 4153 | 2906 | return SSH_KEYTYPE_SSH2; |
| 4154 | 2907 | if (!memcmp(buf, openssh_sig, sizeof(openssh_sig)-1)) |
| … | … | |
| 4159 | 2912 | return SSH_KEYTYPE_SSHCOM; |
| 4160 | 2913 | return SSH_KEYTYPE_UNKNOWN; /* unrecognised or EOF */ |
| 4161 | diff -u |
|
| 4162 | --- putty-0.58.or |
|
| 4163 | +++ putty-0.58 |
|
| 2914 | diff -urNp putty-0.58.org/sshrsa.h putty-0.58+smartcard/sshrsa.h | |
| 2915 | --- putty-0.58.org/sshrsa.h 1970-01-01 02:00:00.000000000 +0200 | |
| 2916 | +++ putty-0.58+smartcard/sshrsa.h 2005-06-06 12:50:58.000000000 +0300 | |
| 4164 | 2917 | @@ -0,0 +1,14 @@ |
| 4165 | 2918 | + |
| … | … | |
| 4177 | 2930 | + |
| 4178 | 2931 | + |
| 4179 | diff -u |
|
| 4180 | --- putty-0.58.or |
|
| 4181 | +++ putty-0.58 |
|
| 2932 | diff -urNp putty-0.58.org/sshscard.c putty-0.58+smartcard/sshscard.c | |
| 2933 | --- putty-0.58.org/sshscard.c 1970-01-01 02:00:00.000000000 +0200 | |
| 2934 | +++ putty-0.58+smartcard/sshscard.c 2008-03-15 20:33:48.000000000 +0200 | |
| 4182 | 2935 | @@ -0,0 +1,387 @@ |
| 4183 | 2936 | +#include "ssh.h" |
| 4184 | 2937 | +#include "sshrsa.h" |
| 4185 | +#include "p |
|
| 2938 | +#include "ppkcs11.h" | |
| 4186 | 2939 | +#include "sshscard.h" |
| 4187 | 2940 | +#include "putty.h" |
| … | … | |
| 4292 | 3045 | + char * keylabel=NULL; |
| 4293 | 3046 | + /* again, need to get keylabel from file */ |
| 4294 | + return ssh2_load_pkcs11key(keylabel,passphrase |
|
| 3047 | + return ssh2_load_pkcs11key(keylabel,passphrase); | |
| 4295 | 3048 | +} |
| 4296 | 3049 | + |
| … | … | |
| 4415 | 3168 | + /* session is currently static - only one smartcard key can be loaded */ |
| 4416 | 3169 | + |
| 4417 | + return ssh2_userkey_loadpkcs11pub( keylabel, algorithm, pub_blob_len |
|
| 3170 | + return ssh2_userkey_loadpkcs11pub( keylabel, algorithm, pub_blob_len); | |
| 4418 | 3171 | +} |
| 4419 | 3172 | + |
| … | … | |
| 4568 | 3321 | +} |
| 4569 | 3322 | + |
| 4570 | diff -u |
|
| 4571 | --- putty-0.58.or |
|
| 4572 | +++ putty-0.58 |
|
| 3323 | diff -urNp putty-0.58.org/sshscard.h putty-0.58+smartcard/sshscard.h | |
| 3324 | --- putty-0.58.org/sshscard.h 1970-01-01 02:00:00.000000000 +0200 | |
| 3325 | +++ putty-0.58+smartcard/sshscard.h 2005-06-06 12:50:58.000000000 +0300 | |
| 4573 | 3326 | @@ -0,0 +1,15 @@ |
| 4574 | 3327 | + |
| … | … | |
| 4587 | 3340 | +#endif |
| 4588 | 3341 | + |
| 4589 | diff -u |
|
| 4590 | --- putty-0.58.or |
|
| 4591 | +++ putty-0.58 |
|
| 4592 | @@ -101,54 +101,57 @@ |
|
| 3342 | diff -urNp putty-0.58.org/unix/Makefile.gtk putty-0.58+smartcard/unix/Makefile.gtk | |
| 3343 | --- putty-0.58.org/unix/Makefile.gtk 2005-04-05 22:40:17.000000000 +0300 | |
| 3344 | +++ putty-0.58+smartcard/unix/Makefile.gtk 2008-03-15 20:49:45.000000000 +0200 | |
| 3345 | @@ -101,54 +101,57 @@ man1dir=$(mandir)/man1 | |
| 4593 | 3346 | |
| 4594 | 3347 | all: plink pscp psftp pterm putty puttygen puttytel |
| … | … | |
| 4685 | 3438 | pterm: be_none.o cmdline.o config.o dialog.o fromucs.o gtkcfg.o gtkcols.o \ |
| 4686 | 3439 | gtkdlg.o gtkpanel.o gtkwin.o ldisc.o ldiscucs.o localenc.o \ |
| 4687 | @@ -168,28 +171,29 @@ |
|
| 3440 | @@ -168,28 +171,29 @@ pterm: be_none.o cmdline.o config.o dial | |
| 4688 | 3441 | |
| 4689 | 3442 | putty: be_all.o cmdline.o config.o cproxy.o dialog.o fromucs.o gtkcfg.o \ |
| … | … | |
| 4731 | 3484 | puttygen: cmdgen.o import.o misc.o notiming.o sshaes.o sshbn.o sshdes.o \ |
| 4732 | 3485 | sshdss.o sshdssg.o sshmd5.o sshprime.o sshpubk.o sshrand.o \ |
| 4733 | @@ -300,6 +304,1 |
|
| 3486 | @@ -300,6 +304,10 @@ ldiscucs.o: ../ldiscucs.c ../putty.h ../ | |
| 4734 | 3487 | ../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \ |
| 4735 | 3488 | ../puttymem.h ../windows/winhelp.h ../charset/charset.h |
| 4736 | 3489 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../ldiscucs.c |
| 4737 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../rsaref/win32.h ../rsaref/pkcs11.h \ | |
| 4738 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h | |
| 3490 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../ppkcs11.h | |
| 4739 | 3491 | + $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../libpkcs11.c |
| 4740 | 3492 | +local_cmd.o: ../local_cmd.c |
| … | … | |
| 4743 | 3495 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../charset/localenc.c |
| 4744 | 3496 | logging.o: ../logging.c ../putty.h ../puttyps.h ../network.h ../misc.h \ |
| 4745 | @@ -507, |
|
| 3497 | @@ -507,8 +515,9 @@ sizetip.o: ../windows/sizetip.c ../putty | |
| 4746 | 3498 | slookup.o: ../charset/slookup.c ../charset/charset.h ../charset/internal.h \ |
| 4747 | 3499 | ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c |
| … | … | |
| 4749 | 3501 | -ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../puttyps.h ../network.h \ |
| 4750 | 3502 | - ../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \ |
| 4751 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ |
|
| 3503 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 4752 | 3504 | + ../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \ |
| 4753 | + ../ |
|
| 3505 | + ../windows/winstuff.h \ | |
| 4754 | 3506 | ../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \ |
| 4755 | ||
| 4756 | 3507 | ../windows/winhelp.h ../charset/charset.h |
| 4757 | 3508 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../ssh.c |
| 4758 | sshaes.o: ../sshaes.c ../ssh.h ../puttymem.h ../network.h ../int64.h \ | |
| 4759 | @@ -559,6 +570,14 @@ | |
| 3509 | @@ -559,6 +568,13 @@ sshrsa.o: ../sshrsa.c ../ssh.h ../misc.h | |
| 4760 | 3510 | sshrsag.o: ../sshrsag.c ../ssh.h ../puttymem.h ../network.h ../int64.h \ |
| 4761 | 3511 | ../misc.h |
| 4762 | 3512 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../sshrsag.c |
| 4763 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ |
|
| 3513 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 4764 | 3514 | + ../putty.h ../puttymem.h ../network.h ../int64.h ../misc.h \ |
| 4765 | + ../rsaref/win32.h ../rsaref/pkcs11.h ../puttyps.h \ | |
| 4766 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h \ | |
| 3515 | + ../puttyps.h \ | |
| 4767 | 3516 | + ../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \ |
| 4768 | 3517 | + ../unix/unix.h ../tree234.h ../windows/winhelp.h \ |
| … | … | |
| 4772 | 3521 | ../misc.h |
| 4773 | 3522 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../sshsh512.c |
| 4774 | @@ -770,9 +78 |
|
| 3523 | @@ -770,9 +786,10 @@ winpgen.o: ../windows/winpgen.c ../putty | |
| 4775 | 3524 | ../charset/charset.h |
| 4776 | 3525 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../windows/winpgen.c |
| … | … | |
| 4786 | 3535 | winpgntc.o: ../windows/winpgntc.c ../putty.h ../puttyps.h ../network.h \ |
| 4787 | 3536 | ../misc.h ../windows/winstuff.h ../mac/macstuff.h \ |
| 4788 | diff -udrNP putty-0.58.orig/windows/MSVC/pageant/pageant.dsp putty-0.58/windows/MSVC/pageant/pageant.dsp | |
| 4789 | --- putty-0.58.orig/windows/MSVC/pageant/pageant.dsp 2005-06-06 11:51:12.620585624 +0200 | |
| 4790 | +++ putty-0.58/windows/MSVC/pageant/pageant.dsp 2005-06-06 12:14:39.378725880 +0200 | |
| 4791 | @@ -94,6 +94,10 @@ | |
| 4792 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" | |
| 4793 | # Begin Source File | |
| 4794 | ||
| 4795 | +SOURCE=..\..\..\libpkcs11.c | |
| 4796 | +# End Source File | |
| 4797 | +# Begin Source File | |
| 4798 | + | |
| 4799 | SOURCE=..\..\..\misc.c | |
| 4800 | # End Source File | |
| 4801 | # Begin Source File | |
| 4802 | @@ -126,6 +130,10 @@ | |
| 4803 | # End Source File | |
| 4804 | # Begin Source File | |
| 4805 | ||
| 4806 | +SOURCE=..\..\..\sshscard.c | |
| 4807 | +# End Source File | |
| 4808 | +# Begin Source File | |
| 4809 | + | |
| 4810 | SOURCE=..\..\..\sshsh512.c | |
| 4811 | # End Source File | |
| 4812 | # Begin Source File | |
| 4813 | @@ -186,6 +194,10 @@ | |
| 4814 | # End Source File | |
| 4815 | # Begin Source File | |
| 4816 | ||
| 4817 | +SOURCE=..\..\..\pkcs11.h | |
| 4818 | +# End Source File | |
| 4819 | +# Begin Source File | |
| 4820 | + | |
| 4821 | SOURCE=..\..\..\putty.h | |
| 4822 | # End Source File | |
| 4823 | # Begin Source File | |
| 4824 | @@ -198,10 +210,38 @@ | |
| 4825 | # End Source File | |
| 4826 | # Begin Source File | |
| 4827 | ||
| 4828 | +SOURCE=..\..\..\rsaref\pkcs11.h | |
| 4829 | +# End Source File | |
| 4830 | +# Begin Source File | |
| 4831 | + | |
| 4832 | +SOURCE=..\..\..\rsaref\pkcs11f.h | |
| 4833 | +# End Source File | |
| 4834 | +# Begin Source File | |
| 4835 | + | |
| 4836 | +SOURCE=..\..\..\rsaref\pkcs11t.h | |
| 4837 | +# End Source File | |
| 4838 | +# Begin Source File | |
| 4839 | + | |
| 4840 | +SOURCE=..\..\..\rsaref\unix.h | |
| 4841 | +# End Source File | |
| 4842 | +# Begin Source File | |
| 4843 | + | |
| 4844 | +SOURCE=..\..\..\rsaref\win32.h | |
| 4845 | +# End Source File | |
| 4846 | +# Begin Source File | |
| 4847 | + | |
| 4848 | SOURCE=..\..\..\ssh.h | |
| 4849 | # End Source File | |
| 4850 | # Begin Source File | |
| 4851 | ||
| 4852 | +SOURCE=..\..\..\sshrsa.h | |
| 4853 | +# End Source File | |
| 4854 | +# Begin Source File | |
| 4855 | + | |
| 4856 | +SOURCE=..\..\..\sshscard.h | |
| 4857 | +# End Source File | |
| 4858 | +# Begin Source File | |
| 4859 | + | |
| 4860 | SOURCE=..\..\..\tree234.h | |
| 4861 | # End Source File | |
| 4862 | # Begin Source File | |
| 4863 | diff -udrNP putty-0.58.orig/windows/MSVC/plink/plink.dsp putty-0.58/windows/MSVC/plink/plink.dsp | |
| 4864 | --- putty-0.58.orig/windows/MSVC/plink/plink.dsp 2005-06-06 11:51:12.622585320 +0200 | |
| 4865 | +++ putty-0.58/windows/MSVC/plink/plink.dsp 2005-06-06 12:14:39.379725728 +0200 | |
| 4866 | @@ -110,6 +110,14 @@ | |
| 4867 | # End Source File | |
| 4868 | # Begin Source File | |
| 4869 | ||
| 4870 | +SOURCE=..\..\..\libpkcs11.c | |
| 4871 | +# End Source File | |
| 4872 | +# Begin Source File | |
| 4873 | + | |
| 4874 | +SOURCE=..\..\..\local_cmd.c | |
| 4875 | +# End Source File | |
| 4876 | +# Begin Source File | |
| 4877 | + | |
| 4878 | SOURCE=..\..\..\logging.c | |
| 4879 | # End Source File | |
| 4880 | # Begin Source File | |
| 4881 | @@ -207,6 +215,10 @@ | |
| 4882 | # End Source File | |
| 4883 | # Begin Source File | |
| 4884 | ||
| 4885 | +SOURCE=..\..\..\sshscard.c | |
| 4886 | +# End Source File | |
| 4887 | +# Begin Source File | |
| 4888 | + | |
| 4889 | SOURCE=..\..\..\sshsh512.c | |
| 4890 | # End Source File | |
| 4891 | # Begin Source File | |
| 4892 | @@ -311,6 +323,10 @@ | |
| 4893 | # End Source File | |
| 4894 | # Begin Source File | |
| 4895 | ||
| 4896 | +SOURCE=..\..\..\pkcs11.h | |
| 4897 | +# End Source File | |
| 4898 | +# Begin Source File | |
| 4899 | + | |
| 4900 | SOURCE=..\..\..\proxy.h | |
| 4901 | # End Source File | |
| 4902 | # Begin Source File | |
| 4903 | @@ -327,10 +343,38 @@ | |
| 4904 | # End Source File | |
| 4905 | # Begin Source File | |
| 4906 | ||
| 4907 | +SOURCE=..\..\..\rsaref\pkcs11.h | |
| 4908 | +# End Source File | |
| 4909 | +# Begin Source File | |
| 4910 | + | |
| 4911 | +SOURCE=..\..\..\rsaref\pkcs11f.h | |
| 4912 | +# End Source File | |
| 4913 | +# Begin Source File | |
| 4914 | + | |
| 4915 | +SOURCE=..\..\..\rsaref\pkcs11t.h | |
| 4916 | +# End Source File | |
| 4917 | +# Begin Source File | |
| 4918 | + | |
| 4919 | +SOURCE=..\..\..\rsaref\unix.h | |
| 4920 | +# End Source File | |
| 4921 | +# Begin Source File | |
| 4922 | + | |
| 4923 | +SOURCE=..\..\..\rsaref\win32.h | |
| 4924 | +# End Source File | |
| 4925 | +# Begin Source File | |
| 4926 | + | |
| 4927 | SOURCE=..\..\..\ssh.h | |
| 4928 | # End Source File | |
| 4929 | # Begin Source File | |
| 4930 | ||
| 4931 | +SOURCE=..\..\..\sshrsa.h | |
| 4932 | +# End Source File | |
| 4933 | +# Begin Source File | |
| 4934 | + | |
| 4935 | +SOURCE=..\..\..\sshscard.h | |
| 4936 | +# End Source File | |
| 4937 | +# Begin Source File | |
| 4938 | + | |
| 4939 | SOURCE=..\..\..\storage.h | |
| 4940 | # End Source File | |
| 4941 | # Begin Source File | |
| 4942 | diff -udrNP putty-0.58.orig/windows/MSVC/pscp/pscp.dsp putty-0.58/windows/MSVC/pscp/pscp.dsp | |
| 4943 | --- putty-0.58.orig/windows/MSVC/pscp/pscp.dsp 2005-06-06 11:51:12.624585016 +0200 | |
| 4944 | +++ putty-0.58/windows/MSVC/pscp/pscp.dsp 2005-06-06 12:14:39.382725272 +0200 | |
| 4945 | @@ -110,6 +110,14 @@ | |
| 4946 | # End Source File | |
| 4947 | # Begin Source File | |
| 4948 | ||
| 4949 | +SOURCE=..\..\..\libpkcs11.c | |
| 4950 | +# End Source File | |
| 4951 | +# Begin Source File | |
| 4952 | + | |
| 4953 | +SOURCE=..\..\..\local_cmd.c | |
| 4954 | +# End Source File | |
| 4955 | +# Begin Source File | |
| 4956 | + | |
| 4957 | SOURCE=..\..\..\logging.c | |
| 4958 | # End Source File | |
| 4959 | # Begin Source File | |
| 4960 | @@ -207,6 +215,10 @@ | |
| 4961 | # End Source File | |
| 4962 | # Begin Source File | |
| 4963 | ||
| 4964 | +SOURCE=..\..\..\sshscard.c | |
| 4965 | +# End Source File | |
| 4966 | +# Begin Source File | |
| 4967 | + | |
| 4968 | SOURCE=..\..\..\sshsh512.c | |
| 4969 | # End Source File | |
| 4970 | # Begin Source File | |
| 4971 | @@ -303,6 +315,10 @@ | |
| 4972 | # End Source File | |
| 4973 | # Begin Source File | |
| 4974 | ||
| 4975 | +SOURCE=..\..\..\pkcs11.h | |
| 4976 | +# End Source File | |
| 4977 | +# Begin Source File | |
| 4978 | + | |
| 4979 | SOURCE=..\..\..\proxy.h | |
| 4980 | # End Source File | |
| 4981 | # Begin Source File | |
| 4982 | @@ -323,6 +339,26 @@ | |
| 4983 | # End Source File | |
| 4984 | # Begin Source File | |
| 4985 | ||
| 4986 | +SOURCE=..\..\..\rsaref\pkcs11.h | |
| 4987 | +# End Source File | |
| 4988 | +# Begin Source File | |
| 4989 | + | |
| 4990 | +SOURCE=..\..\..\rsaref\pkcs11f.h | |
| 4991 | +# End Source File | |
| 4992 | +# Begin Source File | |
| 4993 | + | |
| 4994 | +SOURCE=..\..\..\rsaref\pkcs11t.h | |
| 4995 | +# End Source File | |
| 4996 | +# Begin Source File | |
| 4997 | + | |
| 4998 | +SOURCE=..\..\..\rsaref\unix.h | |
| 4999 | +# End Source File | |
| 5000 | +# Begin Source File | |
| 5001 | + | |
| 5002 | +SOURCE=..\..\..\rsaref\win32.h | |
| 5003 | +# End Source File | |
| 5004 | +# Begin Source File | |
| 5005 | + | |
| 5006 | SOURCE=..\..\..\sftp.h | |
| 5007 | # End Source File | |
| 5008 | # Begin Source File | |
| 5009 | @@ -331,6 +367,14 @@ | |
| 5010 | # End Source File | |
| 5011 | # Begin Source File | |
| 5012 | ||
| 5013 | +SOURCE=..\..\..\sshrsa.h | |
| 5014 | +# End Source File | |
| 5015 | +# Begin Source File | |
| 5016 | + | |
| 5017 | +SOURCE=..\..\..\sshscard.h | |
| 5018 | +# End Source File | |
| 5019 | +# Begin Source File | |
| 5020 | + | |
| 5021 | SOURCE=..\..\..\storage.h | |
| 5022 | # End Source File | |
| 5023 | # Begin Source File | |
| 5024 | diff -udrNP putty-0.58.orig/windows/MSVC/psftp/psftp.dsp putty-0.58/windows/MSVC/psftp/psftp.dsp | |
| 5025 | --- putty-0.58.orig/windows/MSVC/psftp/psftp.dsp 2005-06-06 11:51:12.625584864 +0200 | |
| 5026 | +++ putty-0.58/windows/MSVC/psftp/psftp.dsp 2005-06-06 12:14:39.384724968 +0200 | |
| 5027 | @@ -110,6 +110,14 @@ | |
| 5028 | # End Source File | |
| 5029 | # Begin Source File | |
| 5030 | ||
| 5031 | +SOURCE=..\..\..\libpkcs11.c | |
| 5032 | +# End Source File | |
| 5033 | +# Begin Source File | |
| 5034 | + | |
| 5035 | +SOURCE=..\..\..\local_cmd.c | |
| 5036 | +# End Source File | |
| 5037 | +# Begin Source File | |
| 5038 | + | |
| 5039 | SOURCE=..\..\..\logging.c | |
| 5040 | # End Source File | |
| 5041 | # Begin Source File | |
| 5042 | @@ -207,6 +215,10 @@ | |
| 5043 | # End Source File | |
| 5044 | # Begin Source File | |
| 5045 | ||
| 5046 | +SOURCE=..\..\..\sshscard.c | |
| 5047 | +# End Source File | |
| 5048 | +# Begin Source File | |
| 5049 | + | |
| 5050 | SOURCE=..\..\..\sshsh512.c | |
| 5051 | # End Source File | |
| 5052 | # Begin Source File | |
| 5053 | @@ -303,6 +315,10 @@ | |
| 5054 | # End Source File | |
| 5055 | # Begin Source File | |
| 5056 | ||
| 5057 | +SOURCE=..\..\..\pkcs11.h | |
| 5058 | +# End Source File | |
| 5059 | +# Begin Source File | |
| 5060 | + | |
| 5061 | SOURCE=..\..\..\proxy.h | |
| 5062 | # End Source File | |
| 5063 | # Begin Source File | |
| 5064 | @@ -323,6 +339,26 @@ | |
| 5065 | # End Source File | |
| 5066 | # Begin Source File | |
| 5067 | ||
| 5068 | +SOURCE=..\..\..\rsaref\pkcs11.h | |
| 5069 | +# End Source File | |
| 5070 | +# Begin Source File | |
| 5071 | + | |
| 5072 | +SOURCE=..\..\..\rsaref\pkcs11f.h | |
| 5073 | +# End Source File | |
| 5074 | +# Begin Source File | |
| 5075 | + | |
| 5076 | +SOURCE=..\..\..\rsaref\pkcs11t.h | |
| 5077 | +# End Source File | |
| 5078 | +# Begin Source File | |
| 5079 | + | |
| 5080 | +SOURCE=..\..\..\rsaref\unix.h | |
| 5081 | +# End Source File | |
| 5082 | +# Begin Source File | |
| 5083 | + | |
| 5084 | +SOURCE=..\..\..\rsaref\win32.h | |
| 5085 | +# End Source File | |
| 5086 | +# Begin Source File | |
| 5087 | + | |
| 5088 | SOURCE=..\..\..\sftp.h | |
| 5089 | # End Source File | |
| 5090 | # Begin Source File | |
| 5091 | @@ -331,6 +367,14 @@ | |
| 5092 | # End Source File | |
| 5093 | # Begin Source File | |
| 5094 | ||
| 5095 | +SOURCE=..\..\..\sshrsa.h | |
| 5096 | +# End Source File | |
| 5097 | +# Begin Source File | |
| 5098 | + | |
| 5099 | +SOURCE=..\..\..\sshscard.h | |
| 5100 | +# End Source File | |
| 5101 | +# Begin Source File | |
| 5102 | + | |
| 5103 | SOURCE=..\..\..\storage.h | |
| 5104 | # End Source File | |
| 5105 | # Begin Source File | |
| 5106 | diff -udrNP putty-0.58.orig/windows/MSVC/putty/putty.dsp putty-0.58/windows/MSVC/putty/putty.dsp | |
| 5107 | --- putty-0.58.orig/windows/MSVC/putty/putty.dsp 2005-06-06 11:51:12.627584560 +0200 | |
| 5108 | +++ putty-0.58/windows/MSVC/putty/putty.dsp 2005-06-06 12:14:39.386724664 +0200 | |
| 5109 | @@ -122,6 +122,14 @@ | |
| 5110 | # End Source File | |
| 5111 | # Begin Source File | |
| 5112 | ||
| 5113 | +SOURCE=..\..\..\libpkcs11.c | |
| 5114 | +# End Source File | |
| 5115 | +# Begin Source File | |
| 5116 | + | |
| 5117 | +SOURCE=..\..\..\local_cmd.c | |
| 5118 | +# End Source File | |
| 5119 | +# Begin Source File | |
| 5120 | + | |
| 5121 | SOURCE=..\..\..\logging.c | |
| 5122 | # End Source File | |
| 5123 | # Begin Source File | |
| 5124 | @@ -223,6 +231,10 @@ | |
| 5125 | # End Source File | |
| 5126 | # Begin Source File | |
| 5127 | ||
| 5128 | +SOURCE=..\..\..\sshscard.c | |
| 5129 | +# End Source File | |
| 5130 | +# Begin Source File | |
| 5131 | + | |
| 5132 | SOURCE=..\..\..\sshsh512.c | |
| 5133 | # End Source File | |
| 5134 | # Begin Source File | |
| 5135 | @@ -363,6 +375,10 @@ | |
| 5136 | # End Source File | |
| 5137 | # Begin Source File | |
| 5138 | ||
| 5139 | +SOURCE=..\..\..\pkcs11.h | |
| 5140 | +# End Source File | |
| 5141 | +# Begin Source File | |
| 5142 | + | |
| 5143 | SOURCE=..\..\..\proxy.h | |
| 5144 | # End Source File | |
| 5145 | # Begin Source File | |
| 5146 | @@ -379,10 +395,38 @@ | |
| 5147 | # End Source File | |
| 5148 | # Begin Source File | |
| 5149 | ||
| 5150 | +SOURCE=..\..\..\rsaref\pkcs11.h | |
| 5151 | +# End Source File | |
| 5152 | +# Begin Source File | |
| 5153 | + | |
| 5154 | +SOURCE=..\..\..\rsaref\pkcs11f.h | |
| 5155 | +# End Source File | |
| 5156 | +# Begin Source File | |
| 5157 | + | |
| 5158 | +SOURCE=..\..\..\rsaref\pkcs11t.h | |
| 5159 | +# End Source File | |
| 5160 | +# Begin Source File | |
| 5161 | + | |
| 5162 | +SOURCE=..\..\..\rsaref\unix.h | |
| 5163 | +# End Source File | |
| 5164 | +# Begin Source File | |
| 5165 | + | |
| 5166 | +SOURCE=..\..\..\rsaref\win32.h | |
| 5167 | +# End Source File | |
| 5168 | +# Begin Source File | |
| 5169 | + | |
| 5170 | SOURCE=..\..\..\ssh.h | |
| 5171 | # End Source File | |
| 5172 | # Begin Source File | |
| 5173 | ||
| 5174 | +SOURCE=..\..\..\sshrsa.h | |
| 5175 | +# End Source File | |
| 5176 | +# Begin Source File | |
| 5177 | + | |
| 5178 | +SOURCE=..\..\..\sshscard.h | |
| 5179 | +# End Source File | |
| 5180 | +# Begin Source File | |
| 5181 | + | |
| 5182 | SOURCE=..\..\..\storage.h | |
| 5183 | # End Source File | |
| 5184 | # Begin Source File | |
| 5185 | diff -udrNP putty-0.58.orig/windows/Makefile.bor putty-0.58/windows/Makefile.bor | |
| 5186 | --- putty-0.58.orig/windows/Makefile.bor 2005-06-06 11:51:12.584591096 +0200 | |
| 5187 | +++ putty-0.58/windows/Makefile.bor 2005-06-06 12:14:39.340731656 +0200 | |
| 5188 | @@ -102,55 +102,60 @@ | |
| 3537 | diff -urNp putty-0.58.org/windows/Makefile.bor putty-0.58+smartcard/windows/Makefile.bor | |
| 3538 | --- putty-0.58.org/windows/Makefile.bor 2005-04-05 22:40:17.000000000 +0300 | |
| 3539 | +++ putty-0.58+smartcard/windows/Makefile.bor 2008-03-15 20:47:07.000000000 +0200 | |
| 3540 | @@ -102,55 +102,60 @@ BCB = $(MAKEDIR)\.. | |
| 5189 | 3541 | all: pageant.exe plink.exe pscp.exe psftp.exe putty.exe puttygen.exe \ |
| 5190 | 3542 | puttytel.exe |
| … | … | |
| 5285 | 3637 | winutils.obj x11fwd.obj putty.rsp |
| 5286 | 3638 | ilink32 -aa -Gn -L$(BCB)\lib @putty.rsp |
| 5287 | @@ -175,10 +180,11 @@ |
|
| 3639 | @@ -175,10 +180,11 @@ puttytel.exe: be_nossh.obj cmdline.obj c | |
| 5288 | 3640 | |
| 5289 | 3641 | pageant.rsp: $(MAKEFILE) |
| … | … | |
| 5301 | 3653 | echo nul,cw32 import32, >> pageant.rsp |
| 5302 | 3654 | echo pageant.res >> pageant.rsp |
| 5303 | @@ -186,16 +192,17 @@ |
|
| 3655 | @@ -186,16 +192,17 @@ pageant.rsp: $(MAKEFILE) | |
| 5304 | 3656 | plink.rsp: $(MAKEFILE) |
| 5305 | 3657 | echo c0x32 + > plink.rsp |
| … | … | |
| 5329 | 3681 | echo nul,cw32 import32, >> plink.rsp |
| 5330 | 3682 | echo plink.res >> plink.rsp |
| 5331 | @@ -203,16 +210,17 @@ |
|
| 3683 | @@ -203,16 +210,17 @@ plink.rsp: $(MAKEFILE) | |
| 5332 | 3684 | pscp.rsp: $(MAKEFILE) |
| 5333 | 3685 | echo c0x32 + > pscp.rsp |
| … | … | |
| 5357 | 3709 | echo nul,cw32 import32, >> pscp.rsp |
| 5358 | 3710 | echo pscp.res >> pscp.rsp |
| 5359 | @@ -220,15 +228,16 @@ |
|
| 3711 | @@ -220,15 +228,16 @@ pscp.rsp: $(MAKEFILE) | |
| 5360 | 3712 | psftp.rsp: $(MAKEFILE) |
| 5361 | 3713 | echo c0x32 + > psftp.rsp |
| … | … | |
| 5383 | 3735 | echo psftp.exe >> psftp.rsp |
| 5384 | 3736 | echo nul,cw32 import32, >> psftp.rsp |
| 5385 | @@ -237,20 +246,20 @@ |
|
| 3737 | @@ -237,20 +246,20 @@ psftp.rsp: $(MAKEFILE) | |
| 5386 | 3738 | putty.rsp: $(MAKEFILE) |
| 5387 | 3739 | echo c0w32 + > putty.rsp |
| … | … | |
| 5418 | 3770 | echo nul,cw32 import32, >> putty.rsp |
| 5419 | 3771 | echo win_res.res >> putty.rsp |
| 5420 | @@ -347,6 +356, |
|
| 3772 | @@ -347,6 +356,8 @@ ldiscucs.obj: ..\ldiscucs.c ..\putty.h . | |
| 5421 | 3773 | ..\network.h ..\misc.h ..\tree234.h ..\windows\winstuff.h \ |
| 5422 | 3774 | ..\mac\macstuff.h ..\macosx\osx.h ..\unix\unix.h \ |
| 5423 | 3775 | ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h |
| 5424 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\rsaref\win32.h \ | |
| 5425 | + ..\rsaref\pkcs11.h ..\rsaref\unix.h ..\rsaref\pkcs11t.h \ | |
| 5426 | + ..\rsaref\pkcs11f.h | |
| 3776 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\ppkcs11.h | |
| 5427 | 3777 | +local_cmd.obj: ..\local_cmd.c |
| 5428 | 3778 | localenc.obj: ..\charset\localenc.c ..\charset\charset.h \ |
| 5429 | 3779 | ..\charset\internal.h |
| 5430 | 3780 | logging.obj: ..\logging.c ..\putty.h ..\puttyps.h ..\network.h ..\misc.h \ |
| 5431 | @@ -524, |
|
| 3781 | @@ -524,8 +535,9 @@ sizetip.obj: ..\windows\sizetip.c ..\put | |
| 5432 | 3782 | ..\windows\winhelp.h ..\charset\charset.h |
| 5433 | 3783 | slookup.obj: ..\charset\slookup.c ..\charset\charset.h ..\charset\internal.h \ |
| … | … | |
| 5435 | 3785 | -ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\puttyps.h ..\network.h \ |
| 5436 | 3786 | - ..\misc.h ..\puttymem.h ..\int64.h ..\windows\winstuff.h \ |
| 5437 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ |
|
| 3787 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ppkcs11.h ..\sshscard.h \ | |
| 5438 | 3788 | + ..\puttyps.h ..\network.h ..\misc.h ..\puttymem.h ..\int64.h \ |
| 5439 | + ..\ |
|
| 3789 | + ..\windows\winstuff.h \ | |
| 5440 | 3790 | ..\mac\macstuff.h ..\macosx\osx.h ..\unix\unix.h \ |
| 5441 | ||
| 5442 | 3791 | ..\windows\winhelp.h ..\charset\charset.h |
| 5443 | 3792 | sshaes.obj: ..\sshaes.c ..\ssh.h ..\puttymem.h ..\network.h ..\int64.h \ |
| 5444 | ..\misc.h | |
| 5445 | @@ -562,6 +577,13 @@ | |
| 3793 | @@ -562,6 +574,12 @@ sshrsa.obj: ..\sshrsa.c ..\ssh.h ..\misc | |
| 5446 | 3794 | ..\int64.h |
| 5447 | 3795 | sshrsag.obj: ..\sshrsag.c ..\ssh.h ..\puttymem.h ..\network.h ..\int64.h \ |
| 5448 | 3796 | ..\misc.h |
| 5449 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ |
|
| 3797 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ppkcs11.h ..\sshscard.h \ | |
| 5450 | 3798 | + ..\putty.h ..\puttymem.h ..\network.h ..\int64.h ..\misc.h \ |
| 5451 | + ..\rsaref\win32.h ..\rsaref\pkcs11.h ..\puttyps.h \ | |
| 5452 | + ..\rsaref\unix.h ..\rsaref\pkcs11t.h ..\rsaref\pkcs11f.h \ | |
| 3799 | + ..\puttyps.h \ | |
| 5453 | 3800 | + ..\windows\winstuff.h ..\mac\macstuff.h ..\macosx\osx.h \ |
| 5454 | 3801 | + ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ |
| … | … | |
| 5457 | 3804 | ..\misc.h |
| 5458 | 3805 | sshsha.obj: ..\sshsha.c ..\ssh.h ..\puttymem.h ..\network.h ..\int64.h \ |
| 5459 | @@ -732,9 +75 |
|
| 3806 | @@ -732,9 +750,10 @@ winpgen.obj: ..\windows\winpgen.c ..\put | |
| 5460 | 3807 | ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ |
| 5461 | 3808 | ..\charset\charset.h |
| … | … | |
| 5471 | 3818 | ..\misc.h ..\windows\winstuff.h ..\mac\macstuff.h \ |
| 5472 | 3819 | ..\macosx\osx.h ..\unix\unix.h ..\puttymem.h ..\tree234.h \ |
| 5473 | diff -udrNP putty-0.58.orig/windows/Makefile.cyg putty-0.58/windows/Makefile.cyg | |
| 5474 | --- putty-0.58.orig/windows/Makefile.cyg 2005-06-06 11:51:12.559594896 +0200 | |
| 5475 | +++ putty-0.58/windows/Makefile.cyg 2005-06-06 12:14:39.314735608 +0200 | |
| 5476 | @@ -101,96 +101,100 @@ | |
| 3820 | diff -urNp putty-0.58.org/windows/Makefile.cyg putty-0.58+smartcard/windows/Makefile.cyg | |
| 3821 | --- putty-0.58.org/windows/Makefile.cyg 2005-04-05 22:40:17.000000000 +0300 | |
| 3822 | +++ putty-0.58+smartcard/windows/Makefile.cyg 2008-03-15 21:15:25.000000000 +0200 | |
| 3823 | @@ -91,6 +91,7 @@ RC = $(TOOLPATH)windres | |
| 3824 | ||
| 3825 | CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT \ | |
| 3826 | -D_NO_OLDNAMES -DNO_MULTIMON -I.././ -I../charset/ \ | |
| 3827 | + -DCRYPTOKI_FORCE_WIN32 \ | |
| 3828 | -I../windows/ -I../unix/ -I../mac/ -I../macosx/ | |
| 3829 | LDFLAGS = -mno-cygwin -s | |
| 3830 | RCFLAGS = $(RCINC) --define WIN32=1 --define _WIN32=1 --define WINVER=0x0400 | |
| 3831 | @@ -101,96 +102,100 @@ RCFLAGS = $(RCINC) --define WIN32=1 --de | |
| 5477 | 3832 | all: pageant.exe plink.exe pscp.exe psftp.exe putty.exe puttygen.exe \ |
| 5478 | 3833 | puttytel.exe |
| … | … | |
| 5652 | 4007 | puttygen.exe: import.o misc.o notiming.o puttygen.res.o sshaes.o sshbn.o \ |
| 5653 | 4008 | sshdes.o sshdss.o sshdssg.o sshmd5.o sshprime.o sshpubk.o \ |
| 5654 | @@ -322,6 +32 |
|
| 4009 | @@ -322,6 +327,12 @@ ldiscucs.o: ../ldiscucs.c ../putty.h ../ | |
| 5655 | 4010 | ../puttymem.h ../windows/winhelp.h ../charset/charset.h |
| 5656 | 4011 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../ldiscucs.c |
| 5657 | 4012 | |
| 5658 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../rsaref/win32.h ../rsaref/pkcs11.h \ | |
| 5659 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h | |
| 4013 | +libpkcs11.o: ../libpkcs11.c ../pkcs11.h ../ppkcs11.h | |
| 5660 | 4014 | + $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../libpkcs11.c |
| 5661 | 4015 | + |
| … | … | |
| 5666 | 4020 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../charset/localenc.c |
| 5667 | 4021 | |
| 5668 | @@ -592, |
|
| 4022 | @@ -592,8 +603,9 @@ slookup.o: ../charset/slookup.c ../chars | |
| 5669 | 4023 | ../charset/enum.c ../charset/sbcsdat.c ../charset/utf8.c |
| 5670 | 4024 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../charset/slookup.c |
| … | … | |
| 5672 | 4026 | -ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../puttyps.h ../network.h \ |
| 5673 | 4027 | - ../misc.h ../puttymem.h ../int64.h ../windows/winstuff.h \ |
| 5674 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ |
|
| 4028 | +ssh.o: ../ssh.c ../putty.h ../tree234.h ../ssh.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 5675 | 4029 | + ../puttyps.h ../network.h ../misc.h ../puttymem.h ../int64.h \ |
| 5676 | + ../ |
|
| 4030 | + ../windows/winstuff.h \ | |
| 5677 | 4031 | ../mac/macstuff.h ../macosx/osx.h ../unix/unix.h \ |
| 5678 | ||
| 5679 | 4032 | ../windows/winhelp.h ../charset/charset.h |
| 5680 | 4033 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../ssh.c |
| 5681 | ||
| 5682 | @@ -660,6 +673,15 @@ | |
| 4034 | @@ -660,6 +672,14 @@ sshrsag.o: ../sshrsag.c ../ssh.h ../putt | |
| 5683 | 4035 | ../misc.h |
| 5684 | 4036 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../sshrsag.c |
| 5685 | 4037 | |
| 5686 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ |
|
| 4038 | +sshscard.o: ../sshscard.c ../ssh.h ../sshrsa.h ../pkcs11.h ../ppkcs11.h ../sshscard.h \ | |
| 5687 | 4039 | + ../putty.h ../puttymem.h ../network.h ../int64.h ../misc.h \ |
| 5688 | + ../rsaref/win32.h ../rsaref/pkcs11.h ../puttyps.h \ | |
| 5689 | + ../rsaref/unix.h ../rsaref/pkcs11t.h ../rsaref/pkcs11f.h \ | |
| 4040 | + ../puttyps.h \ | |
| 5690 | 4041 | + ../windows/winstuff.h ../mac/macstuff.h ../macosx/osx.h \ |
| 5691 | 4042 | + ../unix/unix.h ../tree234.h ../windows/winhelp.h \ |
| … | … | |
| 5696 | 4047 | ../misc.h |
| 5697 | 4048 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../sshsh512.c |
| 5698 | @@ -920,9 +94 |
|
| 4049 | @@ -920,9 +940,10 @@ winpgen.o: ../windows/winpgen.c ../putty | |
| 5699 | 4050 | $(CC) $(COMPAT) $(XFLAGS) $(CFLAGS) -c ../windows/winpgen.c |
| 5700 | 4051 | |
| … | … | |
| 5710 | 4061 | |
| 5711 | 4062 | winpgntc.o: ../windows/winpgntc.c ../putty.h ../puttyps.h ../network.h \ |
| 5712 | diff -u |
|
| 5713 | --- putty-0.58.or |
|
| 5714 | +++ putty-0.58 |
|
| 5715 | @@ -91,104 +91,110 @@ |
|
| 4063 | diff -urNp putty-0.58.org/windows/Makefile.lcc putty-0.58+smartcard/windows/Makefile.lcc | |
| 4064 | --- putty-0.58.org/windows/Makefile.lcc 2005-04-05 22:40:17.000000000 +0300 | |
| 4065 | +++ putty-0.58+smartcard/windows/Makefile.lcc 2008-03-15 20:48:20.000000000 +0200 | |
| 4066 | @@ -91,104 +91,110 @@ CFLAGS = -D_WINDOWS -I..\./ -I..\charset | |
| 5716 | 4067 | all: pageant.exe plink.exe pscp.exe psftp.exe putty.exe puttygen.exe \ |
| 5717 | 4068 | puttytel.exe |
| … | … | |
| 5905 | 4256 | puttygen.exe: import.obj misc.obj notiming.obj puttygen.res sshaes.obj \ |
| 5906 | 4257 | sshbn.obj sshdes.obj sshdss.obj sshdssg.obj sshmd5.obj \ |
| 5907 | @@ -305,6 +311,1 |
|
| 4258 | @@ -305,6 +311,10 @@ ldiscucs.obj: ..\ldiscucs.c ..\putty.h . | |
| 5908 | 4259 | ..\mac\macstuff.h ..\macosx\osx.h ..\unix\unix.h \ |
| 5909 | 4260 | ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h |
| 5910 | 4261 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\ldiscucs.c |
| 5911 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\rsaref\win32.h \ | |
| 5912 | + ..\rsaref\pkcs11.h ..\rsaref\unix.h ..\rsaref\pkcs11t.h \ | |
| 5913 | + ..\rsaref\pkcs11f.h | |
| 4262 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\ppkcs11.h | |
| 5914 | 4263 | + lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\libpkcs11.c |
| 5915 | 4264 | +local_cmd.obj: ..\local_cmd.c |
| … | … | |
| 5918 | 4267 | ..\charset\internal.h |
| 5919 | 4268 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\charset\localenc.c |
| 5920 | @@ -530, |
|
| 4269 | @@ -530,8 +540,9 @@ sizetip.obj: ..\windows\sizetip.c ..\put | |
| 5921 | 4270 | slookup.obj: ..\charset\slookup.c ..\charset\charset.h ..\charset\internal.h \ |
| 5922 | 4271 | ..\charset\enum.c ..\charset\sbcsdat.c ..\charset\utf8.c |
| … | … | |
| 5924 | 4273 | -ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\puttyps.h ..\network.h \ |
| 5925 | 4274 | - ..\misc.h ..\puttymem.h ..\int64.h ..\windows\winstuff.h \ |
| 5926 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ |
|
| 4275 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ppkcs11.h ..\sshscard.h \ | |
| 5927 | 4276 | + ..\puttyps.h ..\network.h ..\misc.h ..\puttymem.h ..\int64.h \ |
| 5928 | + ..\ |
|
| 4277 | + ..\windows\winstuff.h \ | |
| 5929 | 4278 | ..\mac\macstuff.h ..\macosx\osx.h ..\unix\unix.h \ |
| 5930 | ||
| 5931 | 4279 | ..\windows\winhelp.h ..\charset\charset.h |
| 5932 | 4280 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\ssh.c |
| 5933 | sshaes.obj: ..\sshaes.c ..\ssh.h ..\puttymem.h ..\network.h ..\int64.h \ | |
| 5934 | @@ -584,6 +598,14 @@ | |
| 4281 | @@ -584,6 +595,13 @@ sshrsa.obj: ..\sshrsa.c ..\ssh.h ..\misc | |
| 5935 | 4282 | sshrsag.obj: ..\sshrsag.c ..\ssh.h ..\puttymem.h ..\network.h ..\int64.h \ |
| 5936 | 4283 | ..\misc.h |
| 5937 | 4284 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\sshrsag.c |
| 5938 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ |
|
| 4285 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ppkcs11.h ..\sshscard.h \ | |
| 5939 | 4286 | + ..\putty.h ..\puttymem.h ..\network.h ..\int64.h ..\misc.h \ |
| 5940 | + ..\rsaref\win32.h ..\rsaref\pkcs11.h ..\puttyps.h \ | |
| 5941 | + ..\rsaref\unix.h ..\rsaref\pkcs11t.h ..\rsaref\pkcs11f.h \ | |
| 4287 | + ..\puttyps.h \ | |
| 5942 | 4288 | + ..\windows\winstuff.h ..\mac\macstuff.h ..\macosx\osx.h \ |
| 5943 | 4289 | + ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ |
| … | … | |
| 5947 | 4293 | ..\misc.h |
| 5948 | 4294 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\sshsh512.c |
| 5949 | @@ -799,9 +8 |
|
| 4295 | @@ -799,9 +817,10 @@ winpgen.obj: ..\windows\winpgen.c ..\put | |
| 5950 | 4296 | ..\charset\charset.h |
| 5951 | 4297 | lcc -O -p6 $(COMPAT) $(XFLAGS) $(CFLAGS) ..\windows\winpgen.c |
| … | … | |
| 5961 | 4307 | winpgntc.obj: ..\windows\winpgntc.c ..\putty.h ..\puttyps.h ..\network.h \ |
| 5962 | 4308 | ..\misc.h ..\windows\winstuff.h ..\mac\macstuff.h \ |
| 5963 | diff -u |
|
| 5964 | --- putty-0.58.or |
|
| 5965 | +++ putty-0.58 |
|
| 5966 | @@ -91,55 +91,60 @@ |
|
| 4309 | diff -urNp putty-0.58.org/windows/Makefile.vc putty-0.58+smartcard/windows/Makefile.vc | |
| 4310 | --- putty-0.58.org/windows/Makefile.vc 2005-04-05 22:40:17.000000000 +0300 | |
| 4311 | +++ putty-0.58+smartcard/windows/Makefile.vc 2008-03-15 20:45:38.000000000 +0200 | |
| 4312 | @@ -91,55 +91,60 @@ LFLAGS = /incremental:no /fixed | |
| 5967 | 4313 | all: pageant.exe plink.exe pscp.exe psftp.exe putty.exe puttygen.exe \ |
| 5968 | 4314 | puttytel.exe |
| … | … | |
| 6063 | 4409 | winutils.obj x11fwd.obj putty.rsp |
| 6064 | 4410 | link $(LFLAGS) -out:putty.exe -map:putty.map @putty.rsp |
| 6065 | @@ -165,76 +170,79 @@ |
|
| 4411 | @@ -165,76 +170,79 @@ puttytel.exe: be_nossh.obj cmdline.obj c | |
| 6066 | 4412 | pageant.rsp: $(MAKEFILE) |
| 6067 | 4413 | echo /nologo /subsystem:windows > pageant.rsp |
| … | … | |
| 6192 | 4538 | echo user32.lib version.obj wcwidth.obj wildcard.obj >> putty.rsp |
| 6193 | 4539 | echo win_res.res wincfg.obj winctrls.obj windefs.obj >> putty.rsp |
| 6194 | @@ -370,6 +378,1 |
|
| 4540 | @@ -370,6 +378,12 @@ ldiscucs.obj: ..\ldiscucs.c ..\putty.h . | |
| 6195 | 4541 | ..\puttymem.h ..\windows\winhelp.h ..\charset\charset.h |
| 6196 | 4542 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\ldiscucs.c |
| 6197 | 4543 | |
| 6198 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\rsaref\win32.h \ | |
| 6199 | + ..\rsaref\pkcs11.h ..\rsaref\unix.h ..\rsaref\pkcs11t.h \ | |
| 6200 | + ..\rsaref\pkcs11f.h | |
| 4544 | +libpkcs11.obj: ..\libpkcs11.c ..\pkcs11.h ..\ppkcs11.h | |
| 6201 | 4545 | + cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\libpkcs11.c |
| 6202 | 4546 | + |
| … | … | |
| 6207 | 4551 | ..\charset\internal.h |
| 6208 | 4552 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\charset\localenc.c |
| 6209 | @@ -643, |
|
| 4553 | @@ -643,8 +657,9 @@ slookup.obj: ..\charset\slookup.c ..\cha | |
| 6210 | 4554 | ..\charset\enum.c ..\charset\sbcsdat.c ..\charset\utf8.c |
| 6211 | 4555 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\charset\slookup.c |
| … | … | |
| 6213 | 4557 | -ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\puttyps.h ..\network.h \ |
| 6214 | 4558 | - ..\misc.h ..\puttymem.h ..\int64.h ..\windows\winstuff.h \ |
| 6215 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ |
|
| 4559 | +ssh.obj: ..\ssh.c ..\putty.h ..\tree234.h ..\ssh.h ..\pkcs11.h ..\ppkcs11.h \ | |
| 6216 | 4560 | + ..\puttyps.h ..\network.h ..\misc.h ..\puttymem.h ..\int64.h \ |
| 6217 | + ..\ |
|
| 4561 | + ..\windows\winstuff.h \ | |
| 6218 | 4562 | ..\mac\macstuff.h ..\macosx\osx.h ..\unix\unix.h \ |
| 6219 | ||
| 6220 | 4563 | ..\windows\winhelp.h ..\charset\charset.h |
| 6221 | 4564 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\ssh.c |
| 6222 | ||
| 6223 | @@ -713,6 +731,15 @@ | |
| 4565 | @@ -713,6 +728,14 @@ sshrsag.obj: ..\sshrsag.c ..\ssh.h ..\pu | |
| 6224 | 4566 | ..\misc.h |
| 6225 | 4567 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\sshrsag.c |
| 6226 | 4568 | |
| 6227 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ |
|
| 4569 | +sshscard.obj: ..\sshscard.c ..\ssh.h ..\sshrsa.h ..\pkcs11.h ..\ppkcs11.h ..\sshscard.h \ | |
| 6228 | 4570 | + ..\putty.h ..\puttymem.h ..\network.h ..\int64.h ..\misc.h \ |
| 6229 | + ..\rsaref\win32.h ..\rsaref\pkcs11.h ..\puttyps.h \ | |
| 6230 | + ..\rsaref\unix.h ..\rsaref\pkcs11t.h ..\rsaref\pkcs11f.h \ | |
| 4571 | + ..\puttyps.h \ | |
| 6231 | 4572 | + ..\windows\winstuff.h ..\mac\macstuff.h ..\macosx\osx.h \ |
| 6232 | 4573 | + ..\unix\unix.h ..\tree234.h ..\windows\winhelp.h \ |
| … | … | |
| 6237 | 4578 | ..\misc.h |
| 6238 | 4579 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\sshsh512.c |
| 6239 | @@ -973,9 + |
|
| 4580 | @@ -973,9 +996,10 @@ winpgen.obj: ..\windows\winpgen.c ..\put | |
| 6240 | 4581 | cl $(COMPAT) $(XFLAGS) $(CFLAGS) /c ..\windows\winpgen.c |
| 6241 | 4582 | |
| … | … | |
| 6251 | 4592 | |
| 6252 | 4593 | winpgntc.obj: ..\windows\winpgntc.c ..\putty.h ..\puttyps.h ..\network.h \ |
| 6253 | diff -udrNP putty-0.58.orig/windows/winhelp.h putty-0.58/windows/winhelp.h | |
| 6254 | --- putty-0.58.orig/windows/winhelp.h 2005-04-05 21:37:38.000000000 +0200 | |
| 6255 | +++ putty-0.58/windows/winhelp.h 2005-06-06 11:50:58.579720160 +0200 | |
| 4594 | diff -urNp putty-0.58.org/windows/MSVC/pageant/pageant.dsp putty-0.58+smartcard/windows/MSVC/pageant/pageant.dsp | |
| 4595 | --- putty-0.58.org/windows/MSVC/pageant/pageant.dsp 2005-04-05 22:40:17.000000000 +0300 | |
| 4596 | +++ putty-0.58+smartcard/windows/MSVC/pageant/pageant.dsp 2008-03-15 21:11:47.000000000 +0200 | |
| 4597 | @@ -94,6 +94,10 @@ LINK32=link.exe | |
| 4598 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" | |
| 4599 | # Begin Source File | |
| 4600 | ||
| 4601 | +SOURCE=..\..\..\libpkcs11.c | |
| 4602 | +# End Source File | |
| 4603 | +# Begin Source File | |
| 4604 | + | |
| 4605 | SOURCE=..\..\..\misc.c | |
| 4606 | # End Source File | |
| 4607 | # Begin Source File | |
| 4608 | @@ -126,6 +130,10 @@ SOURCE=..\..\..\sshrsa.c | |
| 4609 | # End Source File | |
| 4610 | # Begin Source File | |
| 4611 | ||
| 4612 | +SOURCE=..\..\..\sshscard.c | |
| 4613 | +# End Source File | |
| 4614 | +# Begin Source File | |
| 4615 | + | |
| 4616 | SOURCE=..\..\..\sshsh512.c | |
| 4617 | # End Source File | |
| 4618 | # Begin Source File | |
| 4619 | @@ -186,6 +194,14 @@ SOURCE=..\..\..\network.h | |
| 4620 | # End Source File | |
| 4621 | # Begin Source File | |
| 4622 | ||
| 4623 | +SOURCE=..\..\..\pkcs11.h | |
| 4624 | +# End Source File | |
| 4625 | +# Begin Source File | |
| 4626 | + | |
| 4627 | +SOURCE=..\..\..\ppkcs11.h | |
| 4628 | +# End Source File | |
| 4629 | +# Begin Source File | |
| 4630 | + | |
| 4631 | SOURCE=..\..\..\putty.h | |
| 4632 | # End Source File | |
| 4633 | # Begin Source File | |
| 4634 | @@ -202,6 +218,14 @@ SOURCE=..\..\..\ssh.h | |
| 4635 | # End Source File | |
| 4636 | # Begin Source File | |
| 4637 | ||
| 4638 | +SOURCE=..\..\..\sshrsa.h | |
| 4639 | +# End Source File | |
| 4640 | +# Begin Source File | |
| 4641 | + | |
| 4642 | +SOURCE=..\..\..\sshscard.h | |
| 4643 | +# End Source File | |
| 4644 | +# Begin Source File | |
| 4645 | + | |
| 4646 | SOURCE=..\..\..\tree234.h | |
| 4647 | # End Source File | |
| 4648 | # Begin Source File | |
| 4649 | diff -urNp putty-0.58.org/windows/MSVC/plink/plink.dsp putty-0.58+smartcard/windows/MSVC/plink/plink.dsp | |
| 4650 | --- putty-0.58.org/windows/MSVC/plink/plink.dsp 2005-04-05 22:40:17.000000000 +0300 | |
| 4651 | +++ putty-0.58+smartcard/windows/MSVC/plink/plink.dsp 2008-03-15 21:12:13.000000000 +0200 | |
| 4652 | @@ -110,6 +110,14 @@ SOURCE=..\..\..\ldisc.c | |
| 4653 | # End Source File | |
| 4654 | # Begin Source File | |
| 4655 | ||
| 4656 | +SOURCE=..\..\..\libpkcs11.c | |
| 4657 | +# End Source File | |
| 4658 | +# Begin Source File | |
| 4659 | + | |
| 4660 | +SOURCE=..\..\..\local_cmd.c | |
| 4661 | +# End Source File | |
| 4662 | +# Begin Source File | |
| 4663 | + | |
| 4664 | SOURCE=..\..\..\logging.c | |
| 4665 | # End Source File | |
| 4666 | # Begin Source File | |
| 4667 | @@ -207,6 +215,10 @@ SOURCE=..\..\..\sshrsa.c | |
| 4668 | # End Source File | |
| 4669 | # Begin Source File | |
| 4670 | ||
| 4671 | +SOURCE=..\..\..\sshscard.c | |
| 4672 | +# End Source File | |
| 4673 | +# Begin Source File | |
| 4674 | + | |
| 4675 | SOURCE=..\..\..\sshsh512.c | |
| 4676 | # End Source File | |
| 4677 | # Begin Source File | |
| 4678 | @@ -311,6 +323,14 @@ SOURCE=..\..\..\network.h | |
| 4679 | # End Source File | |
| 4680 | # Begin Source File | |
| 4681 | ||
| 4682 | +SOURCE=..\..\..\pkcs11.h | |
| 4683 | +# End Source File | |
| 4684 | +# Begin Source File | |
| 4685 | + | |
| 4686 | +SOURCE=..\..\..\ppkcs11.h | |
| 4687 | +# End Source File | |
| 4688 | +# Begin Source File | |
| 4689 | + | |
| 4690 | SOURCE=..\..\..\proxy.h | |
| 4691 | # End Source File | |
| 4692 | # Begin Source File | |
| 4693 | @@ -331,6 +351,14 @@ SOURCE=..\..\..\ssh.h | |
| 4694 | # End Source File | |
| 4695 | # Begin Source File | |
| 4696 | ||
| 4697 | +SOURCE=..\..\..\sshrsa.h | |
| 4698 | +# End Source File | |
| 4699 | +# Begin Source File | |
| 4700 | + | |
| 4701 | +SOURCE=..\..\..\sshscard.h | |
| 4702 | +# End Source File | |
| 4703 | +# Begin Source File | |
| 4704 | + | |
| 4705 | SOURCE=..\..\..\storage.h | |
| 4706 | # End Source File | |
| 4707 | # Begin Source File | |
| 4708 | diff -urNp putty-0.58.org/windows/MSVC/pscp/pscp.dsp putty-0.58+smartcard/windows/MSVC/pscp/pscp.dsp | |
| 4709 | --- putty-0.58.org/windows/MSVC/pscp/pscp.dsp 2005-04-05 22:40:17.000000000 +0300 | |
| 4710 | +++ putty-0.58+smartcard/windows/MSVC/pscp/pscp.dsp 2008-03-15 21:12:37.000000000 +0200 | |
| 4711 | @@ -110,6 +110,14 @@ SOURCE=..\..\..\int64.c | |
| 4712 | # End Source File | |
| 4713 | # Begin Source File | |
| 4714 | ||
| 4715 | +SOURCE=..\..\..\libpkcs11.c | |
| 4716 | +# End Source File | |
| 4717 | +# Begin Source File | |
| 4718 | + | |
| 4719 | +SOURCE=..\..\..\local_cmd.c | |
| 4720 | +# End Source File | |
| 4721 | +# Begin Source File | |
| 4722 | + | |
| 4723 | SOURCE=..\..\..\logging.c | |
| 4724 | # End Source File | |
| 4725 | # Begin Source File | |
| 4726 | @@ -207,6 +215,10 @@ SOURCE=..\..\..\sshrsa.c | |
| 4727 | # End Source File | |
| 4728 | # Begin Source File | |
| 4729 | ||
| 4730 | +SOURCE=..\..\..\sshscard.c | |
| 4731 | +# End Source File | |
| 4732 | +# Begin Source File | |
| 4733 | + | |
| 4734 | SOURCE=..\..\..\sshsh512.c | |
| 4735 | # End Source File | |
| 4736 | # Begin Source File | |
| 4737 | @@ -303,6 +315,14 @@ SOURCE=..\..\..\network.h | |
| 4738 | # End Source File | |
| 4739 | # Begin Source File | |
| 4740 | ||
| 4741 | +SOURCE=..\..\..\pkcs11.h | |
| 4742 | +# End Source File | |
| 4743 | +# Begin Source File | |
| 4744 | + | |
| 4745 | +SOURCE=..\..\..\ppkcs11.h | |
| 4746 | +# End Source File | |
| 4747 | +# Begin Source File | |
| 4748 | + | |
| 4749 | SOURCE=..\..\..\proxy.h | |
| 4750 | # End Source File | |
| 4751 | # Begin Source File | |
| 4752 | @@ -331,6 +351,14 @@ SOURCE=..\..\..\ssh.h | |
| 4753 | # End Source File | |
| 4754 | # Begin Source File | |
| 4755 | ||
| 4756 | +SOURCE=..\..\..\sshrsa.h | |
| 4757 | +# End Source File | |
| 4758 | +# Begin Source File | |
| 4759 | + | |
| 4760 | +SOURCE=..\..\..\sshscard.h | |
| 4761 | +# End Source File | |
| 4762 | +# Begin Source File | |
| 4763 | + | |
| 4764 | SOURCE=..\..\..\storage.h | |
| 4765 | # End Source File | |
| 4766 | # Begin Source File | |
| 4767 | diff -urNp putty-0.58.org/windows/MSVC/psftp/psftp.dsp putty-0.58+smartcard/windows/MSVC/psftp/psftp.dsp | |
| 4768 | --- putty-0.58.org/windows/MSVC/psftp/psftp.dsp 2005-04-05 22:40:17.000000000 +0300 | |
| 4769 | +++ putty-0.58+smartcard/windows/MSVC/psftp/psftp.dsp 2008-03-15 21:13:10.000000000 +0200 | |
| 4770 | @@ -110,6 +110,14 @@ SOURCE=..\..\..\int64.c | |
| 4771 | # End Source File | |
| 4772 | # Begin Source File | |
| 4773 | ||
| 4774 | +SOURCE=..\..\..\libpkcs11.c | |
| 4775 | +# End Source File | |
| 4776 | +# Begin Source File | |
| 4777 | + | |
| 4778 | +SOURCE=..\..\..\local_cmd.c | |
| 4779 | +# End Source File | |
| 4780 | +# Begin Source File | |
| 4781 | + | |
| 4782 | SOURCE=..\..\..\logging.c | |
| 4783 | # End Source File | |
| 4784 | # Begin Source File | |
| 4785 | @@ -207,6 +215,10 @@ SOURCE=..\..\..\sshrsa.c | |
| 4786 | # End Source File | |
| 4787 | # Begin Source File | |
| 4788 | ||
| 4789 | +SOURCE=..\..\..\sshscard.c | |
| 4790 | +# End Source File | |
| 4791 | +# Begin Source File | |
| 4792 | + | |
| 4793 | SOURCE=..\..\..\sshsh512.c | |
| 4794 | # End Source File | |
| 4795 | # Begin Source File | |
| 4796 | @@ -303,6 +315,14 @@ SOURCE=..\..\..\network.h | |
| 4797 | # End Source File | |
| 4798 | # Begin Source File | |
| 4799 | ||
| 4800 | +SOURCE=..\..\..\pkcs11.h | |
| 4801 | +# End Source File | |
| 4802 | +# Begin Source File | |
| 4803 | + | |
| 4804 | +SOURCE=..\..\..\ppkcs11.h | |
| 4805 | +# End Source File | |
| 4806 | +# Begin Source File | |
| 4807 | + | |
| 4808 | SOURCE=..\..\..\proxy.h | |
| 4809 | # End Source File | |
| 4810 | # Begin Source File | |
| 4811 | @@ -331,6 +351,14 @@ SOURCE=..\..\..\ssh.h | |
| 4812 | # End Source File | |
| 4813 | # Begin Source File | |
| 4814 | ||
| 4815 | +SOURCE=..\..\..\sshrsa.h | |
| 4816 | +# End Source File | |
| 4817 | +# Begin Source File | |
| 4818 | + | |
| 4819 | +SOURCE=..\..\..\sshscard.h | |
| 4820 | +# End Source File | |
| 4821 | +# Begin Source File | |
| 4822 | + | |
| 4823 | SOURCE=..\..\..\storage.h | |
| 4824 | # End Source File | |
| 4825 | # Begin Source File | |
| 4826 | diff -urNp putty-0.58.org/windows/MSVC/putty/putty.dsp putty-0.58+smartcard/windows/MSVC/putty/putty.dsp | |
| 4827 | --- putty-0.58.org/windows/MSVC/putty/putty.dsp 2005-04-05 22:40:17.000000000 +0300 | |
| 4828 | +++ putty-0.58+smartcard/windows/MSVC/putty/putty.dsp 2008-03-15 21:13:29.000000000 +0200 | |
| 4829 | @@ -122,6 +122,14 @@ SOURCE=..\..\..\ldiscucs.c | |
| 4830 | # End Source File | |
| 4831 | # Begin Source File | |
| 4832 | ||
| 4833 | +SOURCE=..\..\..\libpkcs11.c | |
| 4834 | +# End Source File | |
| 4835 | +# Begin Source File | |
| 4836 | + | |
| 4837 | +SOURCE=..\..\..\local_cmd.c | |
| 4838 | +# End Source File | |
| 4839 | +# Begin Source File | |
| 4840 | + | |
| 4841 | SOURCE=..\..\..\logging.c | |
| 4842 | # End Source File | |
| 4843 | # Begin Source File | |
| 4844 | @@ -223,6 +231,10 @@ SOURCE=..\..\..\sshrsa.c | |
| 4845 | # End Source File | |
| 4846 | # Begin Source File | |
| 4847 | ||
| 4848 | +SOURCE=..\..\..\sshscard.c | |
| 4849 | +# End Source File | |
| 4850 | +# Begin Source File | |
| 4851 | + | |
| 4852 | SOURCE=..\..\..\sshsh512.c | |
| 4853 | # End Source File | |
| 4854 | # Begin Source File | |
| 4855 | @@ -363,6 +375,14 @@ SOURCE=..\..\..\network.h | |
| 4856 | # End Source File | |
| 4857 | # Begin Source File | |
| 4858 | ||
| 4859 | +SOURCE=..\..\..\pkcs11.h | |
| 4860 | +# End Source File | |
| 4861 | +# Begin Source File | |
| 4862 | + | |
| 4863 | +SOURCE=..\..\..\ppkcs11.h | |
| 4864 | +# End Source File | |
| 4865 | +# Begin Source File | |
| 4866 | + | |
| 4867 | SOURCE=..\..\..\proxy.h | |
| 4868 | # End Source File | |
| 4869 | # Begin Source File | |
| 4870 | @@ -383,6 +403,14 @@ SOURCE=..\..\..\ssh.h | |
| 4871 | # End Source File | |
| 4872 | # Begin Source File | |
| 4873 | ||
| 4874 | +SOURCE=..\..\..\sshrsa.h | |
| 4875 | +# End Source File | |
| 4876 | +# Begin Source File | |
| 4877 | + | |
| 4878 | +SOURCE=..\..\..\sshscard.h | |
| 4879 | +# End Source File | |
| 4880 | +# Begin Source File | |
| 4881 | + | |
| 4882 | SOURCE=..\..\..\storage.h | |
| 4883 | # End Source File | |
| 4884 | # Begin Source File | |
| 4885 | diff -urNp putty-0.58.org/windows/winhelp.h putty-0.58+smartcard/windows/winhelp.h | |
| 4886 | --- putty-0.58.org/windows/winhelp.h 2005-04-05 22:37:38.000000000 +0300 | |
| 4887 | +++ putty-0.58+smartcard/windows/winhelp.h 2005-06-06 12:50:58.000000000 +0300 | |
| 6256 | 4888 | @@ -99,6 +99,9 @@ |
| 6257 | 4889 | #define WINHELP_CTX_ssh_auth_changeuser "ssh.auth.changeuser" |
| … | … | |
| 6272 | 4904 | #define WINHELP_CTX_ssh_tunnels_x11auth "ssh.tunnels.x11auth" |
| 6273 | 4905 | #define WINHELP_CTX_ssh_tunnels_portfwd "ssh.tunnels.portfwd" |
| 6274 | diff -u |
|
| 6275 | --- putty-0.58.or |
|
| 6276 | +++ putty-0.58 |
|
| 4906 | diff -urNp putty-0.58.org/windows/winpgnt.c putty-0.58+smartcard/windows/winpgnt.c | |
| 4907 | --- putty-0.58.org/windows/winpgnt.c 2005-04-05 22:37:38.000000000 +0300 | |
| 4908 | +++ putty-0.58+smartcard/windows/winpgnt.c 2005-06-06 12:51:02.000000000 +0300 | |
| 6277 | 4909 | @@ -15,6 +15,8 @@ |
| 6278 | 4910 | #include "misc.h" |
| … | … | |
| 6284 | 4916 | |
| 6285 | 4917 | #ifndef NO_SECURITY |
| 6286 | @@ -67,9 +69,16 @@ |
|
| 4918 | @@ -67,9 +69,16 @@ static filereq *keypath = NULL; | |
| 6287 | 4919 | #define PUTTY_DEFAULT "Default%20Settings" |
| 6288 | 4920 | static int initial_menuitems_count; |
| … | … | |
| 6301 | 4933 | { |
| 6302 | 4934 | va_list ap; |
| 6303 | @@ -409,7 +418,7 @@ |
|
| 4935 | @@ -409,7 +418,7 @@ static void add_keyfile(Filename filenam | |
| 6304 | 4936 | int original_pass; |
| 6305 | 4937 | |
| … | … | |
| 6310 | 4942 | key_type_to_str(type)); |
| 6311 | 4943 | message_box(msg, APPNAME, MB_OK | MB_ICONERROR, |
| 6312 | @@ -438,7 +447,12 @@ |
|
| 4944 | @@ -438,7 +447,12 @@ static void add_keyfile(Filename filenam | |
| 6313 | 4945 | keylist = get_keylist1(&keylistlen); |
| 6314 | 4946 | } else { |
| … | … | |
| 6324 | 4956 | char *msg = dupprintf("Couldn't load private key (%s)", error); |
| 6325 | 4957 | message_box(msg, APPNAME, MB_OK | MB_ICONERROR, |
| 6326 | @@ -526,7 +540,11 @@ |
|
| 4958 | @@ -526,7 +540,11 @@ static void add_keyfile(Filename filenam | |
| 6327 | 4959 | error = NULL; |
| 6328 | 4960 | if (type == SSH_KEYTYPE_SSH1) |
| … | … | |
| 6337 | 4969 | attempts = 0; |
| 6338 | 4970 | if (type == SSH_KEYTYPE_SSH1) |
| 6339 | @@ -535,10 +553,10 @@ |
|
| 4971 | @@ -535,10 +553,10 @@ static void add_keyfile(Filename filenam | |
| 6340 | 4972 | pps.comment = comment; |
| 6341 | 4973 | original_pass = 0; |
| … | … | |
| 6350 | 4982 | } else { |
| 6351 | 4983 | int dlgret; |
| 6352 | @@ -559,7 +577,10 @@ |
|
| 4984 | @@ -559,7 +577,10 @@ static void add_keyfile(Filename filenam | |
| 6353 | 4985 | if (type == SSH_KEYTYPE_SSH1) |
| 6354 | 4986 | ret = loadrsakey(&filename, rkey, passphrase, &error); |
| … | … | |
| 6362 | 4994 | ret = -1; |
| 6363 | 4995 | else if (!skey) |
| 6364 | @@ -638,12 +659,19 @@ |
|
| 4996 | @@ -638,12 +659,19 @@ static void add_keyfile(Filename filenam | |
| 6365 | 4997 | } else { |
| 6366 | 4998 | if (add234(rsakeys, rkey) != rkey) |
| … | … | |
| 6383 | 5015 | clen = strlen(skey->comment); |
| 6384 | 5016 | |
| 6385 | @@ -686,6 +714,7 @@ |
|
| 5017 | @@ -686,6 +714,7 @@ static void add_keyfile(Filename filenam | |
| 6386 | 5018 | if (add234(ssh2keys, skey) != skey) { |
| 6387 | 5019 | skey->alg->freekey(skey->data); |
| … | … | |
| 6391 | 5023 | } |
| 6392 | 5024 | } |
| 6393 | @@ -1009,9 +1038,14 @@ |
|
| 5025 | @@ -1009,9 +1038,14 @@ static void answer_msg(void *msg) | |
| 6394 | 5026 | if (msgend < p+datalen) |
| 6395 | 5027 | goto failure; |
| … | … | |
| 6407 | 5039 | len = 5 + 4 + siglen; |
| 6408 | 5040 | PUT_32BIT(ret, len - 4); |
| 6409 | @@ -1285,6 +1319,7 @@ |
|
| 5041 | @@ -1285,6 +1319,7 @@ static void answer_msg(void *msg) | |
| 6410 | 5042 | /* |
| 6411 | 5043 | * Unrecognised message. Return SSH_AGENT_FAILURE. |
| … | … | |
| 6415 | 5047 | ret[4] = SSH_AGENT_FAILURE; |
| 6416 | 5048 | break; |
| 6417 | @@ -2095,6 +2130,7 @@ |
|
| 5049 | @@ -2095,6 +2130,7 @@ int WINAPI WinMain(HINSTANCE inst, HINST | |
| 6418 | 5050 | command = ""; |
| 6419 | 5051 | break; |