~ubuntu-branches/ubuntu/hardy/opencryptoki/hardy

« back to all changes in this revision

Viewing changes to usr/lib/pkcs11/common/verify_mgr.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 14:22:58 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124142258-i0nmjvqoy6wxe8x1
Tags: 2.2.5+dfsg-1ubuntu1
* Merge from debian unstable
* debian/libopencryptoki0.install, debian/libopencryptoki-dev.install: 
  - removed /usr/lib/opencryptoki/stdll/*, it's empty now
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
// Verify manager routines
295
295
//
296
296
 
297
 
//#include <windows.h>
298
297
#include <pthread.h>
299
298
#include <string.h>            // for memcmp() et al
300
299
#include <stdlib.h>
493
492
      case CKM_MD2_HMAC:
494
493
      case CKM_MD5_HMAC:
495
494
      case CKM_SHA_1_HMAC:
 
495
      case CKM_SHA256_HMAC:
496
496
         {
497
497
            if (mech->ulParameterLen != 0){
498
498
               st_err_log(29, __FILE__, __LINE__);
521
521
      case CKM_MD2_HMAC_GENERAL:
522
522
      case CKM_MD5_HMAC_GENERAL:
523
523
      case CKM_SHA_1_HMAC_GENERAL:
 
524
      case CKM_SHA256_HMAC_GENERAL:
524
525
         {
525
526
            CK_MAC_GENERAL_PARAMS *param = (CK_MAC_GENERAL_PARAMS *)mech->pParameter;
526
527
 
540
541
               st_err_log(29, __FILE__, __LINE__);
541
542
               return CKR_MECHANISM_PARAM_INVALID;
542
543
            }
 
544
            if ((mech->mechanism == CKM_SHA256_HMAC_GENERAL) && (*param > 32)){
 
545
               st_err_log(29, __FILE__, __LINE__);
 
546
               return CKR_MECHANISM_PARAM_INVALID;
 
547
            }
543
548
            rc = template_attribute_find( key_obj->template, CKA_KEY_TYPE, &attr );
544
549
            if (rc == FALSE){
545
550
               st_err_log(20, __FILE__, __LINE__);
746
751
                                  in_data,   in_data_len,
747
752
                                  signature, sig_len );
748
753
 
 
754
      case CKM_SHA256_HMAC:
 
755
      case CKM_SHA256_HMAC_GENERAL:
 
756
         return sha2_hmac_verify( sess,      ctx,
 
757
                                  in_data,   in_data_len,
 
758
                                  signature, sig_len );
 
759
 
749
760
      case CKM_SSL3_MD5_MAC:
750
761
      case CKM_SSL3_SHA1_MAC:
751
762
         return ssl3_mac_verify( sess,      ctx,