Skip to content

Commit

Permalink
post rebase fixup still some tests unhappy
Browse files Browse the repository at this point in the history
  • Loading branch information
itstheceo committed Jun 26, 2024
1 parent c8b48b7 commit 412cff6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,7 @@ public Either<Error.FormatError, ThirdPartyBlockContents> createBlock(KeyPair ke

byte[] serializedBlock = res.get();

Signature sgr = KeyPair.generateSignature(keyPair.public_key().algorithm);
sgr.initSign(keyPair.private_key());
sgr.update(serializedBlock);

ByteBuffer algo_buf = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN);
algo_buf.putInt(Integer.valueOf(Schema.PublicKey.Algorithm.Ed25519.getNumber()));
algo_buf.flip();
sgr.update(algo_buf);
sgr.update(previousKey.toBytes());
byte[] signature = sgr.sign();
byte[] signature = keyPair.sign(serializedBlock, previousKey.toBytes());

PublicKey publicKey = keyPair.public_key();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,14 @@ public ThirdPartyBlockRequest thirdPartyRequest() {
*/
public UnverifiedBiscuit appendThirdPartyBlock(PublicKey externalKey, ThirdPartyBlockContents blockResponse)
throws NoSuchAlgorithmException, SignatureException, InvalidKeyException, Error {
KeyPair nextKeyPair = KeyPair.generate(Schema.PublicKey.Algorithm.Ed25519);
KeyPair nextKeyPair = KeyPair.generate(externalKey.algorithm);

Signature sgr = KeyPair.generateSignature(externalKey.algorithm);
sgr.initVerify(externalKey.key);

sgr.update(blockResponse.payload);
ByteBuffer algo_buf = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN);
algo_buf.putInt(Integer.valueOf(Schema.PublicKey.Algorithm.Ed25519.getNumber()));
algo_buf.putInt(Integer.valueOf(externalKey.algorithm.getNumber()));
algo_buf.flip();
sgr.update(algo_buf);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

import org.biscuitsec.biscuit.crypto.KeyPair;
import org.biscuitsec.biscuit.crypto.PublicKey;
import org.biscuitsec.biscuit.crypto.Signer;
import org.biscuitsec.biscuit.datalog.SchemaVersion;
import org.biscuitsec.biscuit.datalog.SymbolTable;
import org.biscuitsec.biscuit.datalog.Check;
import org.biscuitsec.biscuit.datalog.Fact;
import org.biscuitsec.biscuit.datalog.Rule;
import org.biscuitsec.biscuit.error.Error;
import org.biscuitsec.biscuit.token.Block;
import io.vavr.Tuple2;
Expand Down

0 comments on commit 412cff6

Please sign in to comment.