diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 09:01:17 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2020-11-10 09:01:17 +0900 |
commit | 5306c3356854b535fe09654b270f06615bf94e94 (patch) | |
tree | 7fa1c8c677d9d89823b7cd0563f020d9e0d73c61 /src/include/gnunet_identity_service.h | |
parent | ca808598b9c28e1bb089d2d8cb7ec9332f2c0137 (diff) | |
download | gnunet-5306c3356854b535fe09654b270f06615bf94e94.tar.gz gnunet-5306c3356854b535fe09654b270f06615bf94e94.zip |
-fix signatures in revocation
Diffstat (limited to 'src/include/gnunet_identity_service.h')
-rw-r--r-- | src/include/gnunet_identity_service.h | 89 |
1 files changed, 50 insertions, 39 deletions
diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index 66761e526..0174e52aa 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h | |||
@@ -151,9 +151,9 @@ struct GNUNET_IDENTITY_Signature | |||
151 | 151 | ||
152 | union | 152 | union |
153 | { | 153 | { |
154 | /** | 154 | /** |
155 | * An ECDSA signature | 155 | * An ECDSA signature |
156 | */ | 156 | */ |
157 | struct GNUNET_CRYPTO_EcdsaSignature ecdsa_signature; | 157 | struct GNUNET_CRYPTO_EcdsaSignature ecdsa_signature; |
158 | 158 | ||
159 | /** | 159 | /** |
@@ -419,8 +419,8 @@ GNUNET_IDENTITY_key_get_length (const struct GNUNET_IDENTITY_PublicKey *key); | |||
419 | */ | 419 | */ |
420 | ssize_t | 420 | ssize_t |
421 | GNUNET_IDENTITY_read_key_from_buffer (struct GNUNET_IDENTITY_PublicKey *key, | 421 | GNUNET_IDENTITY_read_key_from_buffer (struct GNUNET_IDENTITY_PublicKey *key, |
422 | const void* buffer, | 422 | const void*buffer, |
423 | size_t len); | 423 | size_t len); |
424 | 424 | ||
425 | 425 | ||
426 | /** | 426 | /** |
@@ -436,9 +436,10 @@ GNUNET_IDENTITY_read_key_from_buffer (struct GNUNET_IDENTITY_PublicKey *key, | |||
436 | * @return -1 or -2 on error, else the amount of bytes written to the buffer | 436 | * @return -1 or -2 on error, else the amount of bytes written to the buffer |
437 | */ | 437 | */ |
438 | ssize_t | 438 | ssize_t |
439 | GNUNET_IDENTITY_write_key_to_buffer (const struct GNUNET_IDENTITY_PublicKey *key, | 439 | GNUNET_IDENTITY_write_key_to_buffer (const struct |
440 | void* buffer, | 440 | GNUNET_IDENTITY_PublicKey *key, |
441 | size_t len); | 441 | void*buffer, |
442 | size_t len); | ||
442 | 443 | ||
443 | 444 | ||
444 | /** | 445 | /** |
@@ -452,7 +453,8 @@ GNUNET_IDENTITY_write_key_to_buffer (const struct GNUNET_IDENTITY_PublicKey *key | |||
452 | * @return -1 on error, else the compacted length of the signature. | 453 | * @return -1 on error, else the compacted length of the signature. |
453 | */ | 454 | */ |
454 | ssize_t | 455 | ssize_t |
455 | GNUNET_IDENTITY_signature_get_length (const struct GNUNET_IDENTITY_Signature *sig); | 456 | GNUNET_IDENTITY_signature_get_length (const struct |
457 | GNUNET_IDENTITY_Signature *sig); | ||
456 | 458 | ||
457 | 459 | ||
458 | /** | 460 | /** |
@@ -468,9 +470,10 @@ GNUNET_IDENTITY_signature_get_length (const struct GNUNET_IDENTITY_Signature *si | |||
468 | * @return -1 or -2 on error, else the amount of bytes read from the buffer | 470 | * @return -1 or -2 on error, else the amount of bytes read from the buffer |
469 | */ | 471 | */ |
470 | ssize_t | 472 | ssize_t |
471 | GNUNET_IDENTITY_read_signature_from_buffer (struct GNUNET_IDENTITY_Signature *sig, | 473 | GNUNET_IDENTITY_read_signature_from_buffer (struct |
472 | const void* buffer, | 474 | GNUNET_IDENTITY_Signature *sig, |
473 | size_t len); | 475 | const void*buffer, |
476 | size_t len); | ||
474 | 477 | ||
475 | 478 | ||
476 | /** | 479 | /** |
@@ -486,9 +489,10 @@ GNUNET_IDENTITY_read_signature_from_buffer (struct GNUNET_IDENTITY_Signature *si | |||
486 | * @return -1 or -2 on error, else the amount of bytes written to the buffer | 489 | * @return -1 or -2 on error, else the amount of bytes written to the buffer |
487 | */ | 490 | */ |
488 | ssize_t | 491 | ssize_t |
489 | GNUNET_IDENTITY_write_signature_to_buffer (const struct GNUNET_IDENTITY_Signature *sig, | 492 | GNUNET_IDENTITY_write_signature_to_buffer (const struct |
490 | void* buffer, | 493 | GNUNET_IDENTITY_Signature *sig, |
491 | size_t len); | 494 | void*buffer, |
495 | size_t len); | ||
492 | 496 | ||
493 | 497 | ||
494 | /** | 498 | /** |
@@ -505,9 +509,11 @@ GNUNET_IDENTITY_write_signature_to_buffer (const struct GNUNET_IDENTITY_Signatur | |||
505 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 509 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
506 | */ | 510 | */ |
507 | int | 511 | int |
508 | GNUNET_IDENTITY_private_key_sign_ (const struct GNUNET_IDENTITY_PrivateKey *priv, | 512 | GNUNET_IDENTITY_private_key_sign_ (const struct |
509 | const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, | 513 | GNUNET_IDENTITY_PrivateKey *priv, |
510 | struct GNUNET_IDENTITY_Signature *sig); | 514 | const struct |
515 | GNUNET_CRYPTO_EccSignaturePurpose *purpose, | ||
516 | struct GNUNET_IDENTITY_Signature *sig); | ||
511 | 517 | ||
512 | 518 | ||
513 | /** | 519 | /** |
@@ -528,9 +534,9 @@ GNUNET_IDENTITY_private_key_sign_ (const struct GNUNET_IDENTITY_PrivateKey *priv | |||
528 | GNUNET_static_assert (((void*) (ps)) == \ | 534 | GNUNET_static_assert (((void*) (ps)) == \ |
529 | ((void*) &(ps)->purpose)); \ | 535 | ((void*) &(ps)->purpose)); \ |
530 | GNUNET_assert (GNUNET_OK == \ | 536 | GNUNET_assert (GNUNET_OK == \ |
531 | GNUNET_IDENTITY_private_key_sign_ (priv, \ | 537 | GNUNET_IDENTITY_private_key_sign_ (priv, \ |
532 | &(ps)->purpose, \ | 538 | &(ps)->purpose, \ |
533 | sig)); \ | 539 | sig)); \ |
534 | } while (0) | 540 | } while (0) |
535 | 541 | ||
536 | 542 | ||
@@ -553,9 +559,11 @@ GNUNET_IDENTITY_private_key_sign_ (const struct GNUNET_IDENTITY_PrivateKey *priv | |||
553 | */ | 559 | */ |
554 | int | 560 | int |
555 | GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | 561 | GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, |
556 | const struct GNUNET_CRYPTO_EccSignaturePurpose *validate, | 562 | const struct |
557 | const struct GNUNET_IDENTITY_Signature *sig, | 563 | GNUNET_CRYPTO_EccSignaturePurpose *validate, |
558 | const struct GNUNET_IDENTITY_PublicKey *pub); | 564 | const struct GNUNET_IDENTITY_Signature *sig, |
565 | const struct | ||
566 | GNUNET_IDENTITY_PublicKey *pub); | ||
559 | 567 | ||
560 | 568 | ||
561 | /** | 569 | /** |
@@ -577,10 +585,10 @@ GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | |||
577 | /* check 'ps' begins with the purpose */ \ | 585 | /* check 'ps' begins with the purpose */ \ |
578 | GNUNET_static_assert (((void*) (ps)) == \ | 586 | GNUNET_static_assert (((void*) (ps)) == \ |
579 | ((void*) &(ps)->purpose)); \ | 587 | ((void*) &(ps)->purpose)); \ |
580 | GNUNET_IDENTITY_public_key_verify_(purp, \ | 588 | GNUNET_IDENTITY_public_key_verify_ (purp, \ |
581 | &(ps)->purpose, \ | 589 | &(ps)->purpose, \ |
582 | sig, \ | 590 | sig, \ |
583 | pub); \ | 591 | pub); \ |
584 | }) | 592 | }) |
585 | 593 | ||
586 | 594 | ||
@@ -600,11 +608,11 @@ GNUNET_IDENTITY_public_key_verify_ (uint32_t purpose, | |||
600 | * this size should be the same as @c len. | 608 | * this size should be the same as @c len. |
601 | */ | 609 | */ |
602 | ssize_t | 610 | ssize_t |
603 | GNUNET_IDENTITY_public_key_encrypt(const void *block, | 611 | GNUNET_IDENTITY_public_key_encrypt (const void *block, |
604 | size_t size, | 612 | size_t size, |
605 | const struct GNUNET_IDENTITY_PublicKey *pub, | 613 | const struct GNUNET_IDENTITY_PublicKey *pub, |
606 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, | 614 | struct GNUNET_CRYPTO_EcdhePublicKey *ecc, |
607 | void *result); | 615 | void *result); |
608 | 616 | ||
609 | 617 | ||
610 | /** | 618 | /** |
@@ -622,11 +630,13 @@ GNUNET_IDENTITY_public_key_encrypt(const void *block, | |||
622 | * this size should be the same as @c size. | 630 | * this size should be the same as @c size. |
623 | */ | 631 | */ |
624 | ssize_t | 632 | ssize_t |
625 | GNUNET_IDENTITY_private_key_decrypt(const void *block, | 633 | GNUNET_IDENTITY_private_key_decrypt (const void *block, |
626 | size_t size, | 634 | size_t size, |
627 | const struct GNUNET_IDENTITY_PrivateKey *priv, | 635 | const struct |
628 | const struct GNUNET_CRYPTO_EcdhePublicKey *ecc, | 636 | GNUNET_IDENTITY_PrivateKey *priv, |
629 | void *result); | 637 | const struct |
638 | GNUNET_CRYPTO_EcdhePublicKey *ecc, | ||
639 | void *result); | ||
630 | 640 | ||
631 | 641 | ||
632 | /** | 642 | /** |
@@ -689,7 +699,8 @@ GNUNET_IDENTITY_private_key_from_string (const char*str, | |||
689 | * @return GNUNET_SYSERR on error. | 699 | * @return GNUNET_SYSERR on error. |
690 | */ | 700 | */ |
691 | enum GNUNET_GenericReturnValue | 701 | enum GNUNET_GenericReturnValue |
692 | GNUNET_IDENTITY_key_get_public (const struct GNUNET_IDENTITY_PrivateKey *privkey, | 702 | GNUNET_IDENTITY_key_get_public (const struct |
703 | GNUNET_IDENTITY_PrivateKey *privkey, | ||
693 | struct GNUNET_IDENTITY_PublicKey *key); | 704 | struct GNUNET_IDENTITY_PublicKey *key); |
694 | 705 | ||
695 | 706 | ||