diff --git a/src/p11-cancelfunction.c b/src/p11-cancelfunction.c index 12ff890..458385d 100644 --- a/src/p11-cancelfunction.c +++ b/src/p11-cancelfunction.c @@ -1,41 +1,42 @@ /* p11-cancelfunction.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_CancelFunction) (CK_SESSION_HANDLE hSession) +CK_RV CK_SPEC +C_CancelFunction (CK_SESSION_HANDLE hSession) { (void) hSession; return CKR_FUNCTION_NOT_PARALLEL; } diff --git a/src/p11-closeallsessions.c b/src/p11-closeallsessions.c index 0a7f630..c09df24 100644 --- a/src/p11-closeallsessions.c +++ b/src/p11-closeallsessions.c @@ -1,59 +1,59 @@ /* p11-closeallsessions.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" -CK_DEFINE_FUNCTION(CK_RV, C_CloseAllSessions) - (CK_SLOT_ID slotID) +CK_RV CK_SPEC +C_CloseAllSessions (CK_SLOT_ID slotID) { CK_RV err = CKR_OK; slot_iterator_t slot; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; err = slot_close_all_sessions (slot); out: scute_global_unlock (); return err; } diff --git a/src/p11-closesession.c b/src/p11-closesession.c index aa6d361..aeb09d4 100644 --- a/src/p11-closesession.c +++ b/src/p11-closesession.c @@ -1,60 +1,60 @@ /* p11-closesession.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_CloseSession) - (CK_SESSION_HANDLE hSession) + +CK_RV CK_SPEC +C_CloseSession (CK_SESSION_HANDLE hSession) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = slot_close_session (slot, session); out: scute_global_unlock (); return err; } diff --git a/src/p11-copyobject.c b/src/p11-copyobject.c index cf40f8d..8230595 100644 --- a/src/p11-copyobject.c +++ b/src/p11-copyobject.c @@ -1,48 +1,48 @@ /* p11-copyobject.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_CopyObject) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, - CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, - CK_OBJECT_HANDLE_PTR phNewObject) +CK_RV CK_SPEC +C_CopyObject (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, + CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, + CK_OBJECT_HANDLE_PTR phNewObject) { (void) hSession; (void) hObject; (void) pTemplate; (void) ulCount; (void) phNewObject; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-createobject.c b/src/p11-createobject.c index 964dd96..be62075 100644 --- a/src/p11-createobject.c +++ b/src/p11-createobject.c @@ -1,46 +1,46 @@ /* p11-createobject.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_CreateObject) - (CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, - CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phObject) + +CK_RV CK_SPEC +C_CreateObject (CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, + CK_ULONG ulCount, CK_OBJECT_HANDLE_PTR phObject) { (void) hSession; (void) pTemplate; (void) ulCount; (void) phObject; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decrypt.c b/src/p11-decrypt.c index d7a518b..4764102 100644 --- a/src/p11-decrypt.c +++ b/src/p11-decrypt.c @@ -1,48 +1,49 @@ /* p11-decrypt.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_Decrypt) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData, - CK_ULONG ulEncryptedDataLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) +CK_RV CK_SPEC +C_Decrypt (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pEncryptedData, CK_ULONG ulEncryptedDataLen, + CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) { /* FIXME: Implement this. */ (void) hSession; (void) pEncryptedData; (void) ulEncryptedDataLen; (void) pData; (void) pulDataLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decryptdigestupdate.c b/src/p11-decryptdigestupdate.c index bc63615..80943c1 100644 --- a/src/p11-decryptdigestupdate.c +++ b/src/p11-decryptdigestupdate.c @@ -1,47 +1,48 @@ /* p11-decryptdigestupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_DecryptDigestUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, - CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) +CK_RV CK_SPEC +C_DecryptDigestUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, + CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { (void) hSession; (void) pEncryptedPart; (void) ulEncryptedPartLen; (void) pPart; (void) pulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decryptfinal.c b/src/p11-decryptfinal.c index 90c653d..77e41c9 100644 --- a/src/p11-decryptfinal.c +++ b/src/p11-decryptfinal.c @@ -1,46 +1,46 @@ /* p11-decryptfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_DecryptFinal) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastPart, - CK_ULONG_PTR pulLastPartLen) +CK_RV CK_SPEC +C_DecryptFinal (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastPart, + CK_ULONG_PTR pulLastPartLen) { /* FIXME: Implement this. */ (void) hSession; (void) pLastPart; (void) pulLastPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decryptinit.c b/src/p11-decryptinit.c index 5c2d5e6..1f73d8a 100644 --- a/src/p11-decryptinit.c +++ b/src/p11-decryptinit.c @@ -1,46 +1,46 @@ /* p11-decryptinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_DecryptInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) +CK_RV CK_SPEC +C_DecryptInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { /* FIXME: Implement this. */ (void) hSession; (void) pMechanism; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decryptupdate.c b/src/p11-decryptupdate.c index 0797059..4939475 100644 --- a/src/p11-decryptupdate.c +++ b/src/p11-decryptupdate.c @@ -1,47 +1,48 @@ /* p11-decryptupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DecryptUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, - CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) + +CK_RV CK_SPEC +C_DecryptUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pEncryptedPart,CK_ULONG ulEncryptedPartLen, + CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { (void) hSession; (void) pEncryptedPart; (void) ulEncryptedPartLen; (void) pPart; (void) pulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-decryptverifyupdate.c b/src/p11-decryptverifyupdate.c index f157980..d98e546 100644 --- a/src/p11-decryptverifyupdate.c +++ b/src/p11-decryptverifyupdate.c @@ -1,47 +1,48 @@ /* p11-decryptverifyupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_DecryptVerifyUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedPart, - CK_ULONG ulEncryptedPartLen, CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) +CK_RV CK_SPEC +C_DecryptVerifyUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen, + CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen) { (void) hSession; (void) pEncryptedPart; (void) ulEncryptedPartLen; (void) pPart; (void) pulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-derivekey.c b/src/p11-derivekey.c index 6387abb..615ef88 100644 --- a/src/p11-derivekey.c +++ b/src/p11-derivekey.c @@ -1,49 +1,49 @@ /* p11-derivekey.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DeriveKey) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hBaseKey, CK_ATTRIBUTE_PTR pTemplate, - CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey) + +CK_RV CK_SPEC +C_DeriveKey (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hBaseKey, CK_ATTRIBUTE_PTR pTemplate, + CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey) { (void) hSession; (void) pMechanism; (void) hBaseKey; (void) pTemplate; (void) ulAttributeCount; (void) phKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-destroyobject.c b/src/p11-destroyobject.c index 5bf785e..7f942a4 100644 --- a/src/p11-destroyobject.c +++ b/src/p11-destroyobject.c @@ -1,44 +1,43 @@ /* p11-destroyobject.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DestroyObject) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject) +CK_RV CK_SPEC +C_DestroyObject (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject) { /* FIXME: Implement this. */ (void) hSession; (void) hObject; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digest.c b/src/p11-digest.c index 0025463..393a588 100644 --- a/src/p11-digest.c +++ b/src/p11-digest.c @@ -1,47 +1,47 @@ /* p11-digest.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_Digest) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, - CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) +CK_RV CK_SPEC +C_Digest (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, + CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) { (void) hSession; (void) pData; (void) ulDataLen; (void) pDigest; (void) pulDigestLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digestencryptupdate.c b/src/p11-digestencryptupdate.c index 538b593..b608b74 100644 --- a/src/p11-digestencryptupdate.c +++ b/src/p11-digestencryptupdate.c @@ -1,47 +1,49 @@ /* p11-digestencryptupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DigestEncryptUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, - CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) + +CK_RV CK_SPEC +C_DigestEncryptUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pPart, CK_ULONG ulPartLen, + CK_BYTE_PTR pEncryptedPart, + CK_ULONG_PTR pulEncryptedPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; (void) pEncryptedPart; (void) pulEncryptedPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digestfinal.c b/src/p11-digestfinal.c index e98396c..ba29f24 100644 --- a/src/p11-digestfinal.c +++ b/src/p11-digestfinal.c @@ -1,45 +1,45 @@ /* p11-digestfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" -CK_DEFINE_FUNCTION(CK_RV, C_DigestFinal) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest, - CK_ULONG_PTR pulDigestLen) +CK_RV CK_SPEC +C_DigestFinal (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) { (void) hSession; (void) pDigest; (void) pulDigestLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digestinit.c b/src/p11-digestinit.c index 4180350..a4da028 100644 --- a/src/p11-digestinit.c +++ b/src/p11-digestinit.c @@ -1,43 +1,43 @@ /* p11-digestinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DigestInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism) + +CK_RV CK_SPEC +C_DigestInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism) { (void) hSession; (void) pMechanism; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digestkey.c b/src/p11-digestkey.c index ab67e19..0ccf809 100644 --- a/src/p11-digestkey.c +++ b/src/p11-digestkey.c @@ -1,43 +1,42 @@ /* p11-digestkey.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DigestKey) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey) +CK_RV CK_SPEC +C_DigestKey (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey) { (void) hSession; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-digestupdate.c b/src/p11-digestupdate.c index 8da5414..6567582 100644 --- a/src/p11-digestupdate.c +++ b/src/p11-digestupdate.c @@ -1,44 +1,44 @@ /* p11-digestupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_DigestUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) +CK_RV CK_SPEC +C_DigestUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-encrypt.c b/src/p11-encrypt.c index c397f46..254f265 100644 --- a/src/p11-encrypt.c +++ b/src/p11-encrypt.c @@ -1,47 +1,47 @@ /* p11-encrypt.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Encrypt) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, - CK_BYTE_PTR pEncryptedData, CK_ULONG_PTR pulEncryptedDataLen) + +CK_RV CK_SPEC +C_Encrypt (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, + CK_BYTE_PTR pEncryptedData, CK_ULONG_PTR pulEncryptedDataLen) { (void) hSession; (void) pData; (void) ulDataLen; (void) pEncryptedData; (void) pulEncryptedDataLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-encryptfinal.c b/src/p11-encryptfinal.c index 2bc7b45..74010c4 100644 --- a/src/p11-encryptfinal.c +++ b/src/p11-encryptfinal.c @@ -1,45 +1,45 @@ /* p11-encryptfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_EncryptFinal) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastEncryptedPart, - CK_ULONG_PTR pulLastEncryptedPartLen) + +CK_RV CK_SPEC +C_EncryptFinal (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pLastEncryptedPart, + CK_ULONG_PTR pulLastEncryptedPartLen) { (void) hSession; (void) pLastEncryptedPart; (void) pulLastEncryptedPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-encryptinit.c b/src/p11-encryptinit.c index f3276be..0fca3af 100644 --- a/src/p11-encryptinit.c +++ b/src/p11-encryptinit.c @@ -1,45 +1,44 @@ /* p11-encryptinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_EncryptInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) +CK_RV CK_SPEC +C_EncryptInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { (void) hSession; (void) pMechanism; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-encryptupdate.c b/src/p11-encryptupdate.c index 5741dc6..43f9bce 100644 --- a/src/p11-encryptupdate.c +++ b/src/p11-encryptupdate.c @@ -1,47 +1,47 @@ /* p11-encryptupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_EncryptUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, - CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) +CK_RV CK_SPEC +C_EncryptUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pPart, CK_ULONG ulPartLen, + CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; (void) pEncryptedPart; (void) pulEncryptedPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-finalize.c b/src/p11-finalize.c index fd9e21d..de5f989 100644 --- a/src/p11-finalize.c +++ b/src/p11-finalize.c @@ -1,62 +1,63 @@ /* p11-finalize.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #ifdef HAVE_W32_SYSTEM #define __USE_W32_SOCKETS 1 #include #endif #include "cryptoki.h" #include "slots.h" #include "agent.h" #include "locking.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Finalize)(CK_VOID_PTR pReserved) + +CK_RV CK_SPEC +C_Finalize (CK_VOID_PTR pReserved) { /* This is one of the few functions which do not need to take the global lock. */ if (pReserved != NULL_PTR) return CKR_ARGUMENTS_BAD; scute_slots_finalize (); scute_agent_finalize (); scute_locking_finalize (); #ifdef HAVE_W32_SYSTEM WSACleanup (); #endif return CKR_OK; } diff --git a/src/p11-findobjects.c b/src/p11-findobjects.c index 82655e9..26fa879 100644 --- a/src/p11-findobjects.c +++ b/src/p11-findobjects.c @@ -1,83 +1,83 @@ /* p11-findobjects.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include #include "cryptoki.h" #include "locking.h" #include "slots.h" #define MIN(a,b) ((a) < (b) ? (a) : (b)) - -CK_DEFINE_FUNCTION(CK_RV, C_FindObjects) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR phObject, - CK_ULONG ulMaxObjectCount, CK_ULONG_PTR pulObjectCount) + +CK_RV CK_SPEC +C_FindObjects (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE_PTR phObject, + CK_ULONG ulMaxObjectCount, CK_ULONG_PTR pulObjectCount) { CK_RV err = CKR_OK; CK_ULONG count; slot_iterator_t slot; session_iterator_t session; object_iterator_t *oids; int oids_len; if (!pulObjectCount) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = session_get_search_result (slot, session, &oids, &oids_len); assert (!err); count = MIN ((int) ulMaxObjectCount, oids_len); memcpy (phObject, oids, sizeof (CK_OBJECT_HANDLE) * count); oids_len = oids_len - count; memmove (oids, oids + count, sizeof (CK_OBJECT_HANDLE) * oids_len); err = session_set_search_result (slot, session, oids, oids_len); assert (!err); *pulObjectCount = count; out: scute_global_unlock (); return err; } diff --git a/src/p11-findobjectsfinal.c b/src/p11-findobjectsfinal.c index a4a0eaa..4737b27 100644 --- a/src/p11-findobjectsfinal.c +++ b/src/p11-findobjectsfinal.c @@ -1,62 +1,62 @@ /* p11-findobjectsfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsFinal) - (CK_SESSION_HANDLE hSession) + +CK_RV CK_SPEC +C_FindObjectsFinal (CK_SESSION_HANDLE hSession) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = session_set_search_result (slot, session, NULL, 0); out: scute_global_unlock (); return err; } diff --git a/src/p11-findobjectsinit.c b/src/p11-findobjectsinit.c index 7f07d88..4db1d26 100644 --- a/src/p11-findobjectsinit.c +++ b/src/p11-findobjectsinit.c @@ -1,137 +1,138 @@ /* p11-findobjectsinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include "cryptoki.h" #include "locking.h" #include "error-mapping.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_FindObjectsInit) - (CK_SESSION_HANDLE hSession, CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) + +CK_RV CK_SPEC +C_FindObjectsInit (CK_SESSION_HANDLE hSession, + CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; object_iterator_t object; object_iterator_t *search_result; int search_result_len = 0; if (ulCount && pTemplate == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = slot_get_object_count (slot, &search_result_len); if (err) goto out; search_result = malloc (search_result_len * sizeof (object_iterator_t)); if (!search_result) { err = scute_sys_to_ck (errno); goto out; } search_result_len = 0; err = objects_iterate_first (slot, &object); if (err) { free (search_result); goto out; } while (!objects_iterate_last (slot, &object) && !err) { CK_ATTRIBUTE_PTR attr; CK_ULONG attr_count; err = slot_get_object (slot, object, &attr, &attr_count); if (!err) { CK_ULONG count = ulCount; /* For each template attribute, check if it matches the object. */ while (count--) { CK_ULONG i; for (i = 0; i < attr_count; i++) if (attr[i].type == pTemplate[count].type) break; /* Lots of ways not to match. */ if (i == attr_count) break; if (pTemplate[count].ulValueLen != attr[i].ulValueLen) break; if (memcmp (pTemplate[count].pValue, attr[i].pValue, attr[i].ulValueLen)) break; } if (count == (CK_ULONG) -1) { /* Got a match. */ search_result[search_result_len++] = object; } err = objects_iterate_next (slot, &object); } } if (err) { free (search_result); goto out; } err = session_set_search_result (slot, session, search_result, search_result_len); out: scute_global_unlock (); return err; } diff --git a/src/p11-generatekey.c b/src/p11-generatekey.c index 699a4a2..587ad94 100644 --- a/src/p11-generatekey.c +++ b/src/p11-generatekey.c @@ -1,48 +1,48 @@ /* p11-generatekey.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GenerateKey) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, - CK_OBJECT_HANDLE_PTR phKey) + +CK_RV CK_SPEC +C_GenerateKey (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount, + CK_OBJECT_HANDLE_PTR phKey) { (void) hSession; (void) pMechanism; (void) pTemplate; (void) ulCount; (void) phKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-generatekeypair.c b/src/p11-generatekeypair.c index 3300074..d37a2e1 100644 --- a/src/p11-generatekeypair.c +++ b/src/p11-generatekeypair.c @@ -1,53 +1,55 @@ /* p11-generatekeypair.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GenerateKeyPair) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_ATTRIBUTE_PTR pPublicKeyTemplate, CK_ULONG ulPublicKeyAttributeCount, - CK_ATTRIBUTE_PTR pPrivateKeyTemplate, - CK_ULONG ulPrivateKeyAttributeCount, - CK_OBJECT_HANDLE_PTR phPublicKey, CK_OBJECT_HANDLE_PTR phPrivateKey) + +CK_RV CK_SPEC +C_GenerateKeyPair (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_ATTRIBUTE_PTR pPublicKeyTemplate, + CK_ULONG ulPublicKeyAttributeCount, + CK_ATTRIBUTE_PTR pPrivateKeyTemplate, + CK_ULONG ulPrivateKeyAttributeCount, + CK_OBJECT_HANDLE_PTR phPublicKey, + CK_OBJECT_HANDLE_PTR phPrivateKey) { (void) hSession; (void) pMechanism; (void) pPublicKeyTemplate; (void) ulPublicKeyAttributeCount; (void) pPrivateKeyTemplate; (void) ulPrivateKeyAttributeCount; (void) phPublicKey; (void) phPrivateKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-generaterandom.c b/src/p11-generaterandom.c index e8b20d9..338f957 100644 --- a/src/p11-generaterandom.c +++ b/src/p11-generaterandom.c @@ -1,64 +1,64 @@ /* p11-generaterandom.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" #include "agent.h" #include "error-mapping.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GenerateRandom) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pRandomData, - CK_ULONG ulRandomLen) + +CK_RV CK_SPEC +C_GenerateRandom (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pRandomData, CK_ULONG ulRandomLen) { CK_RV err; slot_iterator_t slot; session_iterator_t session; if (pRandomData == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (!err) err = scute_gpg_err_to_ck (scute_agent_get_random (pRandomData, ulRandomLen)); scute_global_unlock (); return err; } diff --git a/src/p11-getattributevalue.c b/src/p11-getattributevalue.c index c988e2c..4dd31c8 100644 --- a/src/p11-getattributevalue.c +++ b/src/p11-getattributevalue.c @@ -1,103 +1,103 @@ /* p11-getattributevalue.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetAttributeValue) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, - CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) + +CK_RV CK_SPEC +C_GetAttributeValue (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, + CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; CK_ATTRIBUTE_PTR attr; CK_ULONG attr_count; if (pTemplate == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = slot_get_object (slot, hObject, &attr, &attr_count); if (err) goto out; while (ulCount--) { CK_ULONG i; for (i = 0; i < attr_count; i++) if (attr[i].type == pTemplate[ulCount].type) break; if (i == attr_count) { pTemplate[ulCount].ulValueLen = -1; err = CKR_ATTRIBUTE_TYPE_INVALID; } else { CK_ATTRIBUTE_PTR attribute = &attr[i]; pTemplate[ulCount].ulValueLen = attribute->ulValueLen; if (pTemplate[ulCount].pValue) { if (pTemplate[ulCount].ulValueLen >= attribute->ulValueLen) memcpy (pTemplate[ulCount].pValue, attribute->pValue, attribute->ulValueLen); else { pTemplate[ulCount].ulValueLen = -1; err = CKR_BUFFER_TOO_SMALL; } } } } out: scute_global_unlock (); return err; } diff --git a/src/p11-getfunctionlist.c b/src/p11-getfunctionlist.c index ae4cf70..f06f8ca 100644 --- a/src/p11-getfunctionlist.c +++ b/src/p11-getfunctionlist.c @@ -1,126 +1,126 @@ /* p11-getfunctionlist.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "settings.h" - + /* The list of exported functions. */ static CK_FUNCTION_LIST function_list = { version: { major: VERSION_MAJOR, minor: VERSION_MINOR }, C_Initialize: C_Initialize, C_Finalize: C_Finalize, C_GetInfo: C_GetInfo, C_GetFunctionList: C_GetFunctionList, C_GetSlotList: C_GetSlotList, C_GetSlotInfo: C_GetSlotInfo, C_GetTokenInfo: C_GetTokenInfo, C_GetMechanismList: C_GetMechanismList, C_GetMechanismInfo: C_GetMechanismInfo, C_InitToken: C_InitToken, C_InitPIN: C_InitPIN, C_SetPIN: C_SetPIN, C_OpenSession: C_OpenSession, C_CloseSession: C_CloseSession, C_CloseAllSessions: C_CloseAllSessions, C_GetSessionInfo: C_GetSessionInfo, C_GetOperationState: C_GetOperationState, C_SetOperationState: C_SetOperationState, C_Login: C_Login, C_Logout: C_Logout, C_CreateObject: C_CreateObject, C_CopyObject: C_CopyObject, C_DestroyObject: C_DestroyObject, C_GetObjectSize: C_GetObjectSize, C_GetAttributeValue: C_GetAttributeValue, C_SetAttributeValue: C_SetAttributeValue, C_FindObjectsInit: C_FindObjectsInit, C_FindObjects: C_FindObjects, C_FindObjectsFinal: C_FindObjectsFinal, C_EncryptInit: C_EncryptInit, C_Encrypt: C_Encrypt, C_EncryptUpdate: C_EncryptUpdate, C_EncryptFinal: C_EncryptFinal, C_DecryptInit: C_DecryptInit, C_Decrypt: C_Decrypt, C_DecryptUpdate: C_DecryptUpdate, C_DecryptFinal: C_DecryptFinal, C_DigestInit: C_DigestInit, C_Digest: C_Digest, C_DigestUpdate: C_DigestUpdate, C_DigestKey: C_DigestKey, C_DigestFinal: C_DigestFinal, C_SignInit: C_SignInit, C_Sign: C_Sign, C_SignUpdate: C_SignUpdate, C_SignFinal: C_SignFinal, C_SignRecoverInit: C_SignRecoverInit, C_SignRecover: C_SignRecover, C_VerifyInit: C_VerifyInit, C_Verify: C_Verify, C_VerifyUpdate: C_VerifyUpdate, C_VerifyFinal: C_VerifyFinal, C_VerifyRecoverInit: C_VerifyRecoverInit, C_VerifyRecover: C_VerifyRecover, C_DigestEncryptUpdate: C_DigestEncryptUpdate, C_DecryptDigestUpdate: C_DecryptDigestUpdate, C_SignEncryptUpdate: C_SignEncryptUpdate, C_DecryptVerifyUpdate: C_DecryptVerifyUpdate, C_GenerateKey: C_GenerateKey, C_GenerateKeyPair: C_GenerateKeyPair, C_WrapKey: C_WrapKey, C_UnwrapKey: C_UnwrapKey, C_DeriveKey: C_DeriveKey, C_SeedRandom: C_SeedRandom, C_GenerateRandom: C_GenerateRandom, C_GetFunctionStatus: C_GetFunctionStatus, C_CancelFunction: C_CancelFunction, C_WaitForSlotEvent: C_WaitForSlotEvent }; - -CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionList) - (CK_FUNCTION_LIST_PTR_PTR ppFunctionList) + +CK_RV CK_SPEC +C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR ppFunctionList) { /* This is one of the few functions which do not need to take the global lock. */ if (ppFunctionList == NULL_PTR) return CKR_ARGUMENTS_BAD; *ppFunctionList = &function_list; return CKR_OK; } diff --git a/src/p11-getfunctionstatus.c b/src/p11-getfunctionstatus.c index 8fe7bc0..8fe156c 100644 --- a/src/p11-getfunctionstatus.c +++ b/src/p11-getfunctionstatus.c @@ -1,41 +1,42 @@ /* p11-getfunctionstatus.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetFunctionStatus) (CK_SESSION_HANDLE hSession) + +CK_RV CK_SPEC +C_GetFunctionStatus (CK_SESSION_HANDLE hSession) { (void) hSession; return CKR_FUNCTION_NOT_PARALLEL; } diff --git a/src/p11-getinfo.c b/src/p11-getinfo.c index 22c53d9..5e053dd 100644 --- a/src/p11-getinfo.c +++ b/src/p11-getinfo.c @@ -1,54 +1,55 @@ /* p11-getinfo.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "support.h" #include "settings.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetInfo)(CK_INFO_PTR pInfo) + +CK_RV CK_SPEC +C_GetInfo (CK_INFO_PTR pInfo) { if (pInfo == NULL_PTR) return CKR_ARGUMENTS_BAD; pInfo->cryptokiVersion.major = CRYPTOKI_VERSION_MAJOR; pInfo->cryptokiVersion.minor = CRYPTOKI_VERSION_MINOR; scute_copy_string (pInfo->manufacturerID, MANUFACTURER_ID, 32); pInfo->flags = 0; scute_copy_string (pInfo->libraryDescription, LIBRARY_DESCRIPTION, 32); pInfo->libraryVersion.major = VERSION_MAJOR; pInfo->libraryVersion.minor = VERSION_MINOR; return CKR_OK; } diff --git a/src/p11-getmechanisminfo.c b/src/p11-getmechanisminfo.c index 1a382d1..2c11e95 100644 --- a/src/p11-getmechanisminfo.c +++ b/src/p11-getmechanisminfo.c @@ -1,67 +1,68 @@ /* p11-getmechanisminfo.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismInfo) - (CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_MECHANISM_INFO_PTR pInfo) + +CK_RV CK_SPEC +C_GetMechanismInfo (CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, + CK_MECHANISM_INFO_PTR pInfo) { CK_RV err = CKR_OK; slot_iterator_t slot; mechanism_iterator_t mechanism; if (pInfo == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; err = mechanisms_lookup (slot, &mechanism, type); if (err) goto out; *pInfo = *(mechanism_get_info (slot, mechanism)); out: scute_global_unlock (); return CKR_OK; } diff --git a/src/p11-getmechanismlist.c b/src/p11-getmechanismlist.c index 1304b2c..2309424 100644 --- a/src/p11-getmechanismlist.c +++ b/src/p11-getmechanismlist.c @@ -1,91 +1,91 @@ /* p11-getmechanismlist.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetMechanismList) - (CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMechanismList, - CK_ULONG_PTR pulCount) + +CK_RV CK_SPEC +C_GetMechanismList (CK_SLOT_ID slotID, CK_MECHANISM_TYPE_PTR pMechanismList, + CK_ULONG_PTR pulCount) { CK_RV err = CKR_OK; CK_ULONG left; slot_iterator_t slot; mechanism_iterator_t mechanism; if (pulCount == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; /* Leave LEFT positive for the whole search when only counting. */ left = pMechanismList ? *pulCount : 1; *pulCount = 0; err = mechanisms_iterate_first (slot, &mechanism); if (err) goto out; while (!mechanisms_iterate_last (slot, &mechanism) && left && !err) { (*pulCount)++; - + if (pMechanismList) { *(pMechanismList++) = mechanism_get_type (slot, mechanism); left--; } err = mechanisms_iterate_next (slot, &mechanism); } if (err) goto out; if (!mechanisms_iterate_last (slot, &mechanism) && !left) { err = CKR_BUFFER_TOO_SMALL; goto out; } out: scute_global_unlock (); return err; } diff --git a/src/p11-getobjectsize.c b/src/p11-getobjectsize.c index f0dcf62..f8076dc 100644 --- a/src/p11-getobjectsize.c +++ b/src/p11-getobjectsize.c @@ -1,45 +1,45 @@ /* p11-getobjectsize.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetObjectSize) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, - CK_ULONG_PTR pulSize) + +CK_RV CK_SPEC +C_GetObjectSize (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, + CK_ULONG_PTR pulSize) { (void) hSession; (void) hObject; (void) pulSize; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-getoperationstate.c b/src/p11-getoperationstate.c index 0da7b5e..ecc4930 100644 --- a/src/p11-getoperationstate.c +++ b/src/p11-getoperationstate.c @@ -1,45 +1,45 @@ /* p11-getoperationstate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetOperationState) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, - CK_ULONG_PTR pulOperationStateLen) + +CK_RV CK_SPEC +C_GetOperationState (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, + CK_ULONG_PTR pulOperationStateLen) { (void) hSession; (void) pOperationState; (void) pulOperationStateLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-getsessioninfo.c b/src/p11-getsessioninfo.c index 97e543e..4ada773 100644 --- a/src/p11-getsessioninfo.c +++ b/src/p11-getsessioninfo.c @@ -1,100 +1,100 @@ /* p11-getsessioninfo.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetSessionInfo) - (CK_SESSION_HANDLE hSession, CK_SESSION_INFO_PTR pInfo) + +CK_RV CK_SPEC +C_GetSessionInfo (CK_SESSION_HANDLE hSession, CK_SESSION_INFO_PTR pInfo) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; bool rw; if (pInfo == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = slots_update_slot (slot); if (err) goto out; /* We have to re-lookup the session handle, as it might just have become invalid. */ err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; rw = session_get_rw (slot, session); switch (slot_get_status (slot)) { case SLOT_LOGIN_PUBLIC: pInfo->state = rw ? CKS_RW_PUBLIC_SESSION : CKS_RO_PUBLIC_SESSION; break; case SLOT_LOGIN_USER: pInfo->state = rw ? CKS_RW_USER_FUNCTIONS : CKS_RO_USER_FUNCTIONS; break; case SLOT_LOGIN_SO: assert (rw); pInfo->state = CKS_RW_SO_FUNCTIONS; break; default: assert (!"Unhandled slot login state."); break; } pInfo->slotID = slot_get_id (slot); pInfo->flags = CKF_SERIAL_SESSION | (rw ? CKF_RW_SESSION : 0); pInfo->ulDeviceError = 0; out: scute_global_unlock (); return err; } diff --git a/src/p11-getslotinfo.c b/src/p11-getslotinfo.c index cf0ee4b..27b35df 100644 --- a/src/p11-getslotinfo.c +++ b/src/p11-getslotinfo.c @@ -1,87 +1,87 @@ /* p11-getslotinfo.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #include #include "cryptoki.h" #include "agent.h" #include "locking.h" #include "support.h" #include "settings.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetSlotInfo) - (CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo) + +CK_RV CK_SPEC +C_GetSlotInfo (CK_SLOT_ID slotID, CK_SLOT_INFO_PTR pInfo) { CK_RV err = CKR_OK; slot_iterator_t slot; const char *s; int minor; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; err = slots_update_slot (slot); if (err) goto out; /* FIXME: Query some of this from SCD. */ scute_copy_string (pInfo->slotDescription, SLOT_DESCRIPTION, 64); scute_copy_string (pInfo->manufacturerID, SLOT_MANUFACTURER_ID, 32); pInfo->flags = CKF_REMOVABLE_DEVICE | CKF_HW_SLOT; if (slot_token_present (slot)) pInfo->flags |= CKF_TOKEN_PRESENT; /* Use the gpg-agent version for the hardware version.. */ pInfo->hardwareVersion.major = scute_agent_get_agent_version (&minor); pInfo->hardwareVersion.minor = minor; /* Use Scute version as Firmware version. */ s = PACKAGE_VERSION; pInfo->firmwareVersion.major = atoi (s); s = strchr (s, '.'); pInfo->firmwareVersion.minor = s? atoi (s+1): 0; out: scute_global_unlock (); return err; } diff --git a/src/p11-getslotlist.c b/src/p11-getslotlist.c index 308e887..79bab9e 100644 --- a/src/p11-getslotlist.c +++ b/src/p11-getslotlist.c @@ -1,95 +1,96 @@ /* p11-getslotlist.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" -CK_DEFINE_FUNCTION(CK_RV, C_GetSlotList) - (CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, CK_ULONG_PTR pulCount) +CK_RV CK_SPEC +C_GetSlotList (CK_BBOOL tokenPresent, CK_SLOT_ID_PTR pSlotList, + CK_ULONG_PTR pulCount) { CK_RV err = CKR_OK; CK_ULONG left; slot_iterator_t slot; if (pulCount == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; if (pSlotList == NULL_PTR) { err = slots_update (); if (err) goto out; } /* Leave LEFT positive for the whole search when only counting. */ left = pSlotList ? *pulCount : 1; *pulCount = 0; err = slots_iterate_first (&slot); if (err) goto out; while (!slots_iterate_last (&slot) && left && !err) { if (!tokenPresent || slot_token_present (slot)) { (*pulCount)++; if (pSlotList) { *(pSlotList++) = slot_get_id (slot); left--; } } err = slots_iterate_next (&slot); } if (err) goto out; if (!slots_iterate_last (&slot) && !left) { err = CKR_BUFFER_TOO_SMALL; goto out; } out: scute_global_unlock (); return err; } diff --git a/src/p11-gettokeninfo.c b/src/p11-gettokeninfo.c index c0a2417..3a78598 100644 --- a/src/p11-gettokeninfo.c +++ b/src/p11-gettokeninfo.c @@ -1,120 +1,120 @@ /* p11-gettokeninfo.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "support.h" #include "settings.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_GetTokenInfo) - (CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo) + +CK_RV CK_SPEC +C_GetTokenInfo (CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo) { CK_RV err = CKR_OK; slot_iterator_t slot; int len; int max; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; if (!slot_token_present (slot)) { err = CKR_TOKEN_NOT_PRESENT; goto out; } scute_copy_string (pInfo->label, slot_token_label (slot), 32); scute_copy_string (pInfo->manufacturerID, slot_token_manufacturer (slot), 32); scute_copy_string (pInfo->model, slot_token_application (slot), 16); len = slot_token_serial (slot, pInfo->serialNumber); while (len < 16) pInfo->serialNumber[len++] = ' '; pInfo->flags = CKF_TOKEN_INITIALIZED | CKF_PROTECTED_AUTHENTICATION_PATH | CKF_WRITE_PROTECTED | CKF_USER_PIN_INITIALIZED; if (slot_token_has_rng (slot)) pInfo->flags |= CKF_RNG; /* FIXME: CKF_USER_PIN_INITIALIZED only if PIN is not default pin? FIXME: CKF_LOGIN_REQUIRED needed? We could implement login via the "SCD CHECKPIN" command. I am not sure how this mixes with CKF_PROTECTED_AUTHENTICATION_PATH. - Not supported: + Not supported: CKF_RESTORE_KEY_NOT_NEEDED, CKF_DUAL_CRYPTO_OPERATIONS. FIXME: We can support those, but do we worry about SO operations? CKF_SO_PIN_COUNT_LOW, CKF_SO_PIN_FINAL_TRY, CKF_SO_PIN_LOCKED. Not supported: CKF_USER_PIN_TO_BE_CHANGED, CKF_SO_PIN_TO_BE_CHANGED. */ - + slot_token_pincount (slot, &max, &len); if (len < max) pInfo->flags |= CKF_USER_PIN_COUNT_LOW; if (len == 1) pInfo->flags |= CKF_USER_PIN_FINAL_TRY; else if (len == 0) pInfo->flags |= CKF_USER_PIN_LOCKED; pInfo->ulMaxSessionCount = CK_UNAVAILABLE_INFORMATION; pInfo->ulSessionCount = CK_UNAVAILABLE_INFORMATION; pInfo->ulMaxRwSessionCount = CK_UNAVAILABLE_INFORMATION; pInfo->ulRwSessionCount = CK_UNAVAILABLE_INFORMATION; slot_token_maxpinlen (slot, &pInfo->ulMaxPinLen, &pInfo->ulMinPinLen); /* FIXME: Get the data from SCD? */ pInfo->ulTotalPublicMemory = CK_UNAVAILABLE_INFORMATION; pInfo->ulFreePublicMemory = CK_UNAVAILABLE_INFORMATION; pInfo->ulTotalPrivateMemory = CK_UNAVAILABLE_INFORMATION; pInfo->ulFreePrivateMemory = CK_UNAVAILABLE_INFORMATION; slot_token_version (slot, &pInfo->hardwareVersion.major, &pInfo->hardwareVersion.minor, &pInfo->firmwareVersion.major, &pInfo->firmwareVersion.minor); scute_copy_string (pInfo->utcTime, "0000000000000000", 16); out: scute_global_unlock (); return err; } diff --git a/src/p11-initialize.c b/src/p11-initialize.c index c576da7..d52ab59 100644 --- a/src/p11-initialize.c +++ b/src/p11-initialize.c @@ -1,128 +1,129 @@ /* p11-initialize.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include #ifdef HAVE_W32_SYSTEM #define __USE_W32_SOCKETS 1 #include #endif #include #include #include "cryptoki.h" #include "settings.h" #include "locking.h" #include "agent.h" #include "error-mapping.h" #include "slots.h" #include "debug.h" -CK_DEFINE_FUNCTION(CK_RV, C_Initialize) (CK_VOID_PTR pInitArgs) +CK_RV CK_SPEC +C_Initialize (CK_VOID_PTR pInitArgs) { CK_RV err; - + #ifdef HAVE_W32_SYSTEM WSADATA wsadat; WSAStartup (0x202, &wsadat); #endif /* This is one of the few functions which do not need to take the global lock. */ assuan_set_gpg_err_source (GPG_ERR_SOURCE_ANY); _scute_debug_init (); /* Check the threading configuration. */ if (pInitArgs != NULL_PTR) { CK_C_INITIALIZE_ARGS_PTR args = pInitArgs; bool callbacks; if (args->pReserved != NULL_PTR) return CKR_ARGUMENTS_BAD; if (NEED_TO_CREATE_THREADS && (args->flags & CKF_LIBRARY_CANT_CREATE_OS_THREADS)) return CKR_NEED_TO_CREATE_THREADS; /* Either all pointers are provided, or none are. */ if (args->CreateMutex == NULL_PTR) { if (args->DestroyMutex != NULL_PTR || args->LockMutex != NULL_PTR || args->UnlockMutex != NULL_PTR) return CKR_ARGUMENTS_BAD; callbacks = false; } else { if (args->DestroyMutex == NULL_PTR || args->LockMutex == NULL_PTR || args->UnlockMutex == NULL_PTR) return CKR_ARGUMENTS_BAD; callbacks = true; } /* FIXME: At this point, we do not support using the native thread package. */ if (!callbacks && (args->flags & CKF_OS_LOCKING_OK)) return CKR_CANT_LOCK; } err = scute_locking_initialize (pInitArgs); if (err) return err; err = scute_agent_initialize (); if (err) { scute_locking_finalize (); return scute_gpg_err_to_ck (err); } err = scute_slots_initialize (); if (err) { scute_agent_finalize (); scute_locking_finalize (); return err; } return err; } diff --git a/src/p11-initpin.c b/src/p11-initpin.c index 1512060..1c7d327 100644 --- a/src/p11-initpin.c +++ b/src/p11-initpin.c @@ -1,44 +1,44 @@ /* p11-initpin.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_InitPIN) - (CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) + +CK_RV CK_SPEC +C_InitPIN (CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) { (void) hSession; (void) pPin; (void) ulPinLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-inittoken.c b/src/p11-inittoken.c index 63ab1cc..0586c4e 100644 --- a/src/p11-inittoken.c +++ b/src/p11-inittoken.c @@ -1,46 +1,46 @@ /* p11-inittoken.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_InitToken) - (CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, - CK_UTF8CHAR_PTR pLabel) + +CK_RV CK_SPEC +C_InitToken (CK_SLOT_ID slotID, CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen, + CK_UTF8CHAR_PTR pLabel) { (void) slotID; (void) pPin; (void) ulPinLen; (void) pLabel; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-login.c b/src/p11-login.c index bcc4796..afb6a8e 100644 --- a/src/p11-login.c +++ b/src/p11-login.c @@ -1,46 +1,46 @@ /* p11-login.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Login) - (CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, CK_UTF8CHAR_PTR pPin, - CK_ULONG ulPinLen) + +CK_RV CK_SPEC +C_Login (CK_SESSION_HANDLE hSession, CK_USER_TYPE userType, + CK_UTF8CHAR_PTR pPin, CK_ULONG ulPinLen) { (void) hSession; (void) userType; (void) pPin; (void) ulPinLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-logout.c b/src/p11-logout.c index cea1cb2..bb83a3b 100644 --- a/src/p11-logout.c +++ b/src/p11-logout.c @@ -1,42 +1,42 @@ /* p11-logout.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Logout) - (CK_SESSION_HANDLE hSession) + +CK_RV CK_SPEC +C_Logout (CK_SESSION_HANDLE hSession) { (void) hSession; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-opensession.c b/src/p11-opensession.c index bc2502b..32f197c 100644 --- a/src/p11-opensession.c +++ b/src/p11-opensession.c @@ -1,77 +1,79 @@ /* p11-opensession.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_OpenSession) - (CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApplication, - CK_NOTIFY Notify, CK_SESSION_HANDLE_PTR phSession) + +CK_RV CK_SPEC +C_OpenSession (CK_SLOT_ID slotID, CK_FLAGS flags, CK_VOID_PTR pApplication, + CK_NOTIFY Notify, CK_SESSION_HANDLE_PTR phSession) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; if (!(flags & CKF_SERIAL_SESSION)) return CKR_SESSION_PARALLEL_NOT_SUPPORTED; /* We only support read-only operation for now. */ if (flags & CKF_RW_SESSION) return CKR_TOKEN_WRITE_PROTECTED; /* We ignore the notification callback data in pApplication and Notify. We never call back into the application. */ + (void)pApplication; + (void)Notify; err = scute_global_lock (); if (err) return err; err = slots_lookup (slotID, &slot); if (err) goto out; - + err = slot_create_session (slot, &session, flags & CKF_RW_SESSION); if (err) goto out; - + /* FIXME: Further initialisation comes here. */ - + *phSession = session; out: scute_global_unlock (); return err; } diff --git a/src/p11-seedrandom.c b/src/p11-seedrandom.c index 437b652..883e2e3 100644 --- a/src/p11-seedrandom.c +++ b/src/p11-seedrandom.c @@ -1,44 +1,44 @@ /* p11-seedrandom.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SeedRandom) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_ULONG ulSeedLen) + +CK_RV CK_SPEC +C_SeedRandom (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_ULONG ulSeedLen) { (void) hSession; (void) pSeed; (void) ulSeedLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-setattributevalue.c b/src/p11-setattributevalue.c index 271361b..92117b7 100644 --- a/src/p11-setattributevalue.c +++ b/src/p11-setattributevalue.c @@ -1,46 +1,46 @@ /* p11-setattributevalue.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SetAttributeValue) - (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, - CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) + +CK_RV CK_SPEC +C_SetAttributeValue (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hObject, + CK_ATTRIBUTE_PTR pTemplate, CK_ULONG ulCount) { (void) hSession; (void) hObject; (void) pTemplate; (void) ulCount; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-setoperationstate.c b/src/p11-setoperationstate.c index 9b9f470..716b93b 100644 --- a/src/p11-setoperationstate.c +++ b/src/p11-setoperationstate.c @@ -1,48 +1,49 @@ /* p11-setoperationstate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SetOperationState) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pOperationState, - CK_ULONG ulOperationStateLen, CK_OBJECT_HANDLE hEncryptionKey, - CK_OBJECT_HANDLE hAuthenticationKey) + +CK_RV CK_SPEC +C_SetOperationState (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pOperationState, CK_ULONG ulOperationStateLen, + CK_OBJECT_HANDLE hEncryptionKey, + CK_OBJECT_HANDLE hAuthenticationKey) { (void) hSession; (void) pOperationState; (void) ulOperationStateLen; (void) hEncryptionKey; (void) hAuthenticationKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-setpin.c b/src/p11-setpin.c index 6924bf0..ce8eefc 100644 --- a/src/p11-setpin.c +++ b/src/p11-setpin.c @@ -1,47 +1,48 @@ /* p11-setpin.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SetPIN) - (CK_SESSION_HANDLE hSession, CK_UTF8CHAR_PTR pOldPin, CK_ULONG ulOldLen, - CK_UTF8CHAR_PTR pNewPin, CK_ULONG ulNewLen) + +CK_RV CK_SPEC +C_SetPIN (CK_SESSION_HANDLE hSession, + CK_UTF8CHAR_PTR pOldPin, CK_ULONG ulOldLen, + CK_UTF8CHAR_PTR pNewPin, CK_ULONG ulNewLen) { (void) hSession; (void) pOldPin; (void) ulOldLen; (void) pNewPin; (void) ulNewLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-sign.c b/src/p11-sign.c index 1ffce2e..ceb262e 100644 --- a/src/p11-sign.c +++ b/src/p11-sign.c @@ -1,66 +1,66 @@ /* p11-sign.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Sign) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, - CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) + +CK_RV CK_SPEC +C_Sign (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, + CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; if (pData == NULL_PTR || pulSignatureLen == NULL_PTR) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; /* FIXME: Who cares if they called sign init correctly. */ err = session_sign (slot, session, pData, ulDataLen, pSignature, pulSignatureLen); out: scute_global_unlock (); return err; } diff --git a/src/p11-signencryptupdate.c b/src/p11-signencryptupdate.c index d869b4b..21377a7 100644 --- a/src/p11-signencryptupdate.c +++ b/src/p11-signencryptupdate.c @@ -1,47 +1,49 @@ /* p11-signencryptupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignEncryptUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen, - CK_BYTE_PTR pEncryptedPart, CK_ULONG_PTR pulEncryptedPartLen) + +CK_RV CK_SPEC +C_SignEncryptUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pPart, CK_ULONG ulPartLen, + CK_BYTE_PTR pEncryptedPart, + CK_ULONG_PTR pulEncryptedPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; (void) pEncryptedPart; (void) pulEncryptedPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-signfinal.c b/src/p11-signfinal.c index 0aa2f49..f136c0f 100644 --- a/src/p11-signfinal.c +++ b/src/p11-signfinal.c @@ -1,45 +1,45 @@ /* p11-signfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignFinal) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, - CK_ULONG_PTR pulSignatureLen) + +CK_RV CK_SPEC +C_SignFinal (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { (void) hSession; (void) pSignature; (void) pulSignatureLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-signinit.c b/src/p11-signinit.c index 89e2ad7..560f37e 100644 --- a/src/p11-signinit.c +++ b/src/p11-signinit.c @@ -1,67 +1,67 @@ /* p11-signinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" #include "locking.h" #include "slots.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) + +CK_RV CK_SPEC +C_SignInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { CK_RV err = CKR_OK; slot_iterator_t slot; session_iterator_t session; if (pMechanism == NULL_PTR || pMechanism->mechanism != CKM_RSA_PKCS) return CKR_ARGUMENTS_BAD; if (hKey == CK_INVALID_HANDLE) return CKR_ARGUMENTS_BAD; err = scute_global_lock (); if (err) return err; err = slots_lookup_session (hSession, &slot, &session); if (err) goto out; err = session_set_signing_key (slot, session, hKey); out: scute_global_unlock (); return err; } diff --git a/src/p11-signrecover.c b/src/p11-signrecover.c index d1283e5..c7e097d 100644 --- a/src/p11-signrecover.c +++ b/src/p11-signrecover.c @@ -1,47 +1,48 @@ /* p11-signrecover.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignRecover) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, - CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) + +CK_RV CK_SPEC +C_SignRecover (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pData, CK_ULONG ulDataLen, + CK_BYTE_PTR pSignature, CK_ULONG_PTR pulSignatureLen) { (void) hSession; (void) pData; (void) ulDataLen; (void) pSignature; (void) pulSignatureLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-signrecoverinit.c b/src/p11-signrecoverinit.c index 6c3373d..39b18bb 100644 --- a/src/p11-signrecoverinit.c +++ b/src/p11-signrecoverinit.c @@ -1,45 +1,45 @@ /* p11-signrecoverinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignRecoverInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) + +CK_RV CK_SPEC +C_SignRecoverInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { (void) hSession; (void) pMechanism; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-signupdate.c b/src/p11-signupdate.c index 229f888..b8e2500 100644 --- a/src/p11-signupdate.c +++ b/src/p11-signupdate.c @@ -1,44 +1,44 @@ /* p11-signupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_SignUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) + +CK_RV CK_SPEC +C_SignUpdate (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-unwrapkey.c b/src/p11-unwrapkey.c index 91a2640..ac1f6e0 100644 --- a/src/p11-unwrapkey.c +++ b/src/p11-unwrapkey.c @@ -1,52 +1,52 @@ /* p11-unwrapkey.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_UnwrapKey) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hUnwrappingKey, CK_BYTE_PTR pWrappedKey, - CK_ULONG ulWrappedKeyLen, CK_ATTRIBUTE_PTR pTemplate, - CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey) + +CK_RV CK_SPEC +C_UnwrapKey (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hUnwrappingKey, CK_BYTE_PTR pWrappedKey, + CK_ULONG ulWrappedKeyLen, CK_ATTRIBUTE_PTR pTemplate, + CK_ULONG ulAttributeCount, CK_OBJECT_HANDLE_PTR phKey) { (void) hSession; (void) pMechanism; (void) hUnwrappingKey; (void) pWrappedKey; (void) ulWrappedKeyLen; (void) pTemplate; (void) ulAttributeCount; (void) phKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verify.c b/src/p11-verify.c index af3944c..e4eb00e 100644 --- a/src/p11-verify.c +++ b/src/p11-verify.c @@ -1,47 +1,47 @@ /* p11-verify.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_Verify) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, - CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen) + +CK_RV CK_SPEC +C_Verify (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, + CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen) { (void) hSession; (void) pData; (void) ulDataLen; (void) pSignature; (void) ulSignatureLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verifyfinal.c b/src/p11-verifyfinal.c index 672f226..1ac34da 100644 --- a/src/p11-verifyfinal.c +++ b/src/p11-verifyfinal.c @@ -1,45 +1,45 @@ /* p11-verifyfinal.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_VerifyFinal) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, - CK_ULONG ulSignatureLen) + +CK_RV CK_SPEC +C_VerifyFinal (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen) { (void) hSession; (void) pSignature; (void) ulSignatureLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verifyinit.c b/src/p11-verifyinit.c index 61d3682..b548849 100644 --- a/src/p11-verifyinit.c +++ b/src/p11-verifyinit.c @@ -1,45 +1,45 @@ /* p11-verifyinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_VerifyInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) + +CK_RV CK_SPEC +C_VerifyInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { (void) hSession; (void) pMechanism; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verifyrecover.c b/src/p11-verifyrecover.c index 76219fb..c8df451 100644 --- a/src/p11-verifyrecover.c +++ b/src/p11-verifyrecover.c @@ -1,47 +1,48 @@ /* p11-verifyrecover.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecover) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSignature, - CK_ULONG ulSignatureLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) + +CK_RV CK_SPEC +C_VerifyRecover (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pSignature, CK_ULONG ulSignatureLen, + CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen) { (void) hSession; (void) pSignature; (void) ulSignatureLen; (void) pData; (void) pulDataLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verifyrecoverinit.c b/src/p11-verifyrecoverinit.c index 1c98dfa..fe45cd4 100644 --- a/src/p11-verifyrecoverinit.c +++ b/src/p11-verifyrecoverinit.c @@ -1,45 +1,45 @@ /* p11-verifyrecoverinit.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_VerifyRecoverInit) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hKey) + +CK_RV CK_SPEC +C_VerifyRecoverInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hKey) { (void) hSession; (void) pMechanism; (void) hKey; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-verifyupdate.c b/src/p11-verifyupdate.c index b667ef0..7d7699e 100644 --- a/src/p11-verifyupdate.c +++ b/src/p11-verifyupdate.c @@ -1,44 +1,45 @@ /* p11-verifyupdate.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_VerifyUpdate) - (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) + +CK_RV CK_SPEC +C_VerifyUpdate (CK_SESSION_HANDLE hSession, + CK_BYTE_PTR pPart, CK_ULONG ulPartLen) { (void) hSession; (void) pPart; (void) ulPartLen; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-waitforslotevent.c b/src/p11-waitforslotevent.c index 9cd7de9..af443fb 100644 --- a/src/p11-waitforslotevent.c +++ b/src/p11-waitforslotevent.c @@ -1,45 +1,45 @@ /* p11-waitforslotevent.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_WaitForSlotEvent) - (CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, CK_VOID_PTR pReserved) + +CK_RV CK_SPEC +C_WaitForSlotEvent (CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, CK_VOID_PTR pReserved) { /* See the TODO file why this is not implemented. */ (void) flags; (void) pSlot; (void) pReserved; return CKR_FUNCTION_NOT_SUPPORTED; } diff --git a/src/p11-wrapkey.c b/src/p11-wrapkey.c index ca031bd..e717957 100644 --- a/src/p11-wrapkey.c +++ b/src/p11-wrapkey.c @@ -1,49 +1,49 @@ /* p11-wrapkey.c - Cryptoki implementation. Copyright (C) 2006 g10 Code GmbH This file is part of Scute. - + Scute is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Scute is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Scute; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA In addition, as a special exception, g10 Code GmbH gives permission to link this library: with the Mozilla Foundation's code for Mozilla (or with modified versions of it that use the same license as the "Mozilla" code), and distribute the linked executables. You must obey the GNU General Public License in all respects for all of the code used other than "Mozilla". If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ #if HAVE_CONFIG_H #include #endif #include "cryptoki.h" - -CK_DEFINE_FUNCTION(CK_RV, C_WrapKey) - (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, - CK_OBJECT_HANDLE hWrappingKey, CK_OBJECT_HANDLE hKey, - CK_BYTE_PTR pWrappedKey, CK_ULONG_PTR pulWrappedKeyLen) + +CK_RV CK_SPEC +C_WrapKey (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, + CK_OBJECT_HANDLE hWrappingKey, CK_OBJECT_HANDLE hKey, + CK_BYTE_PTR pWrappedKey, CK_ULONG_PTR pulWrappedKeyLen) { (void) hSession; (void) pMechanism; (void) hWrappingKey; (void) hKey; (void) pWrappedKey; (void) pulWrappedKeyLen; return CKR_FUNCTION_NOT_SUPPORTED; }