Skip to content
Snippets Groups Projects
Select Git revision
  • pu
  • passt default
  • master
  • todo
  • next
  • maint
  • v2.8.0-rc1
  • v2.8.0-rc0
  • v2.7.2
  • v2.7.1
  • v2.7.0
  • v2.6.5
  • v2.7.0-rc3
  • v2.7.0-rc2
  • v2.7.0-rc1
  • v2.7.0-rc0
  • v2.6.4
  • v2.6.3
  • v2.6.2
  • v2.6.1
  • v2.3.10
  • v2.5.4
  • v2.4.10
  • v2.6.0
  • v2.6.0-rc3
  • v2.5.3
26 results

check-racy.c

Blame
    • Junio C Hamano's avatar
      4bd5b7da
      ce_match_stat, run_diff_files: use symbolic constants for readability · 4bd5b7da
      Junio C Hamano authored
      
      ce_match_stat() can be told:
      
       (1) to ignore CE_VALID bit (used under "assume unchanged" mode)
           and perform the stat comparison anyway;
      
       (2) not to perform the contents comparison for racily clean
           entries and report mismatch of cached stat information;
      
      using its "option" parameter.  Give them symbolic constants.
      
      Similarly, run_diff_files() can be told not to report anything
      on removed paths.  Also give it a symbolic constant for that.
      
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      4bd5b7da
      History
      ce_match_stat, run_diff_files: use symbolic constants for readability
      Junio C Hamano authored
      
      ce_match_stat() can be told:
      
       (1) to ignore CE_VALID bit (used under "assume unchanged" mode)
           and perform the stat comparison anyway;
      
       (2) not to perform the contents comparison for racily clean
           entries and report mismatch of cached stat information;
      
      using its "option" parameter.  Give them symbolic constants.
      
      Similarly, run_diff_files() can be told not to report anything
      on removed paths.  Also give it a symbolic constant for that.
      
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    seqiv.c 8.53 KiB
    /*
     * seqiv: Sequence Number IV Generator
     *
     * This generator generates an IV based on a sequence number by xoring it
     * with a salt.  This algorithm is mainly useful for CTR and similar modes.
     *
     * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
     *
     * This program 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.
     *
     */
    
    #include <crypto/internal/aead.h>
    #include <crypto/internal/skcipher.h>
    #include <crypto/rng.h>
    #include <linux/err.h>
    #include <linux/init.h>
    #include <linux/kernel.h>
    #include <linux/module.h>
    #include <linux/slab.h>
    #include <linux/spinlock.h>
    #include <linux/string.h>
    
    struct seqiv_ctx {
    	spinlock_t lock;
    	u8 salt[] __attribute__ ((aligned(__alignof__(u32))));
    };
    
    static void seqiv_complete2(struct skcipher_givcrypt_request *req, int err)
    {
    	struct ablkcipher_request *subreq = skcipher_givcrypt_reqctx(req);
    	struct crypto_ablkcipher *geniv;
    
    	if (err == -EINPROGRESS)
    		return;
    
    	if (err)
    		goto out;
    
    	geniv = skcipher_givcrypt_reqtfm(req);
    	memcpy(req->creq.info, subreq->info, crypto_ablkcipher_ivsize(geniv));
    
    out:
    	kfree(subreq->info);
    }
    
    static void seqiv_complete(struct crypto_async_request *base, int err)
    {
    	struct skcipher_givcrypt_request *req = base->data;
    
    	seqiv_complete2(req, err);
    	skcipher_givcrypt_complete(req, err);
    }
    
    static void seqiv_aead_complete2(struct aead_givcrypt_request *req, int err)
    {
    	struct aead_request *subreq = aead_givcrypt_reqctx(req);
    	struct crypto_aead *geniv;
    
    	if (err == -EINPROGRESS)
    		return;
    
    	if (err)
    		goto out;
    
    	geniv = aead_givcrypt_reqtfm(req);
    	memcpy(req->areq.iv, subreq->iv, crypto_aead_ivsize(geniv));