sha2-sparc-fix.diff

text/plain

Filename: sha2-sparc-fix.diff
Type: text/plain
Part: 0
Message: 4 pgcrypto regressions failures - 1 unsolved

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: context
File+
contrib/pgcrypto/sha2.c 3 14
Index: pgsql/contrib/pgcrypto/sha2.c
===================================================================
*** pgsql.orig/contrib/pgcrypto/sha2.c
--- pgsql/contrib/pgcrypto/sha2.c
*************** SHA256_Update(SHA256_CTX *context, const
*** 496,502 ****
  void
  SHA256_Final(uint8 digest[], SHA256_CTX *context)
  {
- 	uint32	*d = (uint32 *)digest;
  	unsigned int	usedspace;
  
  	/* If no digest buffer is passed, we don't bother doing this: */
--- 496,501 ----
*************** SHA256_Final(uint8 digest[], SHA256_CTX 
*** 542,553 ****
  			int	j;
  			for (j = 0; j < 8; j++) {
  				REVERSE32(context->state[j],context->state[j]);
- 				*d++ = context->state[j];
  			}
  		}
- #else
- 		bcopy(context->state, d, SHA256_DIGEST_LENGTH);
  #endif
  	}
  
  	/* Clean up state data: */
--- 541,550 ----
  			int	j;
  			for (j = 0; j < 8; j++) {
  				REVERSE32(context->state[j],context->state[j]);
  			}
  		}
  #endif
+ 		bcopy(context->state, digest, SHA256_DIGEST_LENGTH);
  	}
  
  	/* Clean up state data: */
*************** SHA512_Last(SHA512_CTX *context)
*** 823,830 ****
  void
  SHA512_Final(uint8 digest[], SHA512_CTX *context)
  {
- 	uint64	*d = (uint64 *)digest;
- 
  	/* If no digest buffer is passed, we don't bother doing this: */
  	if (digest != NULL) {
  		SHA512_Last(context);
--- 820,825 ----
*************** SHA512_Final(uint8 digest[], SHA512_CTX 
*** 836,847 ****
  			int	j;
  			for (j = 0; j < 8; j++) {
  				REVERSE64(context->state[j],context->state[j]);
- 				*d++ = context->state[j];
  			}
  		}
- #else
- 		bcopy(context->state, d, SHA512_DIGEST_LENGTH);
  #endif
  	}
  
  	/* Zero out state data */
--- 831,840 ----
  			int	j;
  			for (j = 0; j < 8; j++) {
  				REVERSE64(context->state[j],context->state[j]);
  			}
  		}
  #endif
+ 		bcopy(context->state, digest, SHA512_DIGEST_LENGTH);
  	}
  
  	/* Zero out state data */
*************** SHA384_Update(SHA384_CTX *context, const
*** 869,876 ****
  void
  SHA384_Final(uint8 digest[], SHA384_CTX *context)
  {
- 	uint64	*d = (uint64 *)digest;
- 
  	/* If no digest buffer is passed, we don't bother doing this: */
  	if (digest != NULL) {
  		SHA512_Last((SHA512_CTX *)context);
--- 862,867 ----
*************** SHA384_Final(uint8 digest[], SHA384_CTX 
*** 882,893 ****
  			int	j;
  			for (j = 0; j < 6; j++) {
  				REVERSE64(context->state[j],context->state[j]);
- 				*d++ = context->state[j];
  			}
  		}
- #else
- 		bcopy(context->state, d, SHA384_DIGEST_LENGTH);
  #endif
  	}
  
  	/* Zero out state data */
--- 873,882 ----
  			int	j;
  			for (j = 0; j < 6; j++) {
  				REVERSE64(context->state[j],context->state[j]);
  			}
  		}
  #endif
+ 		bcopy(context->state, digest, SHA384_DIGEST_LENGTH);
  	}
  
  	/* Zero out state data */